From xen-changelog-bounces@lists.xen.org Tue Oct 02 01:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Oct 2012 01:44:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TIrWy-00067b-TR; Tue, 02 Oct 2012 01:44:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWx-00066s-K2
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:15 +0000
Received: from [85.158.139.211:7735] by server-12.bemta-5.messagelabs.com id
	E5/BE-20729-EE64A605; Tue, 02 Oct 2012 01:44:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-206.messagelabs.com!1349142252!20647276!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16062 invoked from network); 2 Oct 2012 01:44:13 -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;
	2 Oct 2012 01:44:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWu-0008Ho-NR
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWu-0001mM-A4
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:12 +0000
Message-Id: <E1TIrWu-0001mM-A4@xenbits.xen.org>
Date: Tue, 02 Oct 2012 01:44:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: Remove
	sched_credit_default_yield option
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1349118199 -3600
# Node ID 16aaeaa66ef957894b1bae9d165b1289184b5f56
# Parent  ffac3db27e2ea6b8f393bcca3d6eb40d5d05b9d1
xen: Remove sched_credit_default_yield option

The sched_credit_default_yield option was added when the behavior of
"SCHEDOP_yield" was changed in 4.1, to allow any users who had
problems to revert to the old behavior.  The new behavior has been in
Xen.org xen since 4.1, and in XenServer even longer, and there is no
evidence of anyone having trouble with it.  Remove the option.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r ffac3db27e2e -r 16aaeaa66ef9 docs/misc/xen-command-line.markdown
--- a/docs/misc/xen-command-line.markdown	Mon Oct 01 20:02:45 2012 +0100
+++ b/docs/misc/xen-command-line.markdown	Mon Oct 01 20:03:19 2012 +0100
@@ -734,9 +734,6 @@ Choose the default scheduler.
 ### sched\_credit2\_migrate\_resist
 > `= <integer>`
 
-### sched\_credit\_default\_yield
-> `= <boolean>`
-
 ### sched\_credit\_tslice\_ms
 > `= <integer>`
 
diff -r ffac3db27e2e -r 16aaeaa66ef9 xen/common/sched_credit.c
--- a/xen/common/sched_credit.c	Mon Oct 01 20:02:45 2012 +0100
+++ b/xen/common/sched_credit.c	Mon Oct 01 20:03:19 2012 +0100
@@ -103,8 +103,6 @@
 /*
  * Boot parameters
  */
-static bool_t __read_mostly sched_credit_default_yield;
-boolean_param("sched_credit_default_yield", sched_credit_default_yield);
 static int __read_mostly sched_credit_tslice_ms = CSCHED_DEFAULT_TSLICE_MS;
 integer_param("sched_credit_tslice_ms", sched_credit_tslice_ms);
 
@@ -783,11 +781,8 @@ csched_vcpu_yield(const struct scheduler
 {
     struct csched_vcpu * const sv = CSCHED_VCPU(vc);
 
-    if ( !sched_credit_default_yield )
-    {
-        /* Let the scheduler know that this vcpu is trying to yield */
-        sv->flags |= CSCHED_FLAG_VCPU_YIELD;
-    }
+    /* Let the scheduler know that this vcpu is trying to yield */
+    sv->flags |= CSCHED_FLAG_VCPU_YIELD;
 }
 
 static int

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

From xen-changelog-bounces@lists.xen.org Tue Oct 02 01:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Oct 2012 01:44:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TIrWz-00067o-Vw; Tue, 02 Oct 2012 01:44:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWy-000670-1D
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:16 +0000
Received: from [85.158.143.99:8377] by server-1.bemta-4.messagelabs.com id
	ED/68-05684-FE64A605; Tue, 02 Oct 2012 01:44:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1349142253!27193334!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19745 invoked from network); 2 Oct 2012 01:44:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Oct 2012 01:44:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWv-0008Hu-LB
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWv-0001mq-GD
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:13 +0000
Message-Id: <E1TIrWv-0001mq-GD@xenbits.xen.org>
Date: Tue, 02 Oct 2012 01:44:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Register Linux PV-on-HVM drivers
	product number.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Paul Durrant <paul.durrant@citrix.com>
# Date 1349118391 -3600
# Node ID 5fbdbf585f5f2ee9a3e3c75a8a9f9f2cc6eda65c
# Parent  f573e10c91b924dbccefddb7cdd7878df6900d1c
Register Linux PV-on-HVM drivers product number.

This is already in use despite never being registereed.
See XEN_IOPORT_LINUX_PRODNUM in include/xen/platform_pci.h

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


diff -r f573e10c91b9 -r 5fbdbf585f5f xen/include/public/hvm/pvdrivers.h
--- a/xen/include/public/hvm/pvdrivers.h	Mon Oct 01 20:05:33 2012 +0100
+++ b/xen/include/public/hvm/pvdrivers.h	Mon Oct 01 20:06:31 2012 +0100
@@ -41,6 +41,7 @@
 #define PVDRIVERS_PRODUCT_LIST(EACH)                         \
         EACH("xensource-windows", 0x0001) /* Citrix */       \
         EACH("gplpv-windows",     0x0002) /* James Harper */ \
+        EACH("linux",             0x0003)                    \
         EACH("experimental",      0xffff)
 
 #endif /* _XEN_PUBLIC_PVDRIVERS_H_ */

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

From xen-changelog-bounces@lists.xen.org Tue Oct 02 01:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Oct 2012 01:44:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TIrWx-000676-Lk; Tue, 02 Oct 2012 01:44:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWw-00066g-KW
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:14 +0000
Received: from [85.158.143.35:16283] by server-2.bemta-4.messagelabs.com id
	4C/DF-06610-DE64A605; Tue, 02 Oct 2012 01:44:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1349142252!4664128!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13447 invoked from network); 2 Oct 2012 01:44:13 -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;
	2 Oct 2012 01:44:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWu-0008Hl-1U
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWt-0001m7-Ov
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:11 +0000
Message-Id: <E1TIrWt-0001m7-Ov@xenbits.xen.org>
Date: Tue, 02 Oct 2012 01:44:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen/console: introduce a 'w'
	debug-key that dumps the console ring
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Matt Wilson <msw@amazon.com>
# Date 1349118165 -3600
# Node ID ffac3db27e2ea6b8f393bcca3d6eb40d5d05b9d1
# Parent  ef898f37a560d56e1559e2acb12b49baeb3f25b8
xen/console: introduce a 'w' debug-key that dumps the console ring

This patch adds a new 'w' debug-key, chosen from the limited remaining
keys only due to its proximity to 'q', that dumps the console ring to
configured console devices. It's useful to for tracking down how an
unresponsive system got into a broken state via serial console.

Signed-off-by: Matt Wilson <msw@amazon.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r ef898f37a560 -r ffac3db27e2e xen/drivers/char/console.c
--- a/xen/drivers/char/console.c	Mon Oct 01 20:01:55 2012 +0100
+++ b/xen/drivers/char/console.c	Mon Oct 01 20:02:45 2012 +0100
@@ -264,6 +264,49 @@ static void sercon_puts(const char *s)
         serial_puts(sercon_handle, s);
 }
 
+static void dump_console_ring_key(unsigned char key)
+{
+    uint32_t idx, len, sofar, c;
+    unsigned int order;
+    char *buf;
+
+    printk("'%c' pressed -> dumping console ring buffer (dmesg)\n", key);
+
+    /* create a buffer in which we'll copy the ring in the correct
+       order and NUL terminate */
+    order = get_order_from_bytes(conring_size + 1);
+    buf = alloc_xenheap_pages(order, 0);
+    if ( buf == NULL )
+    {
+        printk("unable to allocate memory!\n");
+        return;
+    }
+
+    c = conringc;
+    sofar = 0;
+    while ( (c != conringp) )
+    {
+        idx = CONRING_IDX_MASK(c);
+        len = conringp - c;
+        if ( (idx + len) > conring_size )
+            len = conring_size - idx;
+        memcpy(buf + sofar, &conring[idx], len);
+        sofar += len;
+        c += len;
+    }
+    buf[sofar] = '\0';
+
+    sercon_puts(buf);
+    vga_puts(buf);
+
+    free_xenheap_pages(buf, order);
+}
+
+static struct keyhandler dump_console_ring_keyhandler = {
+    .u.fn = dump_console_ring_key,
+    .desc = "synchronously dump console ring buffer (dmesg)"
+};
+
 /* CTRL-<switch_char> switches input direction between Xen and DOM0. */
 #define switch_code (opt_conswitch[0]-'a'+1)
 static int __read_mostly xen_rx = 1; /* FALSE => serial input passed to domain 0. */
@@ -661,6 +704,8 @@ void __init console_endboot(void)
     if ( opt_conswitch[1] == 'x' )
         xen_rx = !xen_rx;
 
+    register_keyhandler('w', &dump_console_ring_keyhandler);
+
     /* Serial input is directed to DOM0 by default. */
     switch_serial_input();
 }

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

From xen-changelog-bounces@lists.xen.org Tue Oct 02 01:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Oct 2012 01:44:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TIrWx-000671-Ir; Tue, 02 Oct 2012 01:44:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWw-00066f-Bt
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:14 +0000
Received: from [85.158.143.99:8359] by server-3.bemta-4.messagelabs.com id
	05/C3-10986-DE64A605; Tue, 02 Oct 2012 01:44:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-216.messagelabs.com!1349142251!24288773!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.7 required=7.0 tests=BODY_RANDOM_LONG,HOT_NASTY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18472 invoked from network); 2 Oct 2012 01:44:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Oct 2012 01:44:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWs-0008Hf-R7
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWs-0001la-L5
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:10 +0000
Message-Id: <E1TIrWs-0001la-L5@xenbits.xen.org>
Date: Tue, 02 Oct 2012 01:44:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: initial documentation for
	xenstore paths
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1349110451 -3600
# Node ID f242352da553a025920ff72eff54b9d6bc717eaa
# Parent  91e8fd3cf266d03891af73a8c745771ab55b5d32
docs: initial documentation for xenstore paths

This is based upon my inspection of a system with a single PV domain
and a single HVM domain running and is therefore very incomplete.

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


diff -r 91e8fd3cf266 -r f242352da553 docs/INDEX
--- a/docs/INDEX	Mon Oct 01 17:49:01 2012 +0100
+++ b/docs/INDEX	Mon Oct 01 17:54:11 2012 +0100
@@ -12,6 +12,7 @@ misc/kexec_and_kdump		Kexec and Kdump fo
 misc/tscmode			TSC Mode HOWTO
 misc/vbd-interface		Xen Guest Disk (VBD) Interface
 misc/xenstore			Xenstore protocol specification
+misc/xenstore-paths		Xenstore path documentation
 misc/xl-disk-configuration	XL Disk Configuration
 misc/xl-network-configuration	XL Network Configuration
 misc/distro_mapping		Distro Directory Layouts
diff -r 91e8fd3cf266 -r f242352da553 docs/misc/libxl_memory.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/misc/libxl_memory.txt	Mon Oct 01 17:54:11 2012 +0100
@@ -0,0 +1,70 @@
+/* === Domain memory breakdown: HVM guests ==================================
+                           
+             +  +----------+                                     +            
+             |  | shadow   |                                     |            
+             |  +----------+                                     |            
+    overhead |  | extra    |                                     |            
+             |  | external |                                     |            
+             |  +----------+                          +          |            
+             |  | extra    |                          |          |            
+             |  | internal |                          |          |            
+             +  +----------+                +         |          | footprint  
+             |  | video    |                |         |          |            
+             |  +----------+  +    +        |         | xen      |            
+             |  |          |  |    |        | actual  | maximum  |            
+             |  |          |  |    |        | target  |          |            
+             |  | guest    |  |    | build  |         |          |            
+             |  |          |  |    | start  |         |          |            
+      static |  |          |  |    |        |         |          |            
+     maximum |  +----------+  |    +        +         +          +            
+             |  |          |  |                                               
+             |  |          |  |                                               
+             |  | balloon  |  | build                                         
+             |  |          |  | maximum                                       
+             |  |          |  |                                               
+             +  +----------+  +                                               
+                
+                
+    extra internal = LIBXL_MAXMEM_CONSTANT
+    extra external = LIBXL_HVM_EXTRA_MEMORY
+    shadow = libxl_domain_build_info.shadow_memkb
+    static maximum = libxl_domain_build_info.max_memkb
+    video = libxl_domain_build_info.video_memkb
+    build start = libxl_domain_build_info.target_memkb
+    libxl_domain_setmaxmem -> xen maximum
+    libxl_set_memory_target -> actual target
+                
+                
+ === Domain memory breakdown: PV guests ==================================
+                
+                
+             +  +----------+                                     +            
+    overhead |  | extra    |                                     |            
+             |  | external |                                     |            
+             |  +----------+                          +          |            
+             |  | extra    |                          |          |            
+             |  | internal |                          |          |            
+             +  +----------+  +    +        +         |          | footprint  
+             |  |          |  |    |        |         | xen      |            
+             |  |          |  |    |        | actual  | maximum  | 
+             |  | guest    |  |    | build  | target  |          |            
+             |  |          |  |    | start  |         |          |            
+      static |  |          |  |    |        |         |          |            
+     maximum |  +----------+  |    +        +         +          +            
+             |  |          |  |                                               
+             |  |          |  |                                               
+             |  | balloon  |  | build                                         
+             |  |          |  | maximum                                       
+             |  |          |  |                                               
+             +  +----------+  +                                               
+                
+
+    extra internal = LIBXL_MAXMEM_CONSTANT
+    extra external = LIBXL_PV_EXTRA_MEMORY
+    static maximum = libxl_domain_build_info.max_memkb
+    build start = libxl_domain_build_info.target_memkb
+    libxl_domain_setmaxmem -> xen maximum
+    libxl_set_memory_target -> actual target
+
+
+ ========================================================================= */
diff -r 91e8fd3cf266 -r f242352da553 docs/misc/xenstore-paths.markdown
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/misc/xenstore-paths.markdown	Mon Oct 01 17:54:11 2012 +0100
@@ -0,0 +1,353 @@
+# XenStore Paths
+
+This document attempts to defines all the paths which are in common
+use by either guests, front-/back-end drivers, toolstacks etc.
+
+The XenStore wire protocol itself is described in
+[xenstore.txt](xenstore.txt).
+
+## Notation
+
+This document is intended to be partially machine readable, such that
+test system etc can use it to validate whether the xenstore paths used
+by a test are allowable etc.
+
+Therefore the following notation conventions apply:
+
+A xenstore path is generically defined as:
+
+        PATH = VALUES [TAGS]
+
+        PATH/* [TAGS]
+
+The first syntax defines a simple path with a single value. The second
+syntax defines an aggregated set of paths which are usually described
+externally to this document. The text will give a pointer to the
+appropriate external documentation.
+
+PATH can contain simple regex constructs following the Perl compatible
+regexp syntax described in pcre(3) or perlre(1). In addition the
+following additional wild card names are defined and are evaluated
+before regexp expansion:
+
+* ~ -- expands to an arbitrary a domain's home path (described below).
+  Only valid at the begining of a path.
+* $DEVID -- a per-device type device identifier. Typically an integer.
+* $DOMID -- a domain identifier, an integer. Typically this refers to
+  the "other" domain. i.e. ~ refers to the domain providing a service
+  while $DOMID is the consumer of that service.
+* $UUID -- a UUID in the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+
+VALUES are strings and can take the following forms:
+
+* PATH -- a XenStore path.
+* STRING -- an arbitrary string.
+* INTEGER -- An integer, in decimal representation unless otherwise
+  noted.
+ * MEMKB -- the decimal representation of a number of kilobytes.
+ * EVTCHN -- the decimal representation of an event channel.
+ * GNTREF -- the decimal representation of a grant reference.
+* "a literal string" -- literal strings are contained within quotes.
+* (VALUE | VALUE | ... ) -- a set of alternatives. Alternatives are
+  separated by a "|" and all the alternatives are enclosed in "(" and
+  ")".
+
+Additional TAGS may follow as a comma separated set of the following
+tags enclosed in square brackets.
+
+* w -- Path is writable by the containing domain, that is the domain
+  whose home path ~ this key is under or which /vm/$UUID refers to. By
+  default paths under both of these locations are read only for the
+  domain.
+* n -- Path is neither readable nor writeable for guest domains.
+* HVM -- Path is valid for HVM domains only
+* PV --  Path is valid for PV domains only
+* BACKEND -- Path is valid for a backend domain (AKA driver domain)
+* INTERNAL -- Although a path is visible to the domain its use is
+  reserved for the virtual firmware or Xen platform code. Guest
+  Operating Systems must not read this key or otherwise rely on its
+  presence or contents.
+* DEPRECATED -- This path is deprecated and may be removed in its
+  current form in the future. Guests should not add new dependencies
+  on such paths.
+
+Owning domain means the domain whose home path this tag is found
+under.
+
+Lack of either a __HVM__ or __PV__ tag indicates that the path is
+valid for either type of domain (including PVonHVM and similar mixed
+domain types).
+
+## Domain Home Path
+
+Every domain has a home path within the xenstore hierarchy. This is
+the path where the majority of the domain-visible information about
+each domain is stored.
+
+This path is:
+
+      /local/domain/$DOMID
+
+All non-absolute paths are relative to this path.
+
+Although this path could be considered a "Home Directory" for the
+domain it would not usually be writable by the domain. The tools will
+create writable subdirectories as necessary.
+
+## Per Domain Paths
+
+## General Paths
+
+#### ~/vm = PATH []
+
+A pointer back to the domain's /vm/$UUID path (described below).
+
+#### ~/name = STRING []
+
+The guests name.
+
+#### ~/domid = INTEGER   []
+
+The domain's own ID.
+
+#### ~/image/device-model-pid = INTEGER   [INTERNAL]
+
+The process ID of the device model associated with this domain, if it
+has one.
+
+#### ~/cpu/[0-9]+/availability = ("online"|"offline") [PV]
+
+One node for each virtual CPU up to the guest's configured
+maximum. Valid values are "online" and "offline". The guest is expected to react to changes in this path by bringing the appropriate VCPU on or offline using the VCPUOP interface described in [xen/include/public/vcpu.h][VCPU]
+
+This protocol is not currently well documented.
+
+#### ~/memory/static-max = MEMKB []
+
+Specifies a static maximum amount memory which this domain should
+expect to be given. In the absence of in-guest memory hotplug support
+this set on domain boot and is usually the maximum amount of RAM which
+a guest can make use of. See [docs/misc/libxl_memory.txt][LIBXLMEM]
+for a description of how memory is accounted for in toolstacks using
+the libxl library.
+
+#### ~/memory/target = MEMKB []
+
+The current balloon target for the domain. The balloon driver within
+the guest is expected to make every effort to every effort use no more
+than this amount of RAM.
+
+#### ~/memory/videoram = MEMKB [HVM,INTERNAL]
+
+The size of the video RAM this domain is configured with.
+
+#### ~/device/suspend/event-channel = ""|EVTCHN [w]
+
+The domain's suspend event channel. The use of a suspend event channel
+is optional at the domain's discretion. The toolstack will create this
+path with an empty value which the guest may choose to overwrite.
+
+#### ~/hvmloader/generation-id-address = ADDRESS [r,HVM,INTERNAL]
+
+The hexadecimal representation of the address of the domain's
+"generation id".
+
+#### ~/hvmloader/bios = ("rombios"|"seabios"|"OVMF") [HVM,INTERNAL]
+
+The BIOS used by this domain.
+
+#### ~/platform/* [HVM,INTERNAL]
+
+Various platform properties.
+
+* acpi -- is ACPI enabled for this domain
+* acpi_s3 -- is ACPI S3 support enabled for this domain
+* acpi_s4 -- is ACPI S4 support enabled for this domain
+
+### Frontend device paths
+
+Paravirtual device frontends are generally specified by their own
+directory within the XenStore hierarchy. Usually this is under
+~/device/$TYPE/$DEVID although there are exceptions, e.g. ~/console
+for the first PV console.
+
+#### ~/device/vbd/$DEVID/* []
+
+A virtual block device frontend. Described by
+[xen/include/public/io/blkif.h][BLKIF]
+
+#### ~/device/vfb/$DEVID/* []
+
+A virtual framebuffer frontend. Described by
+[xen/include/public/io/fbif.h][FBIF]
+
+#### ~/device/vkbd/$DEVID/* []
+
+A virtual keyboard device frontend. Described by
+[xen/include/public/io/kbdif.h][KBDIF]
+
+#### ~/device/vif/$DEVID/* []
+
+A virtual network device frontend. Described by
+[xen/include/public/io/netif.h][NETIF]
+
+#### ~/console/* []
+
+The primary PV console device. Described in [console.txt](console.txt)
+
+#### ~/device/console/$DEVID/* []
+
+A secondary PV console device. Described in [console.txt](console.txt)
+
+#### ~/device/serial/$DEVID/* [HVM]
+
+An emulated serial device. Described in [console.txt](console.txt)
+
+#### ~/store/port = EVTCHN [DEPRECATED]
+
+The event channel used by the domain's connection to XenStore.
+
+This path is deprecated since the same information is provided via the
+[start_info][SI] for PV guests and as an [HVM param][HVMPARAMS] for
+HVM guests. There is an obvious chicken and egg problem with
+extracting this value from xenstore in order to setup the xenstore
+communication ring.
+
+#### ~/store/ring-ref = GNTREF [DEPRECATED]
+
+The grant reference of the domain's XenStore ring.
+
+As with ~/store/port this path is deprecated.
+
+### Backend Device Paths
+
+Paravirtual device backends are generally specified by their own
+directory within the XenStore hierarchy. Usually this is under
+~/backend/$TYPE/$DOMID/$DEVID.
+
+#### ~/backend/vbd/$DOMID/$DEVID/* []
+
+A virtual block device backend. Described by
+[xen/include/public/io/blkif.h][BLKIF]
+
+Uses the in-kernel blkback driver.
+
+#### ~/backend/qdisk/$DOMID/$DEVID/* []
+
+A virtual block device backend. Described by
+[xen/include/public/io/blkif.h][BLKIF]
+
+Uses the qemu based disk backend.
+
+#### ~/backend/tap/$DOMID/$DEVID/* []
+
+A virtual block device backend. Described by
+[xen/include/public/io/blkif.h][BLKIF]
+
+Uses the in-kernel blktap (v1) disk backend (deprecated).
+
+#### ~/backend/vfb/$DOMID/$DEVID/* []
+
+A virtual framebuffer backend. Described by
+[xen/include/public/io/fbif.h][FBIF]
+
+#### ~/backend/vkbd/$DOMID/$DEVID/* []
+
+A virtual keyboard device backend. Described by
+[xen/include/public/io/kbdif.h][KBDIF]
+
+#### ~/backend/vif/$DOMID/$DEVID/* []
+
+A virtual network device backend. Described by
+[xen/include/public/io/netif.h][NETIF]
+
+#### ~/backend/console/$DOMID/$DEVID/* []
+
+A PV console backend. Described in [console.txt](console.txt)
+
+#### ~/device-model/$DOMID/* [INTERNAL]
+
+Information relating to device models running in the domain. $DOMID is
+the target domain of the device model.
+
+#### ~/libxl/disable_udev = ("1"|"0") []
+
+Indicates whether device hotplug scripts in this domain should be run
+by udev ("0") or will be run by the toolstack directly ("1").
+
+### Platform Feature and Control Paths
+
+#### ~/control/shutdown = (""|COMMAND) [w]
+
+This is the PV shutdown control node. A toolstack can write various
+commands here to cause various guest shutdown, reboot or suspend
+activities. The guest acknowledges a request by writing the empty
+string back to the command node.
+
+The precise protocol is not yet documented.
+
+#### ~/control/platform-feature-multiprocessor-suspend = (0|1) []
+
+Indicates to the guest that this platform supports the multiprocessor
+suspend feature.
+
+#### ~/control/platform-feature-xs\_reset\_watches = (0|1) []
+
+Indicates to the guest that this platform supports the
+XS_RESET_WATCHES xenstore message. See
+[xen/include/public/io/xs\_wire.h][XSWIRE] for the XenStore wire
+protocol definition.
+
+### Domain Controlled Paths
+
+#### ~/data/* [w]
+
+A domain writable path. Available for arbitrary domain use.
+
+## Virtual Machine Paths
+
+The /vm/$UUID namespace is used by toolstacks to store various
+information relating to the domain which is not intended to be guest
+visible (hence they are all tagged [n,INTERNAL]).
+
+Several of the keys here are not well defined and/or not well located
+and are liable to be replaced with more fully defined paths in the
+future.
+
+### /vm/$UUID/uuid = UUID [n,INTERNAL]
+
+Value is the same UUID as the path.
+
+### /vm/$UUID/name = STRING [n,INTERNAL]
+
+The domain's name.
+
+### /vm/$UUID/image/* [n,INTERNAL]
+
+Various information relating to the domain builder used for this guest.
+
+### /vm/$UUID/start_time = INTEGER "." INTEGER [n,INTERNAL]
+
+The time which the guest was started in SECONDS.MICROSECONDS format
+
+### /vm/$UUID/rtc/timeoffset = ""|INTEGER [n,HVM,INTERNAL]
+
+The guest's virtual time offset from UTC in seconds.
+
+## Platform-Level paths
+
+### libxl Specific Paths
+
+#### /libxl/$DOMID/dm-version ("qemu\_xen"|"qemu\_xen\_traditional") = [n,INTERNAL]
+
+The device model version for a domain.
+
+[BLKIF]: http://xenbits.xen.org/docs/unstable/hypercall/include,public,io,blkif.h.html
+[FBIF]: http://xenbits.xen.org/docs/unstable/hypercall/include,public,io,fbif.h.html
+[HVMPARAMS]: http://xenbits.xen.org/docs/unstable/hypercall/include,public,hvm,params.h.html
+[KBDIF]: http://xenbits.xen.org/docs/unstable/hypercall/include,public,io,kbdif.h.html
+[LIBXLMEM]: http://xenbits.xen.org/docs/unstable/misc/libxl_memory.txt
+[NETIF]: http://xenbits.xen.org/docs/unstable/hypercall/include,public,io,netif.h.html
+[SI]: http://xenbits.xen.org/docs/unstable/hypercall/include,public,xen.h.html#Struct_start_info
+[VCPU]: http://xenbits.xen.org/docs/unstable/hypercall/include,public,vcpu.h.html
+[XSWIRE]: http://xenbits.xen.org/docs/unstable/hypercall/include,public,io,xs_wire.h.html
diff -r 91e8fd3cf266 -r f242352da553 tools/libxl/libxl_memory.txt
--- a/tools/libxl/libxl_memory.txt	Mon Oct 01 17:49:01 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/* === Domain memory breakdown: HVM guests ==================================
-                           
-             +  +----------+                                     +            
-             |  | shadow   |                                     |            
-             |  +----------+                                     |            
-    overhead |  | extra    |                                     |            
-             |  | external |                                     |            
-             |  +----------+                          +          |            
-             |  | extra    |                          |          |            
-             |  | internal |                          |          |            
-             +  +----------+                +         |          | footprint  
-             |  | video    |                |         |          |            
-             |  +----------+  +    +        |         | xen      |            
-             |  |          |  |    |        | actual  | maximum  |            
-             |  |          |  |    |        | target  |          |            
-             |  | guest    |  |    | build  |         |          |            
-             |  |          |  |    | start  |         |          |            
-      static |  |          |  |    |        |         |          |            
-     maximum |  +----------+  |    +        +         +          +            
-             |  |          |  |                                               
-             |  |          |  |                                               
-             |  | balloon  |  | build                                         
-             |  |          |  | maximum                                       
-             |  |          |  |                                               
-             +  +----------+  +                                               
-                
-                
-    extra internal = LIBXL_MAXMEM_CONSTANT
-    extra external = LIBXL_HVM_EXTRA_MEMORY
-    shadow = libxl_domain_build_info.shadow_memkb
-    static maximum = libxl_domain_build_info.max_memkb
-    video = libxl_domain_build_info.video_memkb
-    build start = libxl_domain_build_info.target_memkb
-    libxl_domain_setmaxmem -> xen maximum
-    libxl_set_memory_target -> actual target
-                
-                
- === Domain memory breakdown: PV guests ==================================
-                
-                
-             +  +----------+                                     +            
-    overhead |  | extra    |                                     |            
-             |  | external |                                     |            
-             |  +----------+                          +          |            
-             |  | extra    |                          |          |            
-             |  | internal |                          |          |            
-             +  +----------+  +    +        +         |          | footprint  
-             |  |          |  |    |        |         | xen      |            
-             |  |          |  |    |        | actual  | maximum  | 
-             |  | guest    |  |    | build  | target  |          |            
-             |  |          |  |    | start  |         |          |            
-      static |  |          |  |    |        |         |          |            
-     maximum |  +----------+  |    +        +         +          +            
-             |  |          |  |                                               
-             |  |          |  |                                               
-             |  | balloon  |  | build                                         
-             |  |          |  | maximum                                       
-             |  |          |  |                                               
-             +  +----------+  +                                               
-                
-
-    extra internal = LIBXL_MAXMEM_CONSTANT
-    extra external = LIBXL_PV_EXTRA_MEMORY
-    static maximum = libxl_domain_build_info.max_memkb
-    build start = libxl_domain_build_info.target_memkb
-    libxl_domain_setmaxmem -> xen maximum
-    libxl_set_memory_target -> actual target
-
-
- ========================================================================= */

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

From xen-changelog-bounces@lists.xen.org Tue Oct 02 01:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Oct 2012 01:44:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TIrX0-00067t-2V; Tue, 02 Oct 2012 01:44:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWy-000678-8c
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:16 +0000
Received: from [85.158.138.51:46555] by server-11.bemta-3.messagelabs.com id
	C7/AD-21460-FE64A605; Tue, 02 Oct 2012 01:44:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-174.messagelabs.com!1349142253!24631065!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11989 invoked from network); 2 Oct 2012 01:44:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Oct 2012 01:44:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWv-0008Hr-3O
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWu-0001mb-UD
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:12 +0000
Message-Id: <E1TIrWu-0001mb-UD@xenbits.xen.org>
Date: Tue, 02 Oct 2012 01:44:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Add a new pvdrivers header to serve
	as the register of product numbers.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Paul Durrant <paul.durrant@citrix.com>
# Date 1349118333 -3600
# Node ID f573e10c91b924dbccefddb7cdd7878df6900d1c
# Parent  16aaeaa66ef957894b1bae9d165b1289184b5f56
Add a new pvdrivers header to serve as the register of product numbers.

These product numbers are used by the QEMU blacklisting protocol in
traditional QEMU and are currently coded directly into the xenstore.c
source module. Since there are now multiple QEMUs this information
should be pulled into a public header to avoid duplication/conflict.
hvm-emulated-unplug.markdown has also been adjusted to reference the
new header.

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


diff -r 16aaeaa66ef9 -r f573e10c91b9 docs/misc/hvm-emulated-unplug.markdown
--- a/docs/misc/hvm-emulated-unplug.markdown	Mon Oct 01 20:03:19 2012 +0100
+++ b/docs/misc/hvm-emulated-unplug.markdown	Mon Oct 01 20:05:33 2012 +0100
@@ -65,4 +65,4 @@ decimal number.  `{product_name}` is a s
 product number in step 3.
 
 The master registry of product names and numbers is in
-qemu-xen-unstable's xenstore.c.
+xen/include/public/hvm/pvdrivers.h
diff -r 16aaeaa66ef9 -r f573e10c91b9 xen/include/public/hvm/pvdrivers.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/include/public/hvm/pvdrivers.h	Mon Oct 01 20:05:33 2012 +0100
@@ -0,0 +1,46 @@
+/*
+ * pvdrivers.h: Register of PV drivers product numbers.
+ * Copyright (c) 2012, Citrix Systems Inc.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef _XEN_PUBLIC_PVDRIVERS_H_
+#define _XEN_PUBLIC_PVDRIVERS_H_
+
+/*
+ * This is the master registry of product numbers for
+ * PV drivers. 
+ * If you need a new product number allocating, please
+ * post to xen-devel@lists.xensource.com.  You should NOT use
+ * a product number without allocating one.
+ * If you maintain a separate versioning and distribution path
+ * for PV drivers you should have a separate product number so
+ * that your drivers can be separated from others.
+ *
+ * During development, you may use the product ID to
+ * indicate a driver which is yet to be released.
+ */
+
+#define PVDRIVERS_PRODUCT_LIST(EACH)                         \
+        EACH("xensource-windows", 0x0001) /* Citrix */       \
+        EACH("gplpv-windows",     0x0002) /* James Harper */ \
+        EACH("experimental",      0xffff)
+
+#endif /* _XEN_PUBLIC_PVDRIVERS_H_ */

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

From xen-changelog-bounces@lists.xen.org Tue Oct 02 01:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Oct 2012 01:44:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TIrWy-00067U-QL; Tue, 02 Oct 2012 01:44:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWw-00066h-PQ
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:15 +0000
Received: from [85.158.138.51:50283] by server-6.bemta-3.messagelabs.com id
	61/B4-11085-EE64A605; Tue, 02 Oct 2012 01:44:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-174.messagelabs.com!1349142251!24631061!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11966 invoked from network); 2 Oct 2012 01:44:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Oct 2012 01:44:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWt-0008Hi-Ik
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWt-0001lq-7l
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:11 +0000
Message-Id: <E1TIrWt-0001lq-7l@xenbits.xen.org>
Date: Tue, 02 Oct 2012 01:44:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hvmloader: Add 64 bits big bar
	support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Xiantao Zhang <xiantao.zhang@intel.com>
# Date 1349118115 -3600
# Node ID ef898f37a560d56e1559e2acb12b49baeb3f25b8
# Parent  f242352da553a025920ff72eff54b9d6bc717eaa
hvmloader: Add 64 bits big bar support

Currently it is assumed PCI device BAR access < 4G memory. If there is
such a device whose BAR size is larger than 4G, it must access > 4G
memory address.  This patch enable the 64bits big BAR support on
hvmloader.

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Xudong Hao <xudong.hao@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r f242352da553 -r ef898f37a560 tools/firmware/hvmloader/cacheattr.c
--- a/tools/firmware/hvmloader/cacheattr.c	Mon Oct 01 17:54:11 2012 +0100
+++ b/tools/firmware/hvmloader/cacheattr.c	Mon Oct 01 20:01:55 2012 +0100
@@ -40,17 +40,10 @@
 #define MSR_PAT              0x0277
 #define MSR_MTRRdefType      0x02ff
 
-void cacheattr_init(void)
+unsigned int cpu_phys_addr(void)
 {
     uint32_t eax, ebx, ecx, edx;
-    uint64_t mtrr_cap, mtrr_def, content, addr_mask;
-    unsigned int i, nr_var_ranges, phys_bits = 36;
-
-    /* Does the CPU support architectural MTRRs? */
-    cpuid(0x00000001, &eax, &ebx, &ecx, &edx);
-    if ( !(edx & (1u << 12)) )
-         return;
-
+    unsigned int phys_bits = 36;
     /* Find the physical address size for this CPU. */
     cpuid(0x80000000, &eax, &ebx, &ecx, &edx);
     if ( eax >= 0x80000008 )
@@ -59,6 +52,22 @@ void cacheattr_init(void)
         phys_bits = (uint8_t)eax;
     }
 
+    return phys_bits;
+}
+
+void cacheattr_init(void)
+{
+    uint32_t eax, ebx, ecx, edx;
+    uint64_t mtrr_cap, mtrr_def, content, addr_mask;
+    unsigned int i, nr_var_ranges, phys_bits;
+
+    /* Does the CPU support architectural MTRRs? */
+    cpuid(0x00000001, &eax, &ebx, &ecx, &edx);
+    if ( !(edx & (1u << 12)) )
+         return;
+
+    phys_bits = cpu_phys_addr();
+
     printf("%u-bit phys ... ", phys_bits);
 
     addr_mask = ((1ull << phys_bits) - 1) & ~((1ull << 12) - 1);
diff -r f242352da553 -r ef898f37a560 tools/firmware/hvmloader/config.h
--- a/tools/firmware/hvmloader/config.h	Mon Oct 01 17:54:11 2012 +0100
+++ b/tools/firmware/hvmloader/config.h	Mon Oct 01 20:01:55 2012 +0100
@@ -53,6 +53,8 @@ extern struct bios_config ovmf_config;
 /* MMIO hole: Hardcoded defaults, which can be dynamically expanded. */
 #define PCI_MEM_START       0xf0000000
 #define PCI_MEM_END         0xfc000000
+#define PCI_MIN_BIG_BAR_SIZE          0x20000000
+
 extern unsigned long pci_mem_start, pci_mem_end;
 
 
diff -r f242352da553 -r ef898f37a560 tools/firmware/hvmloader/pci.c
--- a/tools/firmware/hvmloader/pci.c	Mon Oct 01 17:54:11 2012 +0100
+++ b/tools/firmware/hvmloader/pci.c	Mon Oct 01 20:01:55 2012 +0100
@@ -36,19 +36,25 @@ unsigned long igd_opregion_pgbase = 0;
 
 void pci_setup(void)
 {
-    uint32_t base, devfn, bar_reg, bar_data, bar_sz, cmd, mmio_total = 0;
+    uint8_t is_64bar, using_64bar, bar64_relocate = 0;
+    uint32_t devfn, bar_reg, cmd, bar_data, bar_data_upper;
+    uint64_t base, bar_sz, bar_sz_upper, mmio_total = 0;
     uint32_t vga_devfn = 256;
     uint16_t class, vendor_id, device_id;
     unsigned int bar, pin, link, isa_irq;
+    int64_t mmio_left;
 
     /* Resources assignable to PCI devices via BARs. */
     struct resource {
-        uint32_t base, max;
-    } *resource, mem_resource, io_resource;
+        uint64_t base, max;
+    } *resource, mem_resource, high_mem_resource, io_resource;
 
     /* Create a list of device BARs in descending order of size. */
     struct bars {
-        uint32_t devfn, bar_reg, bar_sz;
+        uint32_t is_64bar;
+        uint32_t devfn;
+        uint32_t bar_reg;
+        uint64_t bar_sz;
     } *bars = (struct bars *)scratch_start;
     unsigned int i, nr_bars = 0;
 
@@ -133,22 +139,34 @@ void pci_setup(void)
         /* Map the I/O memory and port resources. */
         for ( bar = 0; bar < 7; bar++ )
         {
+            bar_sz_upper = 0;
             bar_reg = PCI_BASE_ADDRESS_0 + 4*bar;
             if ( bar == 6 )
                 bar_reg = PCI_ROM_ADDRESS;
 
             bar_data = pci_readl(devfn, bar_reg);
+            is_64bar = !!((bar_data & (PCI_BASE_ADDRESS_SPACE |
+                         PCI_BASE_ADDRESS_MEM_TYPE_MASK)) ==
+                         (PCI_BASE_ADDRESS_SPACE_MEMORY |
+                         PCI_BASE_ADDRESS_MEM_TYPE_64));
             pci_writel(devfn, bar_reg, ~0);
             bar_sz = pci_readl(devfn, bar_reg);
             pci_writel(devfn, bar_reg, bar_data);
-            if ( bar_sz == 0 )
-                continue;
 
             bar_sz &= (((bar_data & PCI_BASE_ADDRESS_SPACE) ==
                         PCI_BASE_ADDRESS_SPACE_MEMORY) ?
                        PCI_BASE_ADDRESS_MEM_MASK :
                        (PCI_BASE_ADDRESS_IO_MASK & 0xffff));
+            if (is_64bar) {
+                bar_data_upper = pci_readl(devfn, bar_reg + 4);
+                pci_writel(devfn, bar_reg + 4, ~0);
+                bar_sz_upper = pci_readl(devfn, bar_reg + 4);
+                pci_writel(devfn, bar_reg + 4, bar_data_upper);
+                bar_sz = (bar_sz_upper << 32) | bar_sz;
+            }
             bar_sz &= ~(bar_sz - 1);
+            if ( bar_sz == 0 )
+                continue;
 
             for ( i = 0; i < nr_bars; i++ )
                 if ( bars[i].bar_sz < bar_sz )
@@ -157,6 +175,7 @@ void pci_setup(void)
             if ( i != nr_bars )
                 memmove(&bars[i+1], &bars[i], (nr_bars-i) * sizeof(*bars));
 
+            bars[i].is_64bar = is_64bar;
             bars[i].devfn   = devfn;
             bars[i].bar_reg = bar_reg;
             bars[i].bar_sz  = bar_sz;
@@ -167,11 +186,8 @@ void pci_setup(void)
 
             nr_bars++;
 
-            /* Skip the upper-half of the address for a 64-bit BAR. */
-            if ( (bar_data & (PCI_BASE_ADDRESS_SPACE |
-                              PCI_BASE_ADDRESS_MEM_TYPE_MASK)) == 
-                 (PCI_BASE_ADDRESS_SPACE_MEMORY | 
-                  PCI_BASE_ADDRESS_MEM_TYPE_64) )
+            /*The upper half is already calculated, skip it! */
+            if (is_64bar)
                 bar++;
         }
 
@@ -197,6 +213,9 @@ void pci_setup(void)
             ((pci_mem_start << 1) != 0) )
         pci_mem_start <<= 1;
 
+    if ( (pci_mem_start << 1) != 0 )
+        bar64_relocate = 1;
+
     /* Relocate RAM that overlaps PCI space (in 64k-page chunks). */
     while ( (pci_mem_start >> PAGE_SHIFT) < hvm_info->low_mem_pgend )
     {
@@ -218,11 +237,15 @@ void pci_setup(void)
         hvm_info->high_mem_pgend += nr_pages;
     }
 
+    high_mem_resource.base = ((uint64_t)hvm_info->high_mem_pgend) << PAGE_SHIFT; 
+    high_mem_resource.max = 1ull << cpu_phys_addr();
     mem_resource.base = pci_mem_start;
     mem_resource.max = pci_mem_end;
     io_resource.base = 0xc000;
     io_resource.max = 0x10000;
 
+    mmio_left = pci_mem_end - pci_mem_start;
+
     /* Assign iomem and ioport resources in descending order of size. */
     for ( i = 0; i < nr_bars; i++ )
     {
@@ -230,13 +253,29 @@ void pci_setup(void)
         bar_reg = bars[i].bar_reg;
         bar_sz  = bars[i].bar_sz;
 
+        using_64bar = bars[i].is_64bar && bar64_relocate && (mmio_left < bar_sz);
         bar_data = pci_readl(devfn, bar_reg);
 
         if ( (bar_data & PCI_BASE_ADDRESS_SPACE) ==
              PCI_BASE_ADDRESS_SPACE_MEMORY )
         {
-            resource = &mem_resource;
-            bar_data &= ~PCI_BASE_ADDRESS_MEM_MASK;
+            /* Mapping high memory if PCI deivce is 64 bits bar and the bar size
+               is larger than 512M */
+            if (using_64bar && (bar_sz > PCI_MIN_BIG_BAR_SIZE)) {
+                if ( high_mem_resource.base & (bar_sz - 1) )
+                    high_mem_resource.base = high_mem_resource.base - 
+                        (high_mem_resource.base & (bar_sz - 1)) + bar_sz;
+                else
+                    high_mem_resource.base = high_mem_resource.base - 
+                        (high_mem_resource.base & (bar_sz - 1));
+                resource = &high_mem_resource;
+                bar_data &= ~PCI_BASE_ADDRESS_MEM_MASK;
+            } 
+            else {
+                resource = &mem_resource;
+                bar_data &= ~PCI_BASE_ADDRESS_MEM_MASK;
+            }
+            mmio_left -= bar_sz;
         }
         else
         {
@@ -244,13 +283,14 @@ void pci_setup(void)
             bar_data &= ~PCI_BASE_ADDRESS_IO_MASK;
         }
 
-        base = (resource->base + bar_sz - 1) & ~(bar_sz - 1);
-        bar_data |= base;
+        base = (resource->base  + bar_sz - 1) & ~(uint64_t)(bar_sz - 1);
+        bar_data |= (uint32_t)base;
+        bar_data_upper = (uint32_t)(base >> 32);
         base += bar_sz;
 
         if ( (base < resource->base) || (base > resource->max) )
         {
-            printf("pci dev %02x:%x bar %02x size %08x: no space for "
+            printf("pci dev %02x:%x bar %02x size %llx: no space for "
                    "resource!\n", devfn>>3, devfn&7, bar_reg, bar_sz);
             continue;
         }
@@ -258,8 +298,11 @@ void pci_setup(void)
         resource->base = base;
 
         pci_writel(devfn, bar_reg, bar_data);
-        printf("pci dev %02x:%x bar %02x size %08x: %08x\n",
+        if (using_64bar)
+            pci_writel(devfn, bar_reg + 4, bar_data_upper);
+        printf("pci dev %02x:%x bar %02x size %llx: %08x\n",
                devfn>>3, devfn&7, bar_reg, bar_sz, bar_data);
+			
 
         /* Now enable the memory or I/O mapping. */
         cmd = pci_readw(devfn, PCI_COMMAND);
diff -r f242352da553 -r ef898f37a560 tools/firmware/hvmloader/util.h
--- a/tools/firmware/hvmloader/util.h	Mon Oct 01 17:54:11 2012 +0100
+++ b/tools/firmware/hvmloader/util.h	Mon Oct 01 20:01:55 2012 +0100
@@ -215,6 +215,7 @@ void pci_setup(void);
 uint32_t rombios_highbios_setup(void);
 
 /* Miscellaneous. */
+unsigned int cpu_phys_addr(void);
 void cacheattr_init(void);
 unsigned long create_mp_tables(void *table);
 void hvm_write_smbios_tables(

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

From xen-changelog-bounces@lists.xen.org Tue Oct 02 01:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Oct 2012 01:44:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TIrWw-00066i-Fk; Tue, 02 Oct 2012 01:44:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWv-00066a-5m
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:13 +0000
Received: from [85.158.138.51:50252] by server-7.bemta-3.messagelabs.com id
	B9/74-15765-CE64A605; Tue, 02 Oct 2012 01:44:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1349142250!32625451!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30778 invoked from network); 2 Oct 2012 01:44:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Oct 2012 01:44:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWs-0008Hc-8X
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWr-0001lL-Tg
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:10 +0000
Message-Id: <E1TIrWr-0001lL-Tg@xenbits.xen.org>
Date: Tue, 02 Oct 2012 01:44:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: Document scheduler-related Xen
	command-line options
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1349110141 -3600
# Node ID 91e8fd3cf266d03891af73a8c745771ab55b5d32
# Parent  bd953fda6106aa1b1cce43379fdf1c946c1e1293
docs: Document scheduler-related Xen command-line options

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


diff -r bd953fda6106 -r 91e8fd3cf266 docs/misc/xen-command-line.markdown
--- a/docs/misc/xen-command-line.markdown	Fri Sep 28 10:59:41 2012 +0200
+++ b/docs/misc/xen-command-line.markdown	Mon Oct 01 17:49:01 2012 +0100
@@ -740,12 +740,34 @@ Choose the default scheduler.
 ### sched\_credit\_tslice\_ms
 > `= <integer>`
 
+Set the timeslice of the credit1 scheduler, in milliseconds.  The
+default is 30ms.  Reasonable values may include 10, 5, or even 1 for
+very latency-sensitive workloads.
+
 ### sched\_ratelimit\_us
 > `= <integer>`
 
+In order to limit the rate of context switching, set the minimum
+amount of time that a vcpu can be scheduled for before preempting it,
+in microseconds.  The default is 1000us (1ms).  Setting this to 0
+disables it altogether.
+
 ### sched\_smt\_power\_savings
 > `= <boolean>`
 
+Normally Xen will try to maximize performance and cache utilization by
+spreading out vcpus across as many different divisions as possible
+(i.e, numa nodes, sockets, cores threads, &c).  This often maximizes
+throughput, but also maximizes energy usage, since it reduces the
+depth to which a processor can sleep.
+
+This option inverts the logic, so that the scheduler in effect tries
+to keep the vcpus on the smallest amount of silicon possible; i.e.,
+first fill up sibling threads, then sibling cores, then sibling
+sockets, &c.  This will reduce performance somewhat, particularly on
+systems with hyperthreading enabled, but should reduce power by
+enabling more sockets and cores to go into deeper sleep states.
+
 ### serial\_tx\_buffer
 > `= <size>`
 

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

From xen-changelog-bounces@lists.xen.org Tue Oct 02 01:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Oct 2012 01:44:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TIrWx-000671-Ir; Tue, 02 Oct 2012 01:44:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWw-00066f-Bt
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:14 +0000
Received: from [85.158.143.99:8359] by server-3.bemta-4.messagelabs.com id
	05/C3-10986-DE64A605; Tue, 02 Oct 2012 01:44:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-216.messagelabs.com!1349142251!24288773!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.7 required=7.0 tests=BODY_RANDOM_LONG,HOT_NASTY
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18472 invoked from network); 2 Oct 2012 01:44:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Oct 2012 01:44:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWs-0008Hf-R7
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWs-0001la-L5
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:10 +0000
Message-Id: <E1TIrWs-0001la-L5@xenbits.xen.org>
Date: Tue, 02 Oct 2012 01:44:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: initial documentation for
	xenstore paths
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1349110451 -3600
# Node ID f242352da553a025920ff72eff54b9d6bc717eaa
# Parent  91e8fd3cf266d03891af73a8c745771ab55b5d32
docs: initial documentation for xenstore paths

This is based upon my inspection of a system with a single PV domain
and a single HVM domain running and is therefore very incomplete.

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


diff -r 91e8fd3cf266 -r f242352da553 docs/INDEX
--- a/docs/INDEX	Mon Oct 01 17:49:01 2012 +0100
+++ b/docs/INDEX	Mon Oct 01 17:54:11 2012 +0100
@@ -12,6 +12,7 @@ misc/kexec_and_kdump		Kexec and Kdump fo
 misc/tscmode			TSC Mode HOWTO
 misc/vbd-interface		Xen Guest Disk (VBD) Interface
 misc/xenstore			Xenstore protocol specification
+misc/xenstore-paths		Xenstore path documentation
 misc/xl-disk-configuration	XL Disk Configuration
 misc/xl-network-configuration	XL Network Configuration
 misc/distro_mapping		Distro Directory Layouts
diff -r 91e8fd3cf266 -r f242352da553 docs/misc/libxl_memory.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/misc/libxl_memory.txt	Mon Oct 01 17:54:11 2012 +0100
@@ -0,0 +1,70 @@
+/* === Domain memory breakdown: HVM guests ==================================
+                           
+             +  +----------+                                     +            
+             |  | shadow   |                                     |            
+             |  +----------+                                     |            
+    overhead |  | extra    |                                     |            
+             |  | external |                                     |            
+             |  +----------+                          +          |            
+             |  | extra    |                          |          |            
+             |  | internal |                          |          |            
+             +  +----------+                +         |          | footprint  
+             |  | video    |                |         |          |            
+             |  +----------+  +    +        |         | xen      |            
+             |  |          |  |    |        | actual  | maximum  |            
+             |  |          |  |    |        | target  |          |            
+             |  | guest    |  |    | build  |         |          |            
+             |  |          |  |    | start  |         |          |            
+      static |  |          |  |    |        |         |          |            
+     maximum |  +----------+  |    +        +         +          +            
+             |  |          |  |                                               
+             |  |          |  |                                               
+             |  | balloon  |  | build                                         
+             |  |          |  | maximum                                       
+             |  |          |  |                                               
+             +  +----------+  +                                               
+                
+                
+    extra internal = LIBXL_MAXMEM_CONSTANT
+    extra external = LIBXL_HVM_EXTRA_MEMORY
+    shadow = libxl_domain_build_info.shadow_memkb
+    static maximum = libxl_domain_build_info.max_memkb
+    video = libxl_domain_build_info.video_memkb
+    build start = libxl_domain_build_info.target_memkb
+    libxl_domain_setmaxmem -> xen maximum
+    libxl_set_memory_target -> actual target
+                
+                
+ === Domain memory breakdown: PV guests ==================================
+                
+                
+             +  +----------+                                     +            
+    overhead |  | extra    |                                     |            
+             |  | external |                                     |            
+             |  +----------+                          +          |            
+             |  | extra    |                          |          |            
+             |  | internal |                          |          |            
+             +  +----------+  +    +        +         |          | footprint  
+             |  |          |  |    |        |         | xen      |            
+             |  |          |  |    |        | actual  | maximum  | 
+             |  | guest    |  |    | build  | target  |          |            
+             |  |          |  |    | start  |         |          |            
+      static |  |          |  |    |        |         |          |            
+     maximum |  +----------+  |    +        +         +          +            
+             |  |          |  |                                               
+             |  |          |  |                                               
+             |  | balloon  |  | build                                         
+             |  |          |  | maximum                                       
+             |  |          |  |                                               
+             +  +----------+  +                                               
+                
+
+    extra internal = LIBXL_MAXMEM_CONSTANT
+    extra external = LIBXL_PV_EXTRA_MEMORY
+    static maximum = libxl_domain_build_info.max_memkb
+    build start = libxl_domain_build_info.target_memkb
+    libxl_domain_setmaxmem -> xen maximum
+    libxl_set_memory_target -> actual target
+
+
+ ========================================================================= */
diff -r 91e8fd3cf266 -r f242352da553 docs/misc/xenstore-paths.markdown
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/misc/xenstore-paths.markdown	Mon Oct 01 17:54:11 2012 +0100
@@ -0,0 +1,353 @@
+# XenStore Paths
+
+This document attempts to defines all the paths which are in common
+use by either guests, front-/back-end drivers, toolstacks etc.
+
+The XenStore wire protocol itself is described in
+[xenstore.txt](xenstore.txt).
+
+## Notation
+
+This document is intended to be partially machine readable, such that
+test system etc can use it to validate whether the xenstore paths used
+by a test are allowable etc.
+
+Therefore the following notation conventions apply:
+
+A xenstore path is generically defined as:
+
+        PATH = VALUES [TAGS]
+
+        PATH/* [TAGS]
+
+The first syntax defines a simple path with a single value. The second
+syntax defines an aggregated set of paths which are usually described
+externally to this document. The text will give a pointer to the
+appropriate external documentation.
+
+PATH can contain simple regex constructs following the Perl compatible
+regexp syntax described in pcre(3) or perlre(1). In addition the
+following additional wild card names are defined and are evaluated
+before regexp expansion:
+
+* ~ -- expands to an arbitrary a domain's home path (described below).
+  Only valid at the begining of a path.
+* $DEVID -- a per-device type device identifier. Typically an integer.
+* $DOMID -- a domain identifier, an integer. Typically this refers to
+  the "other" domain. i.e. ~ refers to the domain providing a service
+  while $DOMID is the consumer of that service.
+* $UUID -- a UUID in the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+
+VALUES are strings and can take the following forms:
+
+* PATH -- a XenStore path.
+* STRING -- an arbitrary string.
+* INTEGER -- An integer, in decimal representation unless otherwise
+  noted.
+ * MEMKB -- the decimal representation of a number of kilobytes.
+ * EVTCHN -- the decimal representation of an event channel.
+ * GNTREF -- the decimal representation of a grant reference.
+* "a literal string" -- literal strings are contained within quotes.
+* (VALUE | VALUE | ... ) -- a set of alternatives. Alternatives are
+  separated by a "|" and all the alternatives are enclosed in "(" and
+  ")".
+
+Additional TAGS may follow as a comma separated set of the following
+tags enclosed in square brackets.
+
+* w -- Path is writable by the containing domain, that is the domain
+  whose home path ~ this key is under or which /vm/$UUID refers to. By
+  default paths under both of these locations are read only for the
+  domain.
+* n -- Path is neither readable nor writeable for guest domains.
+* HVM -- Path is valid for HVM domains only
+* PV --  Path is valid for PV domains only
+* BACKEND -- Path is valid for a backend domain (AKA driver domain)
+* INTERNAL -- Although a path is visible to the domain its use is
+  reserved for the virtual firmware or Xen platform code. Guest
+  Operating Systems must not read this key or otherwise rely on its
+  presence or contents.
+* DEPRECATED -- This path is deprecated and may be removed in its
+  current form in the future. Guests should not add new dependencies
+  on such paths.
+
+Owning domain means the domain whose home path this tag is found
+under.
+
+Lack of either a __HVM__ or __PV__ tag indicates that the path is
+valid for either type of domain (including PVonHVM and similar mixed
+domain types).
+
+## Domain Home Path
+
+Every domain has a home path within the xenstore hierarchy. This is
+the path where the majority of the domain-visible information about
+each domain is stored.
+
+This path is:
+
+      /local/domain/$DOMID
+
+All non-absolute paths are relative to this path.
+
+Although this path could be considered a "Home Directory" for the
+domain it would not usually be writable by the domain. The tools will
+create writable subdirectories as necessary.
+
+## Per Domain Paths
+
+## General Paths
+
+#### ~/vm = PATH []
+
+A pointer back to the domain's /vm/$UUID path (described below).
+
+#### ~/name = STRING []
+
+The guests name.
+
+#### ~/domid = INTEGER   []
+
+The domain's own ID.
+
+#### ~/image/device-model-pid = INTEGER   [INTERNAL]
+
+The process ID of the device model associated with this domain, if it
+has one.
+
+#### ~/cpu/[0-9]+/availability = ("online"|"offline") [PV]
+
+One node for each virtual CPU up to the guest's configured
+maximum. Valid values are "online" and "offline". The guest is expected to react to changes in this path by bringing the appropriate VCPU on or offline using the VCPUOP interface described in [xen/include/public/vcpu.h][VCPU]
+
+This protocol is not currently well documented.
+
+#### ~/memory/static-max = MEMKB []
+
+Specifies a static maximum amount memory which this domain should
+expect to be given. In the absence of in-guest memory hotplug support
+this set on domain boot and is usually the maximum amount of RAM which
+a guest can make use of. See [docs/misc/libxl_memory.txt][LIBXLMEM]
+for a description of how memory is accounted for in toolstacks using
+the libxl library.
+
+#### ~/memory/target = MEMKB []
+
+The current balloon target for the domain. The balloon driver within
+the guest is expected to make every effort to every effort use no more
+than this amount of RAM.
+
+#### ~/memory/videoram = MEMKB [HVM,INTERNAL]
+
+The size of the video RAM this domain is configured with.
+
+#### ~/device/suspend/event-channel = ""|EVTCHN [w]
+
+The domain's suspend event channel. The use of a suspend event channel
+is optional at the domain's discretion. The toolstack will create this
+path with an empty value which the guest may choose to overwrite.
+
+#### ~/hvmloader/generation-id-address = ADDRESS [r,HVM,INTERNAL]
+
+The hexadecimal representation of the address of the domain's
+"generation id".
+
+#### ~/hvmloader/bios = ("rombios"|"seabios"|"OVMF") [HVM,INTERNAL]
+
+The BIOS used by this domain.
+
+#### ~/platform/* [HVM,INTERNAL]
+
+Various platform properties.
+
+* acpi -- is ACPI enabled for this domain
+* acpi_s3 -- is ACPI S3 support enabled for this domain
+* acpi_s4 -- is ACPI S4 support enabled for this domain
+
+### Frontend device paths
+
+Paravirtual device frontends are generally specified by their own
+directory within the XenStore hierarchy. Usually this is under
+~/device/$TYPE/$DEVID although there are exceptions, e.g. ~/console
+for the first PV console.
+
+#### ~/device/vbd/$DEVID/* []
+
+A virtual block device frontend. Described by
+[xen/include/public/io/blkif.h][BLKIF]
+
+#### ~/device/vfb/$DEVID/* []
+
+A virtual framebuffer frontend. Described by
+[xen/include/public/io/fbif.h][FBIF]
+
+#### ~/device/vkbd/$DEVID/* []
+
+A virtual keyboard device frontend. Described by
+[xen/include/public/io/kbdif.h][KBDIF]
+
+#### ~/device/vif/$DEVID/* []
+
+A virtual network device frontend. Described by
+[xen/include/public/io/netif.h][NETIF]
+
+#### ~/console/* []
+
+The primary PV console device. Described in [console.txt](console.txt)
+
+#### ~/device/console/$DEVID/* []
+
+A secondary PV console device. Described in [console.txt](console.txt)
+
+#### ~/device/serial/$DEVID/* [HVM]
+
+An emulated serial device. Described in [console.txt](console.txt)
+
+#### ~/store/port = EVTCHN [DEPRECATED]
+
+The event channel used by the domain's connection to XenStore.
+
+This path is deprecated since the same information is provided via the
+[start_info][SI] for PV guests and as an [HVM param][HVMPARAMS] for
+HVM guests. There is an obvious chicken and egg problem with
+extracting this value from xenstore in order to setup the xenstore
+communication ring.
+
+#### ~/store/ring-ref = GNTREF [DEPRECATED]
+
+The grant reference of the domain's XenStore ring.
+
+As with ~/store/port this path is deprecated.
+
+### Backend Device Paths
+
+Paravirtual device backends are generally specified by their own
+directory within the XenStore hierarchy. Usually this is under
+~/backend/$TYPE/$DOMID/$DEVID.
+
+#### ~/backend/vbd/$DOMID/$DEVID/* []
+
+A virtual block device backend. Described by
+[xen/include/public/io/blkif.h][BLKIF]
+
+Uses the in-kernel blkback driver.
+
+#### ~/backend/qdisk/$DOMID/$DEVID/* []
+
+A virtual block device backend. Described by
+[xen/include/public/io/blkif.h][BLKIF]
+
+Uses the qemu based disk backend.
+
+#### ~/backend/tap/$DOMID/$DEVID/* []
+
+A virtual block device backend. Described by
+[xen/include/public/io/blkif.h][BLKIF]
+
+Uses the in-kernel blktap (v1) disk backend (deprecated).
+
+#### ~/backend/vfb/$DOMID/$DEVID/* []
+
+A virtual framebuffer backend. Described by
+[xen/include/public/io/fbif.h][FBIF]
+
+#### ~/backend/vkbd/$DOMID/$DEVID/* []
+
+A virtual keyboard device backend. Described by
+[xen/include/public/io/kbdif.h][KBDIF]
+
+#### ~/backend/vif/$DOMID/$DEVID/* []
+
+A virtual network device backend. Described by
+[xen/include/public/io/netif.h][NETIF]
+
+#### ~/backend/console/$DOMID/$DEVID/* []
+
+A PV console backend. Described in [console.txt](console.txt)
+
+#### ~/device-model/$DOMID/* [INTERNAL]
+
+Information relating to device models running in the domain. $DOMID is
+the target domain of the device model.
+
+#### ~/libxl/disable_udev = ("1"|"0") []
+
+Indicates whether device hotplug scripts in this domain should be run
+by udev ("0") or will be run by the toolstack directly ("1").
+
+### Platform Feature and Control Paths
+
+#### ~/control/shutdown = (""|COMMAND) [w]
+
+This is the PV shutdown control node. A toolstack can write various
+commands here to cause various guest shutdown, reboot or suspend
+activities. The guest acknowledges a request by writing the empty
+string back to the command node.
+
+The precise protocol is not yet documented.
+
+#### ~/control/platform-feature-multiprocessor-suspend = (0|1) []
+
+Indicates to the guest that this platform supports the multiprocessor
+suspend feature.
+
+#### ~/control/platform-feature-xs\_reset\_watches = (0|1) []
+
+Indicates to the guest that this platform supports the
+XS_RESET_WATCHES xenstore message. See
+[xen/include/public/io/xs\_wire.h][XSWIRE] for the XenStore wire
+protocol definition.
+
+### Domain Controlled Paths
+
+#### ~/data/* [w]
+
+A domain writable path. Available for arbitrary domain use.
+
+## Virtual Machine Paths
+
+The /vm/$UUID namespace is used by toolstacks to store various
+information relating to the domain which is not intended to be guest
+visible (hence they are all tagged [n,INTERNAL]).
+
+Several of the keys here are not well defined and/or not well located
+and are liable to be replaced with more fully defined paths in the
+future.
+
+### /vm/$UUID/uuid = UUID [n,INTERNAL]
+
+Value is the same UUID as the path.
+
+### /vm/$UUID/name = STRING [n,INTERNAL]
+
+The domain's name.
+
+### /vm/$UUID/image/* [n,INTERNAL]
+
+Various information relating to the domain builder used for this guest.
+
+### /vm/$UUID/start_time = INTEGER "." INTEGER [n,INTERNAL]
+
+The time which the guest was started in SECONDS.MICROSECONDS format
+
+### /vm/$UUID/rtc/timeoffset = ""|INTEGER [n,HVM,INTERNAL]
+
+The guest's virtual time offset from UTC in seconds.
+
+## Platform-Level paths
+
+### libxl Specific Paths
+
+#### /libxl/$DOMID/dm-version ("qemu\_xen"|"qemu\_xen\_traditional") = [n,INTERNAL]
+
+The device model version for a domain.
+
+[BLKIF]: http://xenbits.xen.org/docs/unstable/hypercall/include,public,io,blkif.h.html
+[FBIF]: http://xenbits.xen.org/docs/unstable/hypercall/include,public,io,fbif.h.html
+[HVMPARAMS]: http://xenbits.xen.org/docs/unstable/hypercall/include,public,hvm,params.h.html
+[KBDIF]: http://xenbits.xen.org/docs/unstable/hypercall/include,public,io,kbdif.h.html
+[LIBXLMEM]: http://xenbits.xen.org/docs/unstable/misc/libxl_memory.txt
+[NETIF]: http://xenbits.xen.org/docs/unstable/hypercall/include,public,io,netif.h.html
+[SI]: http://xenbits.xen.org/docs/unstable/hypercall/include,public,xen.h.html#Struct_start_info
+[VCPU]: http://xenbits.xen.org/docs/unstable/hypercall/include,public,vcpu.h.html
+[XSWIRE]: http://xenbits.xen.org/docs/unstable/hypercall/include,public,io,xs_wire.h.html
diff -r 91e8fd3cf266 -r f242352da553 tools/libxl/libxl_memory.txt
--- a/tools/libxl/libxl_memory.txt	Mon Oct 01 17:49:01 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/* === Domain memory breakdown: HVM guests ==================================
-                           
-             +  +----------+                                     +            
-             |  | shadow   |                                     |            
-             |  +----------+                                     |            
-    overhead |  | extra    |                                     |            
-             |  | external |                                     |            
-             |  +----------+                          +          |            
-             |  | extra    |                          |          |            
-             |  | internal |                          |          |            
-             +  +----------+                +         |          | footprint  
-             |  | video    |                |         |          |            
-             |  +----------+  +    +        |         | xen      |            
-             |  |          |  |    |        | actual  | maximum  |            
-             |  |          |  |    |        | target  |          |            
-             |  | guest    |  |    | build  |         |          |            
-             |  |          |  |    | start  |         |          |            
-      static |  |          |  |    |        |         |          |            
-     maximum |  +----------+  |    +        +         +          +            
-             |  |          |  |                                               
-             |  |          |  |                                               
-             |  | balloon  |  | build                                         
-             |  |          |  | maximum                                       
-             |  |          |  |                                               
-             +  +----------+  +                                               
-                
-                
-    extra internal = LIBXL_MAXMEM_CONSTANT
-    extra external = LIBXL_HVM_EXTRA_MEMORY
-    shadow = libxl_domain_build_info.shadow_memkb
-    static maximum = libxl_domain_build_info.max_memkb
-    video = libxl_domain_build_info.video_memkb
-    build start = libxl_domain_build_info.target_memkb
-    libxl_domain_setmaxmem -> xen maximum
-    libxl_set_memory_target -> actual target
-                
-                
- === Domain memory breakdown: PV guests ==================================
-                
-                
-             +  +----------+                                     +            
-    overhead |  | extra    |                                     |            
-             |  | external |                                     |            
-             |  +----------+                          +          |            
-             |  | extra    |                          |          |            
-             |  | internal |                          |          |            
-             +  +----------+  +    +        +         |          | footprint  
-             |  |          |  |    |        |         | xen      |            
-             |  |          |  |    |        | actual  | maximum  | 
-             |  | guest    |  |    | build  | target  |          |            
-             |  |          |  |    | start  |         |          |            
-      static |  |          |  |    |        |         |          |            
-     maximum |  +----------+  |    +        +         +          +            
-             |  |          |  |                                               
-             |  |          |  |                                               
-             |  | balloon  |  | build                                         
-             |  |          |  | maximum                                       
-             |  |          |  |                                               
-             +  +----------+  +                                               
-                
-
-    extra internal = LIBXL_MAXMEM_CONSTANT
-    extra external = LIBXL_PV_EXTRA_MEMORY
-    static maximum = libxl_domain_build_info.max_memkb
-    build start = libxl_domain_build_info.target_memkb
-    libxl_domain_setmaxmem -> xen maximum
-    libxl_set_memory_target -> actual target
-
-
- ========================================================================= */

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

From xen-changelog-bounces@lists.xen.org Tue Oct 02 01:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Oct 2012 01:44:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TIrWy-00067b-TR; Tue, 02 Oct 2012 01:44:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWx-00066s-K2
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:15 +0000
Received: from [85.158.139.211:7735] by server-12.bemta-5.messagelabs.com id
	E5/BE-20729-EE64A605; Tue, 02 Oct 2012 01:44:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-206.messagelabs.com!1349142252!20647276!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16062 invoked from network); 2 Oct 2012 01:44:13 -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;
	2 Oct 2012 01:44:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWu-0008Ho-NR
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWu-0001mM-A4
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:12 +0000
Message-Id: <E1TIrWu-0001mM-A4@xenbits.xen.org>
Date: Tue, 02 Oct 2012 01:44:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: Remove
	sched_credit_default_yield option
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1349118199 -3600
# Node ID 16aaeaa66ef957894b1bae9d165b1289184b5f56
# Parent  ffac3db27e2ea6b8f393bcca3d6eb40d5d05b9d1
xen: Remove sched_credit_default_yield option

The sched_credit_default_yield option was added when the behavior of
"SCHEDOP_yield" was changed in 4.1, to allow any users who had
problems to revert to the old behavior.  The new behavior has been in
Xen.org xen since 4.1, and in XenServer even longer, and there is no
evidence of anyone having trouble with it.  Remove the option.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r ffac3db27e2e -r 16aaeaa66ef9 docs/misc/xen-command-line.markdown
--- a/docs/misc/xen-command-line.markdown	Mon Oct 01 20:02:45 2012 +0100
+++ b/docs/misc/xen-command-line.markdown	Mon Oct 01 20:03:19 2012 +0100
@@ -734,9 +734,6 @@ Choose the default scheduler.
 ### sched\_credit2\_migrate\_resist
 > `= <integer>`
 
-### sched\_credit\_default\_yield
-> `= <boolean>`
-
 ### sched\_credit\_tslice\_ms
 > `= <integer>`
 
diff -r ffac3db27e2e -r 16aaeaa66ef9 xen/common/sched_credit.c
--- a/xen/common/sched_credit.c	Mon Oct 01 20:02:45 2012 +0100
+++ b/xen/common/sched_credit.c	Mon Oct 01 20:03:19 2012 +0100
@@ -103,8 +103,6 @@
 /*
  * Boot parameters
  */
-static bool_t __read_mostly sched_credit_default_yield;
-boolean_param("sched_credit_default_yield", sched_credit_default_yield);
 static int __read_mostly sched_credit_tslice_ms = CSCHED_DEFAULT_TSLICE_MS;
 integer_param("sched_credit_tslice_ms", sched_credit_tslice_ms);
 
@@ -783,11 +781,8 @@ csched_vcpu_yield(const struct scheduler
 {
     struct csched_vcpu * const sv = CSCHED_VCPU(vc);
 
-    if ( !sched_credit_default_yield )
-    {
-        /* Let the scheduler know that this vcpu is trying to yield */
-        sv->flags |= CSCHED_FLAG_VCPU_YIELD;
-    }
+    /* Let the scheduler know that this vcpu is trying to yield */
+    sv->flags |= CSCHED_FLAG_VCPU_YIELD;
 }
 
 static int

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

From xen-changelog-bounces@lists.xen.org Tue Oct 02 01:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Oct 2012 01:44:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TIrWx-000676-Lk; Tue, 02 Oct 2012 01:44:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWw-00066g-KW
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:14 +0000
Received: from [85.158.143.35:16283] by server-2.bemta-4.messagelabs.com id
	4C/DF-06610-DE64A605; Tue, 02 Oct 2012 01:44:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1349142252!4664128!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13447 invoked from network); 2 Oct 2012 01:44:13 -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;
	2 Oct 2012 01:44:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWu-0008Hl-1U
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWt-0001m7-Ov
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:11 +0000
Message-Id: <E1TIrWt-0001m7-Ov@xenbits.xen.org>
Date: Tue, 02 Oct 2012 01:44:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen/console: introduce a 'w'
	debug-key that dumps the console ring
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Matt Wilson <msw@amazon.com>
# Date 1349118165 -3600
# Node ID ffac3db27e2ea6b8f393bcca3d6eb40d5d05b9d1
# Parent  ef898f37a560d56e1559e2acb12b49baeb3f25b8
xen/console: introduce a 'w' debug-key that dumps the console ring

This patch adds a new 'w' debug-key, chosen from the limited remaining
keys only due to its proximity to 'q', that dumps the console ring to
configured console devices. It's useful to for tracking down how an
unresponsive system got into a broken state via serial console.

Signed-off-by: Matt Wilson <msw@amazon.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r ef898f37a560 -r ffac3db27e2e xen/drivers/char/console.c
--- a/xen/drivers/char/console.c	Mon Oct 01 20:01:55 2012 +0100
+++ b/xen/drivers/char/console.c	Mon Oct 01 20:02:45 2012 +0100
@@ -264,6 +264,49 @@ static void sercon_puts(const char *s)
         serial_puts(sercon_handle, s);
 }
 
+static void dump_console_ring_key(unsigned char key)
+{
+    uint32_t idx, len, sofar, c;
+    unsigned int order;
+    char *buf;
+
+    printk("'%c' pressed -> dumping console ring buffer (dmesg)\n", key);
+
+    /* create a buffer in which we'll copy the ring in the correct
+       order and NUL terminate */
+    order = get_order_from_bytes(conring_size + 1);
+    buf = alloc_xenheap_pages(order, 0);
+    if ( buf == NULL )
+    {
+        printk("unable to allocate memory!\n");
+        return;
+    }
+
+    c = conringc;
+    sofar = 0;
+    while ( (c != conringp) )
+    {
+        idx = CONRING_IDX_MASK(c);
+        len = conringp - c;
+        if ( (idx + len) > conring_size )
+            len = conring_size - idx;
+        memcpy(buf + sofar, &conring[idx], len);
+        sofar += len;
+        c += len;
+    }
+    buf[sofar] = '\0';
+
+    sercon_puts(buf);
+    vga_puts(buf);
+
+    free_xenheap_pages(buf, order);
+}
+
+static struct keyhandler dump_console_ring_keyhandler = {
+    .u.fn = dump_console_ring_key,
+    .desc = "synchronously dump console ring buffer (dmesg)"
+};
+
 /* CTRL-<switch_char> switches input direction between Xen and DOM0. */
 #define switch_code (opt_conswitch[0]-'a'+1)
 static int __read_mostly xen_rx = 1; /* FALSE => serial input passed to domain 0. */
@@ -661,6 +704,8 @@ void __init console_endboot(void)
     if ( opt_conswitch[1] == 'x' )
         xen_rx = !xen_rx;
 
+    register_keyhandler('w', &dump_console_ring_keyhandler);
+
     /* Serial input is directed to DOM0 by default. */
     switch_serial_input();
 }

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

From xen-changelog-bounces@lists.xen.org Tue Oct 02 01:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Oct 2012 01:44:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TIrWy-00067U-QL; Tue, 02 Oct 2012 01:44:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWw-00066h-PQ
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:15 +0000
Received: from [85.158.138.51:50283] by server-6.bemta-3.messagelabs.com id
	61/B4-11085-EE64A605; Tue, 02 Oct 2012 01:44:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-174.messagelabs.com!1349142251!24631061!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11966 invoked from network); 2 Oct 2012 01:44:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Oct 2012 01:44:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWt-0008Hi-Ik
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWt-0001lq-7l
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:11 +0000
Message-Id: <E1TIrWt-0001lq-7l@xenbits.xen.org>
Date: Tue, 02 Oct 2012 01:44:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hvmloader: Add 64 bits big bar
	support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Xiantao Zhang <xiantao.zhang@intel.com>
# Date 1349118115 -3600
# Node ID ef898f37a560d56e1559e2acb12b49baeb3f25b8
# Parent  f242352da553a025920ff72eff54b9d6bc717eaa
hvmloader: Add 64 bits big bar support

Currently it is assumed PCI device BAR access < 4G memory. If there is
such a device whose BAR size is larger than 4G, it must access > 4G
memory address.  This patch enable the 64bits big BAR support on
hvmloader.

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Xudong Hao <xudong.hao@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r f242352da553 -r ef898f37a560 tools/firmware/hvmloader/cacheattr.c
--- a/tools/firmware/hvmloader/cacheattr.c	Mon Oct 01 17:54:11 2012 +0100
+++ b/tools/firmware/hvmloader/cacheattr.c	Mon Oct 01 20:01:55 2012 +0100
@@ -40,17 +40,10 @@
 #define MSR_PAT              0x0277
 #define MSR_MTRRdefType      0x02ff
 
-void cacheattr_init(void)
+unsigned int cpu_phys_addr(void)
 {
     uint32_t eax, ebx, ecx, edx;
-    uint64_t mtrr_cap, mtrr_def, content, addr_mask;
-    unsigned int i, nr_var_ranges, phys_bits = 36;
-
-    /* Does the CPU support architectural MTRRs? */
-    cpuid(0x00000001, &eax, &ebx, &ecx, &edx);
-    if ( !(edx & (1u << 12)) )
-         return;
-
+    unsigned int phys_bits = 36;
     /* Find the physical address size for this CPU. */
     cpuid(0x80000000, &eax, &ebx, &ecx, &edx);
     if ( eax >= 0x80000008 )
@@ -59,6 +52,22 @@ void cacheattr_init(void)
         phys_bits = (uint8_t)eax;
     }
 
+    return phys_bits;
+}
+
+void cacheattr_init(void)
+{
+    uint32_t eax, ebx, ecx, edx;
+    uint64_t mtrr_cap, mtrr_def, content, addr_mask;
+    unsigned int i, nr_var_ranges, phys_bits;
+
+    /* Does the CPU support architectural MTRRs? */
+    cpuid(0x00000001, &eax, &ebx, &ecx, &edx);
+    if ( !(edx & (1u << 12)) )
+         return;
+
+    phys_bits = cpu_phys_addr();
+
     printf("%u-bit phys ... ", phys_bits);
 
     addr_mask = ((1ull << phys_bits) - 1) & ~((1ull << 12) - 1);
diff -r f242352da553 -r ef898f37a560 tools/firmware/hvmloader/config.h
--- a/tools/firmware/hvmloader/config.h	Mon Oct 01 17:54:11 2012 +0100
+++ b/tools/firmware/hvmloader/config.h	Mon Oct 01 20:01:55 2012 +0100
@@ -53,6 +53,8 @@ extern struct bios_config ovmf_config;
 /* MMIO hole: Hardcoded defaults, which can be dynamically expanded. */
 #define PCI_MEM_START       0xf0000000
 #define PCI_MEM_END         0xfc000000
+#define PCI_MIN_BIG_BAR_SIZE          0x20000000
+
 extern unsigned long pci_mem_start, pci_mem_end;
 
 
diff -r f242352da553 -r ef898f37a560 tools/firmware/hvmloader/pci.c
--- a/tools/firmware/hvmloader/pci.c	Mon Oct 01 17:54:11 2012 +0100
+++ b/tools/firmware/hvmloader/pci.c	Mon Oct 01 20:01:55 2012 +0100
@@ -36,19 +36,25 @@ unsigned long igd_opregion_pgbase = 0;
 
 void pci_setup(void)
 {
-    uint32_t base, devfn, bar_reg, bar_data, bar_sz, cmd, mmio_total = 0;
+    uint8_t is_64bar, using_64bar, bar64_relocate = 0;
+    uint32_t devfn, bar_reg, cmd, bar_data, bar_data_upper;
+    uint64_t base, bar_sz, bar_sz_upper, mmio_total = 0;
     uint32_t vga_devfn = 256;
     uint16_t class, vendor_id, device_id;
     unsigned int bar, pin, link, isa_irq;
+    int64_t mmio_left;
 
     /* Resources assignable to PCI devices via BARs. */
     struct resource {
-        uint32_t base, max;
-    } *resource, mem_resource, io_resource;
+        uint64_t base, max;
+    } *resource, mem_resource, high_mem_resource, io_resource;
 
     /* Create a list of device BARs in descending order of size. */
     struct bars {
-        uint32_t devfn, bar_reg, bar_sz;
+        uint32_t is_64bar;
+        uint32_t devfn;
+        uint32_t bar_reg;
+        uint64_t bar_sz;
     } *bars = (struct bars *)scratch_start;
     unsigned int i, nr_bars = 0;
 
@@ -133,22 +139,34 @@ void pci_setup(void)
         /* Map the I/O memory and port resources. */
         for ( bar = 0; bar < 7; bar++ )
         {
+            bar_sz_upper = 0;
             bar_reg = PCI_BASE_ADDRESS_0 + 4*bar;
             if ( bar == 6 )
                 bar_reg = PCI_ROM_ADDRESS;
 
             bar_data = pci_readl(devfn, bar_reg);
+            is_64bar = !!((bar_data & (PCI_BASE_ADDRESS_SPACE |
+                         PCI_BASE_ADDRESS_MEM_TYPE_MASK)) ==
+                         (PCI_BASE_ADDRESS_SPACE_MEMORY |
+                         PCI_BASE_ADDRESS_MEM_TYPE_64));
             pci_writel(devfn, bar_reg, ~0);
             bar_sz = pci_readl(devfn, bar_reg);
             pci_writel(devfn, bar_reg, bar_data);
-            if ( bar_sz == 0 )
-                continue;
 
             bar_sz &= (((bar_data & PCI_BASE_ADDRESS_SPACE) ==
                         PCI_BASE_ADDRESS_SPACE_MEMORY) ?
                        PCI_BASE_ADDRESS_MEM_MASK :
                        (PCI_BASE_ADDRESS_IO_MASK & 0xffff));
+            if (is_64bar) {
+                bar_data_upper = pci_readl(devfn, bar_reg + 4);
+                pci_writel(devfn, bar_reg + 4, ~0);
+                bar_sz_upper = pci_readl(devfn, bar_reg + 4);
+                pci_writel(devfn, bar_reg + 4, bar_data_upper);
+                bar_sz = (bar_sz_upper << 32) | bar_sz;
+            }
             bar_sz &= ~(bar_sz - 1);
+            if ( bar_sz == 0 )
+                continue;
 
             for ( i = 0; i < nr_bars; i++ )
                 if ( bars[i].bar_sz < bar_sz )
@@ -157,6 +175,7 @@ void pci_setup(void)
             if ( i != nr_bars )
                 memmove(&bars[i+1], &bars[i], (nr_bars-i) * sizeof(*bars));
 
+            bars[i].is_64bar = is_64bar;
             bars[i].devfn   = devfn;
             bars[i].bar_reg = bar_reg;
             bars[i].bar_sz  = bar_sz;
@@ -167,11 +186,8 @@ void pci_setup(void)
 
             nr_bars++;
 
-            /* Skip the upper-half of the address for a 64-bit BAR. */
-            if ( (bar_data & (PCI_BASE_ADDRESS_SPACE |
-                              PCI_BASE_ADDRESS_MEM_TYPE_MASK)) == 
-                 (PCI_BASE_ADDRESS_SPACE_MEMORY | 
-                  PCI_BASE_ADDRESS_MEM_TYPE_64) )
+            /*The upper half is already calculated, skip it! */
+            if (is_64bar)
                 bar++;
         }
 
@@ -197,6 +213,9 @@ void pci_setup(void)
             ((pci_mem_start << 1) != 0) )
         pci_mem_start <<= 1;
 
+    if ( (pci_mem_start << 1) != 0 )
+        bar64_relocate = 1;
+
     /* Relocate RAM that overlaps PCI space (in 64k-page chunks). */
     while ( (pci_mem_start >> PAGE_SHIFT) < hvm_info->low_mem_pgend )
     {
@@ -218,11 +237,15 @@ void pci_setup(void)
         hvm_info->high_mem_pgend += nr_pages;
     }
 
+    high_mem_resource.base = ((uint64_t)hvm_info->high_mem_pgend) << PAGE_SHIFT; 
+    high_mem_resource.max = 1ull << cpu_phys_addr();
     mem_resource.base = pci_mem_start;
     mem_resource.max = pci_mem_end;
     io_resource.base = 0xc000;
     io_resource.max = 0x10000;
 
+    mmio_left = pci_mem_end - pci_mem_start;
+
     /* Assign iomem and ioport resources in descending order of size. */
     for ( i = 0; i < nr_bars; i++ )
     {
@@ -230,13 +253,29 @@ void pci_setup(void)
         bar_reg = bars[i].bar_reg;
         bar_sz  = bars[i].bar_sz;
 
+        using_64bar = bars[i].is_64bar && bar64_relocate && (mmio_left < bar_sz);
         bar_data = pci_readl(devfn, bar_reg);
 
         if ( (bar_data & PCI_BASE_ADDRESS_SPACE) ==
              PCI_BASE_ADDRESS_SPACE_MEMORY )
         {
-            resource = &mem_resource;
-            bar_data &= ~PCI_BASE_ADDRESS_MEM_MASK;
+            /* Mapping high memory if PCI deivce is 64 bits bar and the bar size
+               is larger than 512M */
+            if (using_64bar && (bar_sz > PCI_MIN_BIG_BAR_SIZE)) {
+                if ( high_mem_resource.base & (bar_sz - 1) )
+                    high_mem_resource.base = high_mem_resource.base - 
+                        (high_mem_resource.base & (bar_sz - 1)) + bar_sz;
+                else
+                    high_mem_resource.base = high_mem_resource.base - 
+                        (high_mem_resource.base & (bar_sz - 1));
+                resource = &high_mem_resource;
+                bar_data &= ~PCI_BASE_ADDRESS_MEM_MASK;
+            } 
+            else {
+                resource = &mem_resource;
+                bar_data &= ~PCI_BASE_ADDRESS_MEM_MASK;
+            }
+            mmio_left -= bar_sz;
         }
         else
         {
@@ -244,13 +283,14 @@ void pci_setup(void)
             bar_data &= ~PCI_BASE_ADDRESS_IO_MASK;
         }
 
-        base = (resource->base + bar_sz - 1) & ~(bar_sz - 1);
-        bar_data |= base;
+        base = (resource->base  + bar_sz - 1) & ~(uint64_t)(bar_sz - 1);
+        bar_data |= (uint32_t)base;
+        bar_data_upper = (uint32_t)(base >> 32);
         base += bar_sz;
 
         if ( (base < resource->base) || (base > resource->max) )
         {
-            printf("pci dev %02x:%x bar %02x size %08x: no space for "
+            printf("pci dev %02x:%x bar %02x size %llx: no space for "
                    "resource!\n", devfn>>3, devfn&7, bar_reg, bar_sz);
             continue;
         }
@@ -258,8 +298,11 @@ void pci_setup(void)
         resource->base = base;
 
         pci_writel(devfn, bar_reg, bar_data);
-        printf("pci dev %02x:%x bar %02x size %08x: %08x\n",
+        if (using_64bar)
+            pci_writel(devfn, bar_reg + 4, bar_data_upper);
+        printf("pci dev %02x:%x bar %02x size %llx: %08x\n",
                devfn>>3, devfn&7, bar_reg, bar_sz, bar_data);
+			
 
         /* Now enable the memory or I/O mapping. */
         cmd = pci_readw(devfn, PCI_COMMAND);
diff -r f242352da553 -r ef898f37a560 tools/firmware/hvmloader/util.h
--- a/tools/firmware/hvmloader/util.h	Mon Oct 01 17:54:11 2012 +0100
+++ b/tools/firmware/hvmloader/util.h	Mon Oct 01 20:01:55 2012 +0100
@@ -215,6 +215,7 @@ void pci_setup(void);
 uint32_t rombios_highbios_setup(void);
 
 /* Miscellaneous. */
+unsigned int cpu_phys_addr(void);
 void cacheattr_init(void);
 unsigned long create_mp_tables(void *table);
 void hvm_write_smbios_tables(

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

From xen-changelog-bounces@lists.xen.org Tue Oct 02 01:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Oct 2012 01:44:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TIrWz-00067o-Vw; Tue, 02 Oct 2012 01:44:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWy-000670-1D
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:16 +0000
Received: from [85.158.143.99:8377] by server-1.bemta-4.messagelabs.com id
	ED/68-05684-FE64A605; Tue, 02 Oct 2012 01:44:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1349142253!27193334!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19745 invoked from network); 2 Oct 2012 01:44:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Oct 2012 01:44:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWv-0008Hu-LB
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWv-0001mq-GD
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:13 +0000
Message-Id: <E1TIrWv-0001mq-GD@xenbits.xen.org>
Date: Tue, 02 Oct 2012 01:44:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Register Linux PV-on-HVM drivers
	product number.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Paul Durrant <paul.durrant@citrix.com>
# Date 1349118391 -3600
# Node ID 5fbdbf585f5f2ee9a3e3c75a8a9f9f2cc6eda65c
# Parent  f573e10c91b924dbccefddb7cdd7878df6900d1c
Register Linux PV-on-HVM drivers product number.

This is already in use despite never being registereed.
See XEN_IOPORT_LINUX_PRODNUM in include/xen/platform_pci.h

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


diff -r f573e10c91b9 -r 5fbdbf585f5f xen/include/public/hvm/pvdrivers.h
--- a/xen/include/public/hvm/pvdrivers.h	Mon Oct 01 20:05:33 2012 +0100
+++ b/xen/include/public/hvm/pvdrivers.h	Mon Oct 01 20:06:31 2012 +0100
@@ -41,6 +41,7 @@
 #define PVDRIVERS_PRODUCT_LIST(EACH)                         \
         EACH("xensource-windows", 0x0001) /* Citrix */       \
         EACH("gplpv-windows",     0x0002) /* James Harper */ \
+        EACH("linux",             0x0003)                    \
         EACH("experimental",      0xffff)
 
 #endif /* _XEN_PUBLIC_PVDRIVERS_H_ */

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

From xen-changelog-bounces@lists.xen.org Tue Oct 02 01:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Oct 2012 01:44:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TIrWw-00066i-Fk; Tue, 02 Oct 2012 01:44:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWv-00066a-5m
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:13 +0000
Received: from [85.158.138.51:50252] by server-7.bemta-3.messagelabs.com id
	B9/74-15765-CE64A605; Tue, 02 Oct 2012 01:44:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1349142250!32625451!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30778 invoked from network); 2 Oct 2012 01:44:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Oct 2012 01:44:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWs-0008Hc-8X
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWr-0001lL-Tg
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:10 +0000
Message-Id: <E1TIrWr-0001lL-Tg@xenbits.xen.org>
Date: Tue, 02 Oct 2012 01:44:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: Document scheduler-related Xen
	command-line options
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1349110141 -3600
# Node ID 91e8fd3cf266d03891af73a8c745771ab55b5d32
# Parent  bd953fda6106aa1b1cce43379fdf1c946c1e1293
docs: Document scheduler-related Xen command-line options

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


diff -r bd953fda6106 -r 91e8fd3cf266 docs/misc/xen-command-line.markdown
--- a/docs/misc/xen-command-line.markdown	Fri Sep 28 10:59:41 2012 +0200
+++ b/docs/misc/xen-command-line.markdown	Mon Oct 01 17:49:01 2012 +0100
@@ -740,12 +740,34 @@ Choose the default scheduler.
 ### sched\_credit\_tslice\_ms
 > `= <integer>`
 
+Set the timeslice of the credit1 scheduler, in milliseconds.  The
+default is 30ms.  Reasonable values may include 10, 5, or even 1 for
+very latency-sensitive workloads.
+
 ### sched\_ratelimit\_us
 > `= <integer>`
 
+In order to limit the rate of context switching, set the minimum
+amount of time that a vcpu can be scheduled for before preempting it,
+in microseconds.  The default is 1000us (1ms).  Setting this to 0
+disables it altogether.
+
 ### sched\_smt\_power\_savings
 > `= <boolean>`
 
+Normally Xen will try to maximize performance and cache utilization by
+spreading out vcpus across as many different divisions as possible
+(i.e, numa nodes, sockets, cores threads, &c).  This often maximizes
+throughput, but also maximizes energy usage, since it reduces the
+depth to which a processor can sleep.
+
+This option inverts the logic, so that the scheduler in effect tries
+to keep the vcpus on the smallest amount of silicon possible; i.e.,
+first fill up sibling threads, then sibling cores, then sibling
+sockets, &c.  This will reduce performance somewhat, particularly on
+systems with hyperthreading enabled, but should reduce power by
+enabling more sockets and cores to go into deeper sleep states.
+
 ### serial\_tx\_buffer
 > `= <size>`
 

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

From xen-changelog-bounces@lists.xen.org Tue Oct 02 01:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Oct 2012 01:44:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TIrX0-00067t-2V; Tue, 02 Oct 2012 01:44:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWy-000678-8c
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:16 +0000
Received: from [85.158.138.51:46555] by server-11.bemta-3.messagelabs.com id
	C7/AD-21460-FE64A605; Tue, 02 Oct 2012 01:44:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-174.messagelabs.com!1349142253!24631065!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11989 invoked from network); 2 Oct 2012 01:44:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Oct 2012 01:44:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWv-0008Hr-3O
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TIrWu-0001mb-UD
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 01:44:12 +0000
Message-Id: <E1TIrWu-0001mb-UD@xenbits.xen.org>
Date: Tue, 02 Oct 2012 01:44:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Add a new pvdrivers header to serve
	as the register of product numbers.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Paul Durrant <paul.durrant@citrix.com>
# Date 1349118333 -3600
# Node ID f573e10c91b924dbccefddb7cdd7878df6900d1c
# Parent  16aaeaa66ef957894b1bae9d165b1289184b5f56
Add a new pvdrivers header to serve as the register of product numbers.

These product numbers are used by the QEMU blacklisting protocol in
traditional QEMU and are currently coded directly into the xenstore.c
source module. Since there are now multiple QEMUs this information
should be pulled into a public header to avoid duplication/conflict.
hvm-emulated-unplug.markdown has also been adjusted to reference the
new header.

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


diff -r 16aaeaa66ef9 -r f573e10c91b9 docs/misc/hvm-emulated-unplug.markdown
--- a/docs/misc/hvm-emulated-unplug.markdown	Mon Oct 01 20:03:19 2012 +0100
+++ b/docs/misc/hvm-emulated-unplug.markdown	Mon Oct 01 20:05:33 2012 +0100
@@ -65,4 +65,4 @@ decimal number.  `{product_name}` is a s
 product number in step 3.
 
 The master registry of product names and numbers is in
-qemu-xen-unstable's xenstore.c.
+xen/include/public/hvm/pvdrivers.h
diff -r 16aaeaa66ef9 -r f573e10c91b9 xen/include/public/hvm/pvdrivers.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/include/public/hvm/pvdrivers.h	Mon Oct 01 20:05:33 2012 +0100
@@ -0,0 +1,46 @@
+/*
+ * pvdrivers.h: Register of PV drivers product numbers.
+ * Copyright (c) 2012, Citrix Systems Inc.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef _XEN_PUBLIC_PVDRIVERS_H_
+#define _XEN_PUBLIC_PVDRIVERS_H_
+
+/*
+ * This is the master registry of product numbers for
+ * PV drivers. 
+ * If you need a new product number allocating, please
+ * post to xen-devel@lists.xensource.com.  You should NOT use
+ * a product number without allocating one.
+ * If you maintain a separate versioning and distribution path
+ * for PV drivers you should have a separate product number so
+ * that your drivers can be separated from others.
+ *
+ * During development, you may use the product ID to
+ * indicate a driver which is yet to be released.
+ */
+
+#define PVDRIVERS_PRODUCT_LIST(EACH)                         \
+        EACH("xensource-windows", 0x0001) /* Citrix */       \
+        EACH("gplpv-windows",     0x0002) /* James Harper */ \
+        EACH("experimental",      0xffff)
+
+#endif /* _XEN_PUBLIC_PVDRIVERS_H_ */

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

From xen-changelog-bounces@lists.xen.org Tue Oct 02 16:22:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Oct 2012 16:22:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TJ5Eb-0006Df-Cg; Tue, 02 Oct 2012 16:22:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJ5EZ-0006DN-IA
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 16:22:11 +0000
Received: from [85.158.137.99:65142] by server-3.bemta-3.messagelabs.com id
	E5/1F-25962-2B41B605; Tue, 02 Oct 2012 16:22:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-217.messagelabs.com!1349194928!20020897!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10248 invoked from network); 2 Oct 2012 16:22:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Oct 2012 16:22:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJ5EW-0002Xz-IZ
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 16:22:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJ5EW-0007Ya-8s
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 16:22:08 +0000
Message-Id: <E1TJ5EW-0007Ya-8s@xenbits.xen.org>
Date: Tue, 02 Oct 2012 16:22:07 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Fix libxenstore memory leak when
	USE_PTHREAD is not defined
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1349169613 -3600
# Node ID 906b3a2fcd0a82f37dcdf7ac83d71c637006c6f5
# Parent  2b59edeb0fddf738d055815ab10c2d98ef724be1
Fix libxenstore memory leak when USE_PTHREAD is not defined

Redefine usage of pthread_cleanup_push and _pop, to explicitly call free for
heap objects in error paths.

By the way, set a suitable errno value for an error path that had none.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>

xen-unstable changeset: 25914:cd2a831d0a41
Backport-requested-by: Andres Lagar-Cavilla <andreslc@gridcentric.ca>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 2b59edeb0fdd -r 906b3a2fcd0a tools/xenstore/xs.c
--- a/tools/xenstore/xs.c	Tue Sep 25 12:19:33 2012 +0200
+++ b/tools/xenstore/xs.c	Tue Oct 02 10:20:13 2012 +0100
@@ -110,6 +110,11 @@ struct xs_handle {
 
 #define read_thread_exists(h)	(h->read_thr_exists)
 
+/* Because pthread_cleanup_p* are not available when USE_PTHREAD is
+ * disabled, use these macros which convert appropriately. */
+#define cleanup_push_heap(p)        cleanup_push(free, p)
+#define cleanup_pop_heap(run, p)    cleanup_pop((run))
+
 static void *read_thread(void *arg);
 
 #else /* !defined(USE_PTHREAD) */
@@ -130,6 +135,9 @@ struct xs_handle {
 #define cleanup_pop(run)	((void)0)
 #define read_thread_exists(h)	(0)
 
+#define cleanup_push_heap(p)        ((void)0)
+#define cleanup_pop_heap(run, p)    do { if ((run)) free(p); } while(0)
+
 #endif
 
 static int read_message(struct xs_handle *h, int nonblocking);
@@ -1059,7 +1067,7 @@ static int read_message(struct xs_handle
 	msg = malloc(sizeof(*msg));
 	if (msg == NULL)
 		goto error;
-	cleanup_push(free, msg);
+	cleanup_push_heap(msg);
 	if (!read_all(h->fd, &msg->hdr, sizeof(msg->hdr), nonblocking)) { /* Cancellation point */
 		saved_errno = errno;
 		goto error_freemsg;
@@ -1069,7 +1077,7 @@ static int read_message(struct xs_handle
 	body = msg->body = malloc(msg->hdr.len + 1);
 	if (body == NULL)
 		goto error_freemsg;
-	cleanup_push(free, body);
+	cleanup_push_heap(body);
 	if (!read_all(h->fd, body, msg->hdr.len, 0)) { /* Cancellation point */
 		saved_errno = errno;
 		goto error_freebody;
@@ -1098,6 +1106,7 @@ static int read_message(struct xs_handle
 		/* There should only ever be one response pending! */
 		if (!list_empty(&h->reply_list)) {
 			mutex_unlock(&h->reply_mutex);
+			saved_errno = EEXIST;
 			goto error_freebody;
 		}
 
@@ -1110,9 +1119,9 @@ static int read_message(struct xs_handle
 	ret = 0;
 
 error_freebody:
-	cleanup_pop(ret == -1);
+	cleanup_pop_heap(ret == -1, body);
 error_freemsg:
-	cleanup_pop(ret == -1);
+	cleanup_pop_heap(ret == -1, msg);
 error:
 	errno = saved_errno;
 

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

From xen-changelog-bounces@lists.xen.org Tue Oct 02 16:22:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Oct 2012 16:22:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TJ5Eb-0006Df-Cg; Tue, 02 Oct 2012 16:22:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJ5EZ-0006DN-IA
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 16:22:11 +0000
Received: from [85.158.137.99:65142] by server-3.bemta-3.messagelabs.com id
	E5/1F-25962-2B41B605; Tue, 02 Oct 2012 16:22:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-217.messagelabs.com!1349194928!20020897!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10248 invoked from network); 2 Oct 2012 16:22:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Oct 2012 16:22:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJ5EW-0002Xz-IZ
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 16:22:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJ5EW-0007Ya-8s
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 16:22:08 +0000
Message-Id: <E1TJ5EW-0007Ya-8s@xenbits.xen.org>
Date: Tue, 02 Oct 2012 16:22:07 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Fix libxenstore memory leak when
	USE_PTHREAD is not defined
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.org>
# Date 1349169613 -3600
# Node ID 906b3a2fcd0a82f37dcdf7ac83d71c637006c6f5
# Parent  2b59edeb0fddf738d055815ab10c2d98ef724be1
Fix libxenstore memory leak when USE_PTHREAD is not defined

Redefine usage of pthread_cleanup_push and _pop, to explicitly call free for
heap objects in error paths.

By the way, set a suitable errno value for an error path that had none.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>

xen-unstable changeset: 25914:cd2a831d0a41
Backport-requested-by: Andres Lagar-Cavilla <andreslc@gridcentric.ca>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 2b59edeb0fdd -r 906b3a2fcd0a tools/xenstore/xs.c
--- a/tools/xenstore/xs.c	Tue Sep 25 12:19:33 2012 +0200
+++ b/tools/xenstore/xs.c	Tue Oct 02 10:20:13 2012 +0100
@@ -110,6 +110,11 @@ struct xs_handle {
 
 #define read_thread_exists(h)	(h->read_thr_exists)
 
+/* Because pthread_cleanup_p* are not available when USE_PTHREAD is
+ * disabled, use these macros which convert appropriately. */
+#define cleanup_push_heap(p)        cleanup_push(free, p)
+#define cleanup_pop_heap(run, p)    cleanup_pop((run))
+
 static void *read_thread(void *arg);
 
 #else /* !defined(USE_PTHREAD) */
@@ -130,6 +135,9 @@ struct xs_handle {
 #define cleanup_pop(run)	((void)0)
 #define read_thread_exists(h)	(0)
 
+#define cleanup_push_heap(p)        ((void)0)
+#define cleanup_pop_heap(run, p)    do { if ((run)) free(p); } while(0)
+
 #endif
 
 static int read_message(struct xs_handle *h, int nonblocking);
@@ -1059,7 +1067,7 @@ static int read_message(struct xs_handle
 	msg = malloc(sizeof(*msg));
 	if (msg == NULL)
 		goto error;
-	cleanup_push(free, msg);
+	cleanup_push_heap(msg);
 	if (!read_all(h->fd, &msg->hdr, sizeof(msg->hdr), nonblocking)) { /* Cancellation point */
 		saved_errno = errno;
 		goto error_freemsg;
@@ -1069,7 +1077,7 @@ static int read_message(struct xs_handle
 	body = msg->body = malloc(msg->hdr.len + 1);
 	if (body == NULL)
 		goto error_freemsg;
-	cleanup_push(free, body);
+	cleanup_push_heap(body);
 	if (!read_all(h->fd, body, msg->hdr.len, 0)) { /* Cancellation point */
 		saved_errno = errno;
 		goto error_freebody;
@@ -1098,6 +1106,7 @@ static int read_message(struct xs_handle
 		/* There should only ever be one response pending! */
 		if (!list_empty(&h->reply_list)) {
 			mutex_unlock(&h->reply_mutex);
+			saved_errno = EEXIST;
 			goto error_freebody;
 		}
 
@@ -1110,9 +1119,9 @@ static int read_message(struct xs_handle
 	ret = 0;
 
 error_freebody:
-	cleanup_pop(ret == -1);
+	cleanup_pop_heap(ret == -1, body);
 error_freemsg:
-	cleanup_pop(ret == -1);
+	cleanup_pop_heap(ret == -1, msg);
 error:
 	errno = saved_errno;
 

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

From xen-changelog-bounces@lists.xen.org Tue Oct 02 18:22:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Oct 2012 18: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 1TJ76j-0004KD-Mo; Tue, 02 Oct 2012 18:22:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJ76i-0004J0-2K
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 18:22:12 +0000
Received: from [85.158.139.83:46605] by server-12.bemta-5.messagelabs.com id
	CE/A6-20729-3D03B605; Tue, 02 Oct 2012 18:22:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-182.messagelabs.com!1349202129!33095195!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16455 invoked from network); 2 Oct 2012 18:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Oct 2012 18:22:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJ76f-0003wD-Lp
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 18:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJ76f-00027Y-Cv
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 18:22:09 +0000
Message-Id: <E1TJ76f-00027Y-Cv@xenbits.xen.org>
Date: Tue, 02 Oct 2012 18:22:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/Intel: add further support for
	Ivy Bridge CPU models
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1349172840 -7200
# Node ID 87bf99fad7a9f018530d13213f57610621838085
# Parent  5fbdbf585f5f2ee9a3e3c75a8a9f9f2cc6eda65c
x86/Intel: add further support for Ivy Bridge CPU models

And some initial Haswell ones at once.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: "Nakajima, Jun" <jun.nakajima@intel.com>
---


diff -r 5fbdbf585f5f -r 87bf99fad7a9 xen/arch/x86/acpi/cpu_idle.c
--- a/xen/arch/x86/acpi/cpu_idle.c	Mon Oct 01 20:06:31 2012 +0100
+++ b/xen/arch/x86/acpi/cpu_idle.c	Tue Oct 02 12:14:00 2012 +0200
@@ -128,11 +128,15 @@ static void do_get_hw_residencies(void *
 
     switch ( c->x86_model )
     {
-    /* Ivy bridge */
-    case 0x3A:
     /* Sandy bridge */
     case 0x2A:
     case 0x2D:
+    /* Ivy bridge */
+    case 0x3A:
+    case 0x3E:
+    /* Haswell */
+    case 0x3c:
+    case 0x45:
         GET_PC2_RES(hw_res->pc2);
         GET_CC7_RES(hw_res->cc7);
         /* fall through */
diff -r 5fbdbf585f5f -r 87bf99fad7a9 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Mon Oct 01 20:06:31 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Tue Oct 02 12:14:00 2012 +0200
@@ -1746,7 +1746,9 @@ static const struct lbr_info *last_branc
         /* Sandy Bridge */
         case 42: case 45:
         /* Ivy Bridge */
-        case 58:
+        case 58: case 62:
+        /* Haswell */
+        case 60: case 69:
             return nh_lbr;
             break;
         /* Atom */
diff -r 5fbdbf585f5f -r 87bf99fad7a9 xen/arch/x86/hvm/vmx/vpmu_core2.c
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c	Mon Oct 01 20:06:31 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c	Tue Oct 02 12:14:00 2012 +0200
@@ -747,6 +747,7 @@ int vmx_vpmu_initialise(struct vcpu *v, 
         case 46:
         case 47:
         case 58:
+        case 62:
             ret = core2_vpmu_initialise(v, vpmu_flags);
             if ( !ret )
                 vpmu->arch_vpmu_ops = &core2_vpmu_ops;

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

From xen-changelog-bounces@lists.xen.org Tue Oct 02 18:22:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Oct 2012 18: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 1TJ76j-0004KD-Mo; Tue, 02 Oct 2012 18:22:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJ76i-0004J0-2K
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 18:22:12 +0000
Received: from [85.158.139.83:46605] by server-12.bemta-5.messagelabs.com id
	CE/A6-20729-3D03B605; Tue, 02 Oct 2012 18:22:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-182.messagelabs.com!1349202129!33095195!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16455 invoked from network); 2 Oct 2012 18:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Oct 2012 18:22:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJ76f-0003wD-Lp
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 18:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJ76f-00027Y-Cv
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 18:22:09 +0000
Message-Id: <E1TJ76f-00027Y-Cv@xenbits.xen.org>
Date: Tue, 02 Oct 2012 18:22:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/Intel: add further support for
	Ivy Bridge CPU models
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1349172840 -7200
# Node ID 87bf99fad7a9f018530d13213f57610621838085
# Parent  5fbdbf585f5f2ee9a3e3c75a8a9f9f2cc6eda65c
x86/Intel: add further support for Ivy Bridge CPU models

And some initial Haswell ones at once.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: "Nakajima, Jun" <jun.nakajima@intel.com>
---


diff -r 5fbdbf585f5f -r 87bf99fad7a9 xen/arch/x86/acpi/cpu_idle.c
--- a/xen/arch/x86/acpi/cpu_idle.c	Mon Oct 01 20:06:31 2012 +0100
+++ b/xen/arch/x86/acpi/cpu_idle.c	Tue Oct 02 12:14:00 2012 +0200
@@ -128,11 +128,15 @@ static void do_get_hw_residencies(void *
 
     switch ( c->x86_model )
     {
-    /* Ivy bridge */
-    case 0x3A:
     /* Sandy bridge */
     case 0x2A:
     case 0x2D:
+    /* Ivy bridge */
+    case 0x3A:
+    case 0x3E:
+    /* Haswell */
+    case 0x3c:
+    case 0x45:
         GET_PC2_RES(hw_res->pc2);
         GET_CC7_RES(hw_res->cc7);
         /* fall through */
diff -r 5fbdbf585f5f -r 87bf99fad7a9 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Mon Oct 01 20:06:31 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Tue Oct 02 12:14:00 2012 +0200
@@ -1746,7 +1746,9 @@ static const struct lbr_info *last_branc
         /* Sandy Bridge */
         case 42: case 45:
         /* Ivy Bridge */
-        case 58:
+        case 58: case 62:
+        /* Haswell */
+        case 60: case 69:
             return nh_lbr;
             break;
         /* Atom */
diff -r 5fbdbf585f5f -r 87bf99fad7a9 xen/arch/x86/hvm/vmx/vpmu_core2.c
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c	Mon Oct 01 20:06:31 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c	Tue Oct 02 12:14:00 2012 +0200
@@ -747,6 +747,7 @@ int vmx_vpmu_initialise(struct vcpu *v, 
         case 46:
         case 47:
         case 58:
+        case 62:
             ret = core2_vpmu_initialise(v, vpmu_flags);
             if ( !ret )
                 vpmu->arch_vpmu_ops = &core2_vpmu_ops;

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

From xen-changelog-bounces@lists.xen.org Tue Oct 02 22:11:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Oct 2012 22: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 1TJAgQ-0001dD-SZ; Tue, 02 Oct 2012 22:11:18 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJAgP-0001d3-Fd
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 22:11:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1349215868!8599816!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.4 required=7.0 tests=INFO_TLD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25094 invoked from network); 2 Oct 2012 22:11:10 -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;
	2 Oct 2012 22:11:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJAgG-0006j4-Gn
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 22:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJAgG-0008BY-93
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 22:11:08 +0000
Message-Id: <E1TJAgG-0008BY-93@xenbits.xen.org>
Date: Tue, 02 Oct 2012 22:11:07 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] tools: bump SONAMEs for changes
	during 4.2 development cycle.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1349190130 -3600
# Node ID ca3e8190a72c23c228a752887434cb7ae0fc7332
# Parent  906b3a2fcd0a82f37dcdf7ac83d71c637006c6f5
tools: bump SONAMEs for changes during 4.2 development cycle.

We mostly did this as we went along, only a couple of minor number
bumps were missed http://marc.info/?l=xen-devel&m=134366054929255&w=2:
 - Bumped libxl from 1.0.0 -> 1.0.1
 - Bumped libxenstore from 3.0.1 -> 3.0.2

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

xen-unstable changeset: 25943:0a64f1a3f72c
Backport-requested-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 906b3a2fcd0a -r ca3e8190a72c tools/libxl/Makefile
--- a/tools/libxl/Makefile	Tue Oct 02 10:20:13 2012 +0100
+++ b/tools/libxl/Makefile	Tue Oct 02 16:02:10 2012 +0100
@@ -9,7 +9,7 @@ MAJOR = 2.0
 MINOR = 0
 
 XLUMAJOR = 1.0
-XLUMINOR = 0
+XLUMINOR = 1
 
 CFLAGS += -Werror -Wno-format-zero-length -Wmissing-declarations \
 	-Wno-declaration-after-statement -Wformat-nonliteral
diff -r 906b3a2fcd0a -r ca3e8190a72c tools/xenstore/Makefile
--- a/tools/xenstore/Makefile	Tue Oct 02 10:20:13 2012 +0100
+++ b/tools/xenstore/Makefile	Tue Oct 02 16:02:10 2012 +0100
@@ -2,7 +2,7 @@ XEN_ROOT=$(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
 MAJOR = 3.0
-MINOR = 1
+MINOR = 2
 
 CFLAGS += -Werror
 CFLAGS += -I.

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

From xen-changelog-bounces@lists.xen.org Tue Oct 02 22:11:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Oct 2012 22: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 1TJAgQ-0001dD-SZ; Tue, 02 Oct 2012 22:11:18 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJAgP-0001d3-Fd
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 22:11:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1349215868!8599816!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.4 required=7.0 tests=INFO_TLD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25094 invoked from network); 2 Oct 2012 22:11:10 -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;
	2 Oct 2012 22:11:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJAgG-0006j4-Gn
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 22:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJAgG-0008BY-93
	for xen-changelog@lists.xensource.com; Tue, 02 Oct 2012 22:11:08 +0000
Message-Id: <E1TJAgG-0008BY-93@xenbits.xen.org>
Date: Tue, 02 Oct 2012 22:11:07 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] tools: bump SONAMEs for changes
	during 4.2 development cycle.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1349190130 -3600
# Node ID ca3e8190a72c23c228a752887434cb7ae0fc7332
# Parent  906b3a2fcd0a82f37dcdf7ac83d71c637006c6f5
tools: bump SONAMEs for changes during 4.2 development cycle.

We mostly did this as we went along, only a couple of minor number
bumps were missed http://marc.info/?l=xen-devel&m=134366054929255&w=2:
 - Bumped libxl from 1.0.0 -> 1.0.1
 - Bumped libxenstore from 3.0.1 -> 3.0.2

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

xen-unstable changeset: 25943:0a64f1a3f72c
Backport-requested-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 906b3a2fcd0a -r ca3e8190a72c tools/libxl/Makefile
--- a/tools/libxl/Makefile	Tue Oct 02 10:20:13 2012 +0100
+++ b/tools/libxl/Makefile	Tue Oct 02 16:02:10 2012 +0100
@@ -9,7 +9,7 @@ MAJOR = 2.0
 MINOR = 0
 
 XLUMAJOR = 1.0
-XLUMINOR = 0
+XLUMINOR = 1
 
 CFLAGS += -Werror -Wno-format-zero-length -Wmissing-declarations \
 	-Wno-declaration-after-statement -Wformat-nonliteral
diff -r 906b3a2fcd0a -r ca3e8190a72c tools/xenstore/Makefile
--- a/tools/xenstore/Makefile	Tue Oct 02 10:20:13 2012 +0100
+++ b/tools/xenstore/Makefile	Tue Oct 02 16:02:10 2012 +0100
@@ -2,7 +2,7 @@ XEN_ROOT=$(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
 MAJOR = 3.0
-MINOR = 1
+MINOR = 2
 
 CFLAGS += -Werror
 CFLAGS += -I.

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

From xen-changelog-bounces@lists.xen.org Wed Oct 03 15:33:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 03 Oct 2012 15: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 1TJQwj-0001Aq-FR; Wed, 03 Oct 2012 15:33:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJQwi-00019r-44
	for xen-changelog@lists.xensource.com; Wed, 03 Oct 2012 15:33:12 +0000
Received: from [85.158.137.99:3837] by server-9.bemta-3.messagelabs.com id
	8C/FF-20338-7BA5C605; Wed, 03 Oct 2012 15:33:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-217.messagelabs.com!1349278389!20024221!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18475 invoked from network); 3 Oct 2012 15:33:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2012 15:33:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJQwf-0002vM-CX
	for xen-changelog@lists.xensource.com; Wed, 03 Oct 2012 15:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJQwf-0001ep-8L
	for xen-changelog@lists.xensource.com; Wed, 03 Oct 2012 15:33:09 +0000
Message-Id: <E1TJQwf-0001ep-8L@xenbits.xen.org>
Date: Wed, 03 Oct 2012 15:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] MAINTAINERS: Matthew Fioravante now
	maintains VTPM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Matthew Fioravante <matthew.fioravante@jhuapl.edu>
# Date 1349259234 -3600
# Node ID 59dc1c2e7c54315f6442cca48bb7b7486612e84e
# Parent  8bd7dbcb513db86de032ad0226a561eba9a05ab0
MAINTAINERS: Matthew Fioravante now maintains VTPM

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 8bd7dbcb513d -r 59dc1c2e7c54 MAINTAINERS
--- a/MAINTAINERS	Wed Oct 03 11:11:35 2012 +0100
+++ b/MAINTAINERS	Wed Oct 03 11:13:54 2012 +0100
@@ -261,6 +261,21 @@ S:	Supported
 F:	tools/xentrace/
 F:	xen/common/trace.c
 
+VTPM
+M:	Matthew Fioravante <matthew.fioravante@jhuapl.edu>
+S:	Supported
+F:	tools/vtpm
+F:	tools/vtpm_manager
+F:	extras/minios-os/tpmfront.c
+F:	extras/minios-os/tpmback.c
+F:	extras/minios-os/tpm-tis.c
+F:	extras/minios-os/include/tpmfront.h
+F:	extras/minios-os/include/tpmback.h
+F:	extras/minios-os/include/tpm-tis.h
+F:	stubdom/vtpm
+F:	stubdom/vtpmmgr
+F:	docs/misc/vtpm.txt
+
 THE REST
 M:	Keir Fraser <keir@xen.org>
 L:	xen-devel@lists.xen.org

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

From xen-changelog-bounces@lists.xen.org Wed Oct 03 15:33:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 03 Oct 2012 15: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 1TJQwi-0001A8-7C; Wed, 03 Oct 2012 15:33:12 +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 1TJQwh-00019X-7J
	for xen-changelog@lists.xensource.com; Wed, 03 Oct 2012 15:33:11 +0000
Received: from [85.158.139.211:17118] by server-16.bemta-5.messagelabs.com id
	36/91-05998-6BA5C605; Wed, 03 Oct 2012 15:33:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-206.messagelabs.com!1349278388!20928974!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5684 invoked from network); 3 Oct 2012 15:33: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;
	3 Oct 2012 15:33:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJQwe-0002vD-0c
	for xen-changelog@lists.xensource.com; Wed, 03 Oct 2012 15:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJQwd-0001e6-KA
	for xen-changelog@lists.xensource.com; Wed, 03 Oct 2012 15:33:07 +0000
Message-Id: <E1TJQwd-0001e6-KA@xenbits.xen.org>
Date: Wed, 03 Oct 2012 15:33:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] trace: allow for different
	sub-classes of TRC_PV_* tracepoints
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User David Vrabel <david.vrabel@citrix.com>
# Date 1349259033 -3600
# Node ID d7de8495d21cc25e4ff3dbedd4b165d6b6ca0af3
# Parent  87bf99fad7a9f018530d13213f57610621838085
trace: allow for different sub-classes of TRC_PV_* tracepoints

We want to add additional sub-classes for TRC_PV tracepoints and to be
able to only capture these new sub-classes.  This cannot currently be
done as the existing tracepoints all use a sub-class of 0xf.

So, redefine the PV events to use a new sub-class.  All the current
tracepoints are tracing entry points to the hypervisor so the
sub-class is named TRC_PV_ENTRY.

This change does not affect xenalyze as that only looks at the main
class and the event number and does not use the sub-class field.

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 87bf99fad7a9 -r d7de8495d21c tools/xentrace/formats
--- a/tools/xentrace/formats	Tue Oct 02 12:14:00 2012 +0200
+++ b/tools/xentrace/formats	Wed Oct 03 11:10:33 2012 +0100
@@ -82,28 +82,28 @@ 0x0010f001  CPU%(cpu)d  %(tsc)d (+%(relt
 0x0010f002  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  page_grant_unmap    [ domid = %(1)d ]
 0x0010f003  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  page_grant_transfer [ domid = %(1)d ]
 
-0x0020f001  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  hypercall  [ eip = 0x%(1)08x, eax = 0x%(2)08x ]
-0x0020f101  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  hypercall  [ rip = 0x%(2)08x%(1)08x, eax = 0x%(3)08x ]
-0x0020f003  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  trap       [ eip = 0x%(1)08x, trapnr:error = 0x%(2)08x ]
-0x0020f103  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  trap       [ rip = 0x%(2)08x%(1)08x, trapnr:error = 0x%(3)08x ]
-0x0020f004  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  page_fault [ eip = 0x%(1)08x, addr = 0x%(2)08x, error = 0x%(3)08x ]
-0x0020f104  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  page_fault [ rip = 0x%(2)08x%(1)08x, addr = 0x%(4)08x%(3)08x, error = 0x%(5)08x ]
-0x0020f005  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  forced_invalid_op   [ eip = 0x%(1)08x ]
-0x0020f105  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  forced_invalid_op   [ rip = 0x%(2)08x%(1)08x ]
-0x0020f006  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  emulate_privop      [ eip = 0x%(1)08x ]
-0x0020f106  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  emulate_privop      [ rip = 0x%(2)08x%(1)08x ]
-0x0020f007  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  emulate_4G          [ eip = 0x%(1)08x ]
-0x0020f107  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  emulate_4G          [ rip = 0x%(2)08x%(1)08x ]
-0x0020f008  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  math_state_restore
-0x0020f108  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  math_state_restore
-0x0020f009  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  paging_fixup        [ eip = 0x%(1)08x, addr = 0x%(2)08x ]
-0x0020f109  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  paging_fixup        [ rip = 0x%(2)08x%(1)08x, addr = 0x%(4)08x%(3)08x ]
-0x0020f00a  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  gdt_ldt_mapping_fault  [ eip = 0x%(1)08x, offset = 0x%(2)08x ]
-0x0020f10a  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  gdt_ldt_mapping_fault  [ rip = 0x%(2)08x%(1)08x, offset = 0x%(4)08x%(3)08x ]
-0x0020f00b  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  ptwr_emulation      [ addr = 0x%(3)08x, eip = 0x%(4)08x, npte = 0x%(2)08x%(1)08x ]
-0x0020f10b  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  ptwr_emulation      [ addr = 0x%(4)08x%(3)08x, rip = 0x%(6)08x%(5)08x, npte = 0x%(2)08x%(1)08x ]
-0x0020f00c  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  ptwr_emulation_pae  [ addr = 0x%(3)08x, eip = 0x%(4)08x, npte = 0x%(2)08x%(1)08x ]
-0x0020f10c  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  ptwr_emulation_pae  [ addr = 0x%(4)08x%(3)08x, rip = 0x%(6)08x%(5)08x, npte = 0x%(2)08x%(1)08x ]
+0x00201001  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  hypercall  [ eip = 0x%(1)08x, eax = 0x%(2)08x ]
+0x00201101  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  hypercall  [ rip = 0x%(2)08x%(1)08x, eax = 0x%(3)08x ]
+0x00201003  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  trap       [ eip = 0x%(1)08x, trapnr:error = 0x%(2)08x ]
+0x00201103  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  trap       [ rip = 0x%(2)08x%(1)08x, trapnr:error = 0x%(3)08x ]
+0x00201004  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  page_fault [ eip = 0x%(1)08x, addr = 0x%(2)08x, error = 0x%(3)08x ]
+0x00201104  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  page_fault [ rip = 0x%(2)08x%(1)08x, addr = 0x%(4)08x%(3)08x, error = 0x%(5)08x ]
+0x00201005  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  forced_invalid_op   [ eip = 0x%(1)08x ]
+0x00201105  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  forced_invalid_op   [ rip = 0x%(2)08x%(1)08x ]
+0x00201006  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  emulate_privop      [ eip = 0x%(1)08x ]
+0x00201106  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  emulate_privop      [ rip = 0x%(2)08x%(1)08x ]
+0x00201007  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  emulate_4G          [ eip = 0x%(1)08x ]
+0x00201107  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  emulate_4G          [ rip = 0x%(2)08x%(1)08x ]
+0x00201008  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  math_state_restore
+0x00201108  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  math_state_restore
+0x00201009  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  paging_fixup        [ eip = 0x%(1)08x, addr = 0x%(2)08x ]
+0x00201109  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  paging_fixup        [ rip = 0x%(2)08x%(1)08x, addr = 0x%(4)08x%(3)08x ]
+0x0020100a  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  gdt_ldt_mapping_fault  [ eip = 0x%(1)08x, offset = 0x%(2)08x ]
+0x0020110a  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  gdt_ldt_mapping_fault  [ rip = 0x%(2)08x%(1)08x, offset = 0x%(4)08x%(3)08x ]
+0x0020100b  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  ptwr_emulation      [ addr = 0x%(3)08x, eip = 0x%(4)08x, npte = 0x%(2)08x%(1)08x ]
+0x0020110b  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  ptwr_emulation      [ addr = 0x%(4)08x%(3)08x, rip = 0x%(6)08x%(5)08x, npte = 0x%(2)08x%(1)08x ]
+0x0020100c  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  ptwr_emulation_pae  [ addr = 0x%(3)08x, eip = 0x%(4)08x, npte = 0x%(2)08x%(1)08x ]
+0x0020110c  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  ptwr_emulation_pae  [ addr = 0x%(4)08x%(3)08x, rip = 0x%(6)08x%(5)08x, npte = 0x%(2)08x%(1)08x ]
 
 0x0040f001  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  shadow_not_shadow                 [ gl1e = 0x%(2)08x%(1)08x, va = 0x%(3)08x, flags = 0x%(4)08x ]
 0x0040f101  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  shadow_not_shadow                 [ gl1e = 0x%(2)08x%(1)08x, va = 0x%(4)08x%(3)08x, flags = 0x%(5)08x ]
diff -r 87bf99fad7a9 -r d7de8495d21c xen/include/public/trace.h
--- a/xen/include/public/trace.h	Tue Oct 02 12:14:00 2012 +0200
+++ b/xen/include/public/trace.h	Wed Oct 03 11:10:33 2012 +0100
@@ -94,20 +94,19 @@
 #define TRC_MEM_POD_ZERO_RECLAIM    (TRC_MEM + 17)
 #define TRC_MEM_POD_SUPERPAGE_SPLINTER (TRC_MEM + 18)
 
+#define TRC_PV_ENTRY 0x00201000 /* Hypervisor entry points for PV guests. */
 
-#define TRC_PV_HYPERCALL             (TRC_PV +  1)
-#define TRC_PV_TRAP                  (TRC_PV +  3)
-#define TRC_PV_PAGE_FAULT            (TRC_PV +  4)
-#define TRC_PV_FORCED_INVALID_OP     (TRC_PV +  5)
-#define TRC_PV_EMULATE_PRIVOP        (TRC_PV +  6)
-#define TRC_PV_EMULATE_4GB           (TRC_PV +  7)
-#define TRC_PV_MATH_STATE_RESTORE    (TRC_PV +  8)
-#define TRC_PV_PAGING_FIXUP          (TRC_PV +  9)
-#define TRC_PV_GDT_LDT_MAPPING_FAULT (TRC_PV + 10)
-#define TRC_PV_PTWR_EMULATION        (TRC_PV + 11)
-#define TRC_PV_PTWR_EMULATION_PAE    (TRC_PV + 12)
-  /* Indicates that addresses in trace record are 64 bits */
-#define TRC_64_FLAG               (0x100) 
+#define TRC_PV_HYPERCALL             (TRC_PV_ENTRY +  1)
+#define TRC_PV_TRAP                  (TRC_PV_ENTRY +  3)
+#define TRC_PV_PAGE_FAULT            (TRC_PV_ENTRY +  4)
+#define TRC_PV_FORCED_INVALID_OP     (TRC_PV_ENTRY +  5)
+#define TRC_PV_EMULATE_PRIVOP        (TRC_PV_ENTRY +  6)
+#define TRC_PV_EMULATE_4GB           (TRC_PV_ENTRY +  7)
+#define TRC_PV_MATH_STATE_RESTORE    (TRC_PV_ENTRY +  8)
+#define TRC_PV_PAGING_FIXUP          (TRC_PV_ENTRY +  9)
+#define TRC_PV_GDT_LDT_MAPPING_FAULT (TRC_PV_ENTRY + 10)
+#define TRC_PV_PTWR_EMULATION        (TRC_PV_ENTRY + 11)
+#define TRC_PV_PTWR_EMULATION_PAE    (TRC_PV_ENTRY + 12)
 
 #define TRC_SHADOW_NOT_SHADOW                 (TRC_SHADOW +  1)
 #define TRC_SHADOW_FAST_PROPAGATE             (TRC_SHADOW +  2)
@@ -187,6 +186,14 @@
 #define TRC_HW_IRQ_UNMAPPED_VECTOR    (TRC_HW_IRQ + 0x7)
 #define TRC_HW_IRQ_HANDLED            (TRC_HW_IRQ + 0x8)
 
+/*
+ * Event Flags
+ *
+ * Some events (e.g, TRC_PV_TRAP and TRC_HVM_IOMEM_READ) have multiple
+ * record formats.  These event flags distinguish between the
+ * different formats.
+ */
+#define TRC_64_FLAG 0x100 /* Addresses are 64 bits (instead of 32 bits) */
 
 /* This structure represents a single trace buffer record. */
 struct t_rec {

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

From xen-changelog-bounces@lists.xen.org Wed Oct 03 15:33:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 03 Oct 2012 15: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 1TJQwi-0001A8-7C; Wed, 03 Oct 2012 15:33:12 +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 1TJQwh-00019X-7J
	for xen-changelog@lists.xensource.com; Wed, 03 Oct 2012 15:33:11 +0000
Received: from [85.158.139.211:17118] by server-16.bemta-5.messagelabs.com id
	36/91-05998-6BA5C605; Wed, 03 Oct 2012 15:33:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-206.messagelabs.com!1349278388!20928974!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5684 invoked from network); 3 Oct 2012 15:33: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;
	3 Oct 2012 15:33:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJQwe-0002vD-0c
	for xen-changelog@lists.xensource.com; Wed, 03 Oct 2012 15:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJQwd-0001e6-KA
	for xen-changelog@lists.xensource.com; Wed, 03 Oct 2012 15:33:07 +0000
Message-Id: <E1TJQwd-0001e6-KA@xenbits.xen.org>
Date: Wed, 03 Oct 2012 15:33:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] trace: allow for different
	sub-classes of TRC_PV_* tracepoints
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User David Vrabel <david.vrabel@citrix.com>
# Date 1349259033 -3600
# Node ID d7de8495d21cc25e4ff3dbedd4b165d6b6ca0af3
# Parent  87bf99fad7a9f018530d13213f57610621838085
trace: allow for different sub-classes of TRC_PV_* tracepoints

We want to add additional sub-classes for TRC_PV tracepoints and to be
able to only capture these new sub-classes.  This cannot currently be
done as the existing tracepoints all use a sub-class of 0xf.

So, redefine the PV events to use a new sub-class.  All the current
tracepoints are tracing entry points to the hypervisor so the
sub-class is named TRC_PV_ENTRY.

This change does not affect xenalyze as that only looks at the main
class and the event number and does not use the sub-class field.

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 87bf99fad7a9 -r d7de8495d21c tools/xentrace/formats
--- a/tools/xentrace/formats	Tue Oct 02 12:14:00 2012 +0200
+++ b/tools/xentrace/formats	Wed Oct 03 11:10:33 2012 +0100
@@ -82,28 +82,28 @@ 0x0010f001  CPU%(cpu)d  %(tsc)d (+%(relt
 0x0010f002  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  page_grant_unmap    [ domid = %(1)d ]
 0x0010f003  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  page_grant_transfer [ domid = %(1)d ]
 
-0x0020f001  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  hypercall  [ eip = 0x%(1)08x, eax = 0x%(2)08x ]
-0x0020f101  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  hypercall  [ rip = 0x%(2)08x%(1)08x, eax = 0x%(3)08x ]
-0x0020f003  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  trap       [ eip = 0x%(1)08x, trapnr:error = 0x%(2)08x ]
-0x0020f103  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  trap       [ rip = 0x%(2)08x%(1)08x, trapnr:error = 0x%(3)08x ]
-0x0020f004  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  page_fault [ eip = 0x%(1)08x, addr = 0x%(2)08x, error = 0x%(3)08x ]
-0x0020f104  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  page_fault [ rip = 0x%(2)08x%(1)08x, addr = 0x%(4)08x%(3)08x, error = 0x%(5)08x ]
-0x0020f005  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  forced_invalid_op   [ eip = 0x%(1)08x ]
-0x0020f105  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  forced_invalid_op   [ rip = 0x%(2)08x%(1)08x ]
-0x0020f006  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  emulate_privop      [ eip = 0x%(1)08x ]
-0x0020f106  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  emulate_privop      [ rip = 0x%(2)08x%(1)08x ]
-0x0020f007  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  emulate_4G          [ eip = 0x%(1)08x ]
-0x0020f107  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  emulate_4G          [ rip = 0x%(2)08x%(1)08x ]
-0x0020f008  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  math_state_restore
-0x0020f108  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  math_state_restore
-0x0020f009  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  paging_fixup        [ eip = 0x%(1)08x, addr = 0x%(2)08x ]
-0x0020f109  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  paging_fixup        [ rip = 0x%(2)08x%(1)08x, addr = 0x%(4)08x%(3)08x ]
-0x0020f00a  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  gdt_ldt_mapping_fault  [ eip = 0x%(1)08x, offset = 0x%(2)08x ]
-0x0020f10a  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  gdt_ldt_mapping_fault  [ rip = 0x%(2)08x%(1)08x, offset = 0x%(4)08x%(3)08x ]
-0x0020f00b  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  ptwr_emulation      [ addr = 0x%(3)08x, eip = 0x%(4)08x, npte = 0x%(2)08x%(1)08x ]
-0x0020f10b  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  ptwr_emulation      [ addr = 0x%(4)08x%(3)08x, rip = 0x%(6)08x%(5)08x, npte = 0x%(2)08x%(1)08x ]
-0x0020f00c  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  ptwr_emulation_pae  [ addr = 0x%(3)08x, eip = 0x%(4)08x, npte = 0x%(2)08x%(1)08x ]
-0x0020f10c  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  ptwr_emulation_pae  [ addr = 0x%(4)08x%(3)08x, rip = 0x%(6)08x%(5)08x, npte = 0x%(2)08x%(1)08x ]
+0x00201001  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  hypercall  [ eip = 0x%(1)08x, eax = 0x%(2)08x ]
+0x00201101  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  hypercall  [ rip = 0x%(2)08x%(1)08x, eax = 0x%(3)08x ]
+0x00201003  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  trap       [ eip = 0x%(1)08x, trapnr:error = 0x%(2)08x ]
+0x00201103  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  trap       [ rip = 0x%(2)08x%(1)08x, trapnr:error = 0x%(3)08x ]
+0x00201004  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  page_fault [ eip = 0x%(1)08x, addr = 0x%(2)08x, error = 0x%(3)08x ]
+0x00201104  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  page_fault [ rip = 0x%(2)08x%(1)08x, addr = 0x%(4)08x%(3)08x, error = 0x%(5)08x ]
+0x00201005  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  forced_invalid_op   [ eip = 0x%(1)08x ]
+0x00201105  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  forced_invalid_op   [ rip = 0x%(2)08x%(1)08x ]
+0x00201006  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  emulate_privop      [ eip = 0x%(1)08x ]
+0x00201106  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  emulate_privop      [ rip = 0x%(2)08x%(1)08x ]
+0x00201007  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  emulate_4G          [ eip = 0x%(1)08x ]
+0x00201107  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  emulate_4G          [ rip = 0x%(2)08x%(1)08x ]
+0x00201008  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  math_state_restore
+0x00201108  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  math_state_restore
+0x00201009  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  paging_fixup        [ eip = 0x%(1)08x, addr = 0x%(2)08x ]
+0x00201109  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  paging_fixup        [ rip = 0x%(2)08x%(1)08x, addr = 0x%(4)08x%(3)08x ]
+0x0020100a  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  gdt_ldt_mapping_fault  [ eip = 0x%(1)08x, offset = 0x%(2)08x ]
+0x0020110a  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  gdt_ldt_mapping_fault  [ rip = 0x%(2)08x%(1)08x, offset = 0x%(4)08x%(3)08x ]
+0x0020100b  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  ptwr_emulation      [ addr = 0x%(3)08x, eip = 0x%(4)08x, npte = 0x%(2)08x%(1)08x ]
+0x0020110b  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  ptwr_emulation      [ addr = 0x%(4)08x%(3)08x, rip = 0x%(6)08x%(5)08x, npte = 0x%(2)08x%(1)08x ]
+0x0020100c  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  ptwr_emulation_pae  [ addr = 0x%(3)08x, eip = 0x%(4)08x, npte = 0x%(2)08x%(1)08x ]
+0x0020110c  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  ptwr_emulation_pae  [ addr = 0x%(4)08x%(3)08x, rip = 0x%(6)08x%(5)08x, npte = 0x%(2)08x%(1)08x ]
 
 0x0040f001  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  shadow_not_shadow                 [ gl1e = 0x%(2)08x%(1)08x, va = 0x%(3)08x, flags = 0x%(4)08x ]
 0x0040f101  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  shadow_not_shadow                 [ gl1e = 0x%(2)08x%(1)08x, va = 0x%(4)08x%(3)08x, flags = 0x%(5)08x ]
diff -r 87bf99fad7a9 -r d7de8495d21c xen/include/public/trace.h
--- a/xen/include/public/trace.h	Tue Oct 02 12:14:00 2012 +0200
+++ b/xen/include/public/trace.h	Wed Oct 03 11:10:33 2012 +0100
@@ -94,20 +94,19 @@
 #define TRC_MEM_POD_ZERO_RECLAIM    (TRC_MEM + 17)
 #define TRC_MEM_POD_SUPERPAGE_SPLINTER (TRC_MEM + 18)
 
+#define TRC_PV_ENTRY 0x00201000 /* Hypervisor entry points for PV guests. */
 
-#define TRC_PV_HYPERCALL             (TRC_PV +  1)
-#define TRC_PV_TRAP                  (TRC_PV +  3)
-#define TRC_PV_PAGE_FAULT            (TRC_PV +  4)
-#define TRC_PV_FORCED_INVALID_OP     (TRC_PV +  5)
-#define TRC_PV_EMULATE_PRIVOP        (TRC_PV +  6)
-#define TRC_PV_EMULATE_4GB           (TRC_PV +  7)
-#define TRC_PV_MATH_STATE_RESTORE    (TRC_PV +  8)
-#define TRC_PV_PAGING_FIXUP          (TRC_PV +  9)
-#define TRC_PV_GDT_LDT_MAPPING_FAULT (TRC_PV + 10)
-#define TRC_PV_PTWR_EMULATION        (TRC_PV + 11)
-#define TRC_PV_PTWR_EMULATION_PAE    (TRC_PV + 12)
-  /* Indicates that addresses in trace record are 64 bits */
-#define TRC_64_FLAG               (0x100) 
+#define TRC_PV_HYPERCALL             (TRC_PV_ENTRY +  1)
+#define TRC_PV_TRAP                  (TRC_PV_ENTRY +  3)
+#define TRC_PV_PAGE_FAULT            (TRC_PV_ENTRY +  4)
+#define TRC_PV_FORCED_INVALID_OP     (TRC_PV_ENTRY +  5)
+#define TRC_PV_EMULATE_PRIVOP        (TRC_PV_ENTRY +  6)
+#define TRC_PV_EMULATE_4GB           (TRC_PV_ENTRY +  7)
+#define TRC_PV_MATH_STATE_RESTORE    (TRC_PV_ENTRY +  8)
+#define TRC_PV_PAGING_FIXUP          (TRC_PV_ENTRY +  9)
+#define TRC_PV_GDT_LDT_MAPPING_FAULT (TRC_PV_ENTRY + 10)
+#define TRC_PV_PTWR_EMULATION        (TRC_PV_ENTRY + 11)
+#define TRC_PV_PTWR_EMULATION_PAE    (TRC_PV_ENTRY + 12)
 
 #define TRC_SHADOW_NOT_SHADOW                 (TRC_SHADOW +  1)
 #define TRC_SHADOW_FAST_PROPAGATE             (TRC_SHADOW +  2)
@@ -187,6 +186,14 @@
 #define TRC_HW_IRQ_UNMAPPED_VECTOR    (TRC_HW_IRQ + 0x7)
 #define TRC_HW_IRQ_HANDLED            (TRC_HW_IRQ + 0x8)
 
+/*
+ * Event Flags
+ *
+ * Some events (e.g, TRC_PV_TRAP and TRC_HVM_IOMEM_READ) have multiple
+ * record formats.  These event flags distinguish between the
+ * different formats.
+ */
+#define TRC_64_FLAG 0x100 /* Addresses are 64 bits (instead of 32 bits) */
 
 /* This structure represents a single trace buffer record. */
 struct t_rec {

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

From xen-changelog-bounces@lists.xen.org Wed Oct 03 15:33:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 03 Oct 2012 15: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 1TJQwj-0001Aq-FR; Wed, 03 Oct 2012 15:33:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJQwi-00019r-44
	for xen-changelog@lists.xensource.com; Wed, 03 Oct 2012 15:33:12 +0000
Received: from [85.158.137.99:3837] by server-9.bemta-3.messagelabs.com id
	8C/FF-20338-7BA5C605; Wed, 03 Oct 2012 15:33:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-217.messagelabs.com!1349278389!20024221!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18475 invoked from network); 3 Oct 2012 15:33:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2012 15:33:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJQwf-0002vM-CX
	for xen-changelog@lists.xensource.com; Wed, 03 Oct 2012 15:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJQwf-0001ep-8L
	for xen-changelog@lists.xensource.com; Wed, 03 Oct 2012 15:33:09 +0000
Message-Id: <E1TJQwf-0001ep-8L@xenbits.xen.org>
Date: Wed, 03 Oct 2012 15:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] MAINTAINERS: Matthew Fioravante now
	maintains VTPM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Matthew Fioravante <matthew.fioravante@jhuapl.edu>
# Date 1349259234 -3600
# Node ID 59dc1c2e7c54315f6442cca48bb7b7486612e84e
# Parent  8bd7dbcb513db86de032ad0226a561eba9a05ab0
MAINTAINERS: Matthew Fioravante now maintains VTPM

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 8bd7dbcb513d -r 59dc1c2e7c54 MAINTAINERS
--- a/MAINTAINERS	Wed Oct 03 11:11:35 2012 +0100
+++ b/MAINTAINERS	Wed Oct 03 11:13:54 2012 +0100
@@ -261,6 +261,21 @@ S:	Supported
 F:	tools/xentrace/
 F:	xen/common/trace.c
 
+VTPM
+M:	Matthew Fioravante <matthew.fioravante@jhuapl.edu>
+S:	Supported
+F:	tools/vtpm
+F:	tools/vtpm_manager
+F:	extras/minios-os/tpmfront.c
+F:	extras/minios-os/tpmback.c
+F:	extras/minios-os/tpm-tis.c
+F:	extras/minios-os/include/tpmfront.h
+F:	extras/minios-os/include/tpmback.h
+F:	extras/minios-os/include/tpm-tis.h
+F:	stubdom/vtpm
+F:	stubdom/vtpmmgr
+F:	docs/misc/vtpm.txt
+
 THE REST
 M:	Keir Fraser <keir@xen.org>
 L:	xen-devel@lists.xen.org

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

From xen-changelog-bounces@lists.xen.org Wed Oct 03 15:33:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 03 Oct 2012 15: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 1TJQwj-0001Ag-AB; Wed, 03 Oct 2012 15:33:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJQwh-00019b-Rl
	for xen-changelog@lists.xensource.com; Wed, 03 Oct 2012 15:33:12 +0000
Received: from [85.158.143.99:39426] by server-1.bemta-4.messagelabs.com id
	C2/E1-05684-7BA5C605; Wed, 03 Oct 2012 15:33:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1349278389!26289924!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14953 invoked from network); 3 Oct 2012 15:33:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2012 15:33:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJQwe-0002vJ-Ud
	for xen-changelog@lists.xensource.com; Wed, 03 Oct 2012 15:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJQwe-0001ea-NO
	for xen-changelog@lists.xensource.com; Wed, 03 Oct 2012 15:33:08 +0000
Message-Id: <E1TJQwe-0001ea-NO@xenbits.xen.org>
Date: Wed, 03 Oct 2012 15:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] trace: trace hypercalls inside a
	multicall
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User David Vrabel <david.vrabel@citrix.com>
# Date 1349259095 -3600
# Node ID 8bd7dbcb513db86de032ad0226a561eba9a05ab0
# Parent  ffb6e90fee6b4247389203a450aa5d51a4b2bcbe
trace: trace hypercalls inside a multicall

Add a trace record for every hypercall inside a multicall.  These use
a new event ID (with a different sub-class ) so they may be filtered
out if only the calls into hypervisor are of interest.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r ffb6e90fee6b -r 8bd7dbcb513d tools/xentrace/formats
--- a/tools/xentrace/formats	Wed Oct 03 11:11:06 2012 +0100
+++ b/tools/xentrace/formats	Wed Oct 03 11:11:35 2012 +0100
@@ -105,6 +105,7 @@ 0x0020110b  CPU%(cpu)d  %(tsc)d (+%(relt
 0x0020100c  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  ptwr_emulation_pae  [ addr = 0x%(3)08x, eip = 0x%(4)08x, npte = 0x%(2)08x%(1)08x ]
 0x0020110c  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  ptwr_emulation_pae  [ addr = 0x%(4)08x%(3)08x, rip = 0x%(6)08x%(5)08x, npte = 0x%(2)08x%(1)08x ]
 0x0020100d  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  hypercall  [ op = 0x%(1)08x ]
+0x0020200e  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)    hypercall  [ op = 0x%(1)08x ]
 
 0x0040f001  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  shadow_not_shadow                 [ gl1e = 0x%(2)08x%(1)08x, va = 0x%(3)08x, flags = 0x%(4)08x ]
 0x0040f101  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  shadow_not_shadow                 [ gl1e = 0x%(2)08x%(1)08x, va = 0x%(4)08x%(3)08x, flags = 0x%(5)08x ]
diff -r ffb6e90fee6b -r 8bd7dbcb513d tools/xentrace/xentrace_format
--- a/tools/xentrace/xentrace_format	Wed Oct 03 11:11:06 2012 +0100
+++ b/tools/xentrace/xentrace_format	Wed Oct 03 11:11:35 2012 +0100
@@ -112,6 +112,7 @@ last_tsc = [0]
 
 TRC_TRACE_IRQ = 0x1f004
 TRC_PV_HYPERCALL_V2 = 0x20100d
+TRC_PV_HYPERCALL_SUBCALL = 0x20100e
 
 NR_VECTORS = 256
 irq_measure = [{'count':0, 'tot_cycles':0, 'max_cycles':0}] * NR_VECTORS
@@ -199,7 +200,7 @@ while not interrupted:
             d3 = irq_measure[d1]['tot_cycles']
             d4 = irq_measure[d1]['max_cycles']
 
-        if event == TRC_PV_HYPERCALL_V2:
+        if event == TRC_PV_HYPERCALL_V2 or event == TRC_PV_HYPERCALL_SUBCALL:
             # Mask off the argument present bits.
             d1 &= 0x000fffff
 
diff -r ffb6e90fee6b -r 8bd7dbcb513d xen/arch/x86/trace.c
--- a/xen/arch/x86/trace.c	Wed Oct 03 11:11:06 2012 +0100
+++ b/xen/arch/x86/trace.c	Wed Oct 03 11:11:35 2012 +0100
@@ -30,7 +30,7 @@ void trace_hypercall(void)
         args[5] = regs->r9;
     }
 
-    __trace_hypercall(regs->eax, args);
+    __trace_hypercall(TRC_PV_HYPERCALL_V2, regs->eax, args);
 }
 
 void __trace_pv_trap(int trapnr, unsigned long eip,
diff -r ffb6e90fee6b -r 8bd7dbcb513d xen/common/compat/multicall.c
--- a/xen/common/compat/multicall.c	Wed Oct 03 11:11:06 2012 +0100
+++ b/xen/common/compat/multicall.c	Wed Oct 03 11:11:35 2012 +0100
@@ -5,6 +5,7 @@
 #include <xen/config.h>
 #include <xen/types.h>
 #include <xen/multicall.h>
+#include <xen/trace.h>
 
 #define COMPAT
 typedef int ret_t;
@@ -25,6 +26,17 @@ DEFINE_XEN_GUEST_HANDLE(multicall_entry_
 #define do_multicall(l, n)   compat_multicall(_##l, n)
 #define _XEN_GUEST_HANDLE(t) XEN_GUEST_HANDLE(t)
 
+static void __trace_multicall_call(multicall_entry_t *call)
+{
+    unsigned long args[6];
+    int i;
+
+    for ( i = 0; i < ARRAY_SIZE(args); i++ )
+        args[i] = call->args[i];
+
+    __trace_hypercall(TRC_PV_HYPERCALL_SUBCALL, call->op, args);
+}
+
 #include "../multicall.c"
 
 /*
diff -r ffb6e90fee6b -r 8bd7dbcb513d xen/common/multicall.c
--- a/xen/common/multicall.c	Wed Oct 03 11:11:06 2012 +0100
+++ b/xen/common/multicall.c	Wed Oct 03 11:11:35 2012 +0100
@@ -11,14 +11,28 @@
 #include <xen/multicall.h>
 #include <xen/guest_access.h>
 #include <xen/perfc.h>
+#include <xen/trace.h>
 #include <asm/current.h>
 #include <asm/hardirq.h>
 
 #ifndef COMPAT
 typedef long ret_t;
 #define xlat_multicall_entry(mcs)
+
+static void __trace_multicall_call(multicall_entry_t *call)
+{
+    __trace_hypercall(TRC_PV_HYPERCALL_SUBCALL, call->op, call->args);
+}
 #endif
 
+static void trace_multicall_call(multicall_entry_t *call)
+{
+    if ( !tb_init_done )
+        return;
+
+    __trace_multicall_call(call);
+}
+
 ret_t
 do_multicall(
     XEN_GUEST_HANDLE(multicall_entry_t) call_list, unsigned int nr_calls)
@@ -47,6 +61,8 @@ do_multicall(
             break;
         }
 
+        trace_multicall_call(&mcs->call);
+
         do_multicall_call(&mcs->call);
 
 #ifndef NDEBUG
diff -r ffb6e90fee6b -r 8bd7dbcb513d xen/common/trace.c
--- a/xen/common/trace.c	Wed Oct 03 11:11:06 2012 +0100
+++ b/xen/common/trace.c	Wed Oct 03 11:11:35 2012 +0100
@@ -816,7 +816,8 @@ unlock:
         tasklet_schedule(&trace_notify_dom0_tasklet);
 }
 
-void __trace_hypercall(unsigned long op, const unsigned long *args)
+void __trace_hypercall(uint32_t event, unsigned long op,
+                       const unsigned long *args)
 {
     struct {
         uint32_t op;
@@ -864,8 +865,7 @@ void __trace_hypercall(unsigned long op,
         break;
     }
 
-    __trace_var(TRC_PV_HYPERCALL_V2, 1,
-                sizeof(uint32_t) * (1 + (a - d.args)), &d);
+    __trace_var(event, 1, sizeof(uint32_t) * (1 + (a - d.args)), &d);
 }
 
 /*
diff -r ffb6e90fee6b -r 8bd7dbcb513d xen/include/public/trace.h
--- a/xen/include/public/trace.h	Wed Oct 03 11:11:06 2012 +0100
+++ b/xen/include/public/trace.h	Wed Oct 03 11:11:35 2012 +0100
@@ -94,7 +94,8 @@
 #define TRC_MEM_POD_ZERO_RECLAIM    (TRC_MEM + 17)
 #define TRC_MEM_POD_SUPERPAGE_SPLINTER (TRC_MEM + 18)
 
-#define TRC_PV_ENTRY 0x00201000 /* Hypervisor entry points for PV guests. */
+#define TRC_PV_ENTRY   0x00201000 /* Hypervisor entry points for PV guests. */
+#define TRC_PV_SUBCALL 0x00202000 /* Sub-call in a multicall hypercall */
 
 #define TRC_PV_HYPERCALL             (TRC_PV_ENTRY +  1)
 #define TRC_PV_TRAP                  (TRC_PV_ENTRY +  3)
@@ -108,6 +109,7 @@
 #define TRC_PV_PTWR_EMULATION        (TRC_PV_ENTRY + 11)
 #define TRC_PV_PTWR_EMULATION_PAE    (TRC_PV_ENTRY + 12)
 #define TRC_PV_HYPERCALL_V2          (TRC_PV_ENTRY + 13)
+#define TRC_PV_HYPERCALL_SUBCALL     (TRC_PV_SUBCALL + 14)
 
 /*
  * TRC_PV_HYPERCALL_V2 format
diff -r ffb6e90fee6b -r 8bd7dbcb513d xen/include/xen/trace.h
--- a/xen/include/xen/trace.h	Wed Oct 03 11:11:06 2012 +0100
+++ b/xen/include/xen/trace.h	Wed Oct 03 11:11:35 2012 +0100
@@ -44,7 +44,8 @@ static inline void trace_var(u32 event, 
         __trace_var(event, cycles, extra, extra_data);
 }
 
-void __trace_hypercall(unsigned long call, const unsigned long *args);
+void __trace_hypercall(uint32_t event, unsigned long op,
+                       const unsigned long *args);
 
 /* Convenience macros for calling the trace function. */
 #define TRACE_0D(_e)                            \

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

From xen-changelog-bounces@lists.xen.org Wed Oct 03 15:33:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 03 Oct 2012 15: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 1TJQwj-0001Ag-AB; Wed, 03 Oct 2012 15:33:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJQwh-00019b-Rl
	for xen-changelog@lists.xensource.com; Wed, 03 Oct 2012 15:33:12 +0000
Received: from [85.158.143.99:39426] by server-1.bemta-4.messagelabs.com id
	C2/E1-05684-7BA5C605; Wed, 03 Oct 2012 15:33:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1349278389!26289924!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14953 invoked from network); 3 Oct 2012 15:33:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2012 15:33:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJQwe-0002vJ-Ud
	for xen-changelog@lists.xensource.com; Wed, 03 Oct 2012 15:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJQwe-0001ea-NO
	for xen-changelog@lists.xensource.com; Wed, 03 Oct 2012 15:33:08 +0000
Message-Id: <E1TJQwe-0001ea-NO@xenbits.xen.org>
Date: Wed, 03 Oct 2012 15:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] trace: trace hypercalls inside a
	multicall
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User David Vrabel <david.vrabel@citrix.com>
# Date 1349259095 -3600
# Node ID 8bd7dbcb513db86de032ad0226a561eba9a05ab0
# Parent  ffb6e90fee6b4247389203a450aa5d51a4b2bcbe
trace: trace hypercalls inside a multicall

Add a trace record for every hypercall inside a multicall.  These use
a new event ID (with a different sub-class ) so they may be filtered
out if only the calls into hypervisor are of interest.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r ffb6e90fee6b -r 8bd7dbcb513d tools/xentrace/formats
--- a/tools/xentrace/formats	Wed Oct 03 11:11:06 2012 +0100
+++ b/tools/xentrace/formats	Wed Oct 03 11:11:35 2012 +0100
@@ -105,6 +105,7 @@ 0x0020110b  CPU%(cpu)d  %(tsc)d (+%(relt
 0x0020100c  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  ptwr_emulation_pae  [ addr = 0x%(3)08x, eip = 0x%(4)08x, npte = 0x%(2)08x%(1)08x ]
 0x0020110c  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  ptwr_emulation_pae  [ addr = 0x%(4)08x%(3)08x, rip = 0x%(6)08x%(5)08x, npte = 0x%(2)08x%(1)08x ]
 0x0020100d  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  hypercall  [ op = 0x%(1)08x ]
+0x0020200e  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)    hypercall  [ op = 0x%(1)08x ]
 
 0x0040f001  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  shadow_not_shadow                 [ gl1e = 0x%(2)08x%(1)08x, va = 0x%(3)08x, flags = 0x%(4)08x ]
 0x0040f101  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  shadow_not_shadow                 [ gl1e = 0x%(2)08x%(1)08x, va = 0x%(4)08x%(3)08x, flags = 0x%(5)08x ]
diff -r ffb6e90fee6b -r 8bd7dbcb513d tools/xentrace/xentrace_format
--- a/tools/xentrace/xentrace_format	Wed Oct 03 11:11:06 2012 +0100
+++ b/tools/xentrace/xentrace_format	Wed Oct 03 11:11:35 2012 +0100
@@ -112,6 +112,7 @@ last_tsc = [0]
 
 TRC_TRACE_IRQ = 0x1f004
 TRC_PV_HYPERCALL_V2 = 0x20100d
+TRC_PV_HYPERCALL_SUBCALL = 0x20100e
 
 NR_VECTORS = 256
 irq_measure = [{'count':0, 'tot_cycles':0, 'max_cycles':0}] * NR_VECTORS
@@ -199,7 +200,7 @@ while not interrupted:
             d3 = irq_measure[d1]['tot_cycles']
             d4 = irq_measure[d1]['max_cycles']
 
-        if event == TRC_PV_HYPERCALL_V2:
+        if event == TRC_PV_HYPERCALL_V2 or event == TRC_PV_HYPERCALL_SUBCALL:
             # Mask off the argument present bits.
             d1 &= 0x000fffff
 
diff -r ffb6e90fee6b -r 8bd7dbcb513d xen/arch/x86/trace.c
--- a/xen/arch/x86/trace.c	Wed Oct 03 11:11:06 2012 +0100
+++ b/xen/arch/x86/trace.c	Wed Oct 03 11:11:35 2012 +0100
@@ -30,7 +30,7 @@ void trace_hypercall(void)
         args[5] = regs->r9;
     }
 
-    __trace_hypercall(regs->eax, args);
+    __trace_hypercall(TRC_PV_HYPERCALL_V2, regs->eax, args);
 }
 
 void __trace_pv_trap(int trapnr, unsigned long eip,
diff -r ffb6e90fee6b -r 8bd7dbcb513d xen/common/compat/multicall.c
--- a/xen/common/compat/multicall.c	Wed Oct 03 11:11:06 2012 +0100
+++ b/xen/common/compat/multicall.c	Wed Oct 03 11:11:35 2012 +0100
@@ -5,6 +5,7 @@
 #include <xen/config.h>
 #include <xen/types.h>
 #include <xen/multicall.h>
+#include <xen/trace.h>
 
 #define COMPAT
 typedef int ret_t;
@@ -25,6 +26,17 @@ DEFINE_XEN_GUEST_HANDLE(multicall_entry_
 #define do_multicall(l, n)   compat_multicall(_##l, n)
 #define _XEN_GUEST_HANDLE(t) XEN_GUEST_HANDLE(t)
 
+static void __trace_multicall_call(multicall_entry_t *call)
+{
+    unsigned long args[6];
+    int i;
+
+    for ( i = 0; i < ARRAY_SIZE(args); i++ )
+        args[i] = call->args[i];
+
+    __trace_hypercall(TRC_PV_HYPERCALL_SUBCALL, call->op, args);
+}
+
 #include "../multicall.c"
 
 /*
diff -r ffb6e90fee6b -r 8bd7dbcb513d xen/common/multicall.c
--- a/xen/common/multicall.c	Wed Oct 03 11:11:06 2012 +0100
+++ b/xen/common/multicall.c	Wed Oct 03 11:11:35 2012 +0100
@@ -11,14 +11,28 @@
 #include <xen/multicall.h>
 #include <xen/guest_access.h>
 #include <xen/perfc.h>
+#include <xen/trace.h>
 #include <asm/current.h>
 #include <asm/hardirq.h>
 
 #ifndef COMPAT
 typedef long ret_t;
 #define xlat_multicall_entry(mcs)
+
+static void __trace_multicall_call(multicall_entry_t *call)
+{
+    __trace_hypercall(TRC_PV_HYPERCALL_SUBCALL, call->op, call->args);
+}
 #endif
 
+static void trace_multicall_call(multicall_entry_t *call)
+{
+    if ( !tb_init_done )
+        return;
+
+    __trace_multicall_call(call);
+}
+
 ret_t
 do_multicall(
     XEN_GUEST_HANDLE(multicall_entry_t) call_list, unsigned int nr_calls)
@@ -47,6 +61,8 @@ do_multicall(
             break;
         }
 
+        trace_multicall_call(&mcs->call);
+
         do_multicall_call(&mcs->call);
 
 #ifndef NDEBUG
diff -r ffb6e90fee6b -r 8bd7dbcb513d xen/common/trace.c
--- a/xen/common/trace.c	Wed Oct 03 11:11:06 2012 +0100
+++ b/xen/common/trace.c	Wed Oct 03 11:11:35 2012 +0100
@@ -816,7 +816,8 @@ unlock:
         tasklet_schedule(&trace_notify_dom0_tasklet);
 }
 
-void __trace_hypercall(unsigned long op, const unsigned long *args)
+void __trace_hypercall(uint32_t event, unsigned long op,
+                       const unsigned long *args)
 {
     struct {
         uint32_t op;
@@ -864,8 +865,7 @@ void __trace_hypercall(unsigned long op,
         break;
     }
 
-    __trace_var(TRC_PV_HYPERCALL_V2, 1,
-                sizeof(uint32_t) * (1 + (a - d.args)), &d);
+    __trace_var(event, 1, sizeof(uint32_t) * (1 + (a - d.args)), &d);
 }
 
 /*
diff -r ffb6e90fee6b -r 8bd7dbcb513d xen/include/public/trace.h
--- a/xen/include/public/trace.h	Wed Oct 03 11:11:06 2012 +0100
+++ b/xen/include/public/trace.h	Wed Oct 03 11:11:35 2012 +0100
@@ -94,7 +94,8 @@
 #define TRC_MEM_POD_ZERO_RECLAIM    (TRC_MEM + 17)
 #define TRC_MEM_POD_SUPERPAGE_SPLINTER (TRC_MEM + 18)
 
-#define TRC_PV_ENTRY 0x00201000 /* Hypervisor entry points for PV guests. */
+#define TRC_PV_ENTRY   0x00201000 /* Hypervisor entry points for PV guests. */
+#define TRC_PV_SUBCALL 0x00202000 /* Sub-call in a multicall hypercall */
 
 #define TRC_PV_HYPERCALL             (TRC_PV_ENTRY +  1)
 #define TRC_PV_TRAP                  (TRC_PV_ENTRY +  3)
@@ -108,6 +109,7 @@
 #define TRC_PV_PTWR_EMULATION        (TRC_PV_ENTRY + 11)
 #define TRC_PV_PTWR_EMULATION_PAE    (TRC_PV_ENTRY + 12)
 #define TRC_PV_HYPERCALL_V2          (TRC_PV_ENTRY + 13)
+#define TRC_PV_HYPERCALL_SUBCALL     (TRC_PV_SUBCALL + 14)
 
 /*
  * TRC_PV_HYPERCALL_V2 format
diff -r ffb6e90fee6b -r 8bd7dbcb513d xen/include/xen/trace.h
--- a/xen/include/xen/trace.h	Wed Oct 03 11:11:06 2012 +0100
+++ b/xen/include/xen/trace.h	Wed Oct 03 11:11:35 2012 +0100
@@ -44,7 +44,8 @@ static inline void trace_var(u32 event, 
         __trace_var(event, cycles, extra, extra_data);
 }
 
-void __trace_hypercall(unsigned long call, const unsigned long *args);
+void __trace_hypercall(uint32_t event, unsigned long op,
+                       const unsigned long *args);
 
 /* Convenience macros for calling the trace function. */
 #define TRACE_0D(_e)                            \

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

From xen-changelog-bounces@lists.xen.org Wed Oct 03 15:33:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 03 Oct 2012 15: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 1TJQwj-0001Al-Cd; Wed, 03 Oct 2012 15:33:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJQwh-00019a-RH
	for xen-changelog@lists.xensource.com; Wed, 03 Oct 2012 15:33:12 +0000
Received: from [85.158.139.83:59177] by server-14.bemta-5.messagelabs.com id
	11/04-05772-7BA5C605; Wed, 03 Oct 2012 15:33:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1349278388!29304773!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18559 invoked from network); 3 Oct 2012 15:33:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2012 15:33:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJQwe-0002vF-Dn
	for xen-changelog@lists.xensource.com; Wed, 03 Oct 2012 15:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJQwe-0001eL-5k
	for xen-changelog@lists.xensource.com; Wed, 03 Oct 2012 15:33:08 +0000
Message-Id: <E1TJQwe-0001eL-5k@xenbits.xen.org>
Date: Wed, 03 Oct 2012 15:33:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] trace: improve usefulness of
	hypercall trace record
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User David Vrabel <david.vrabel@citrix.com>
# Date 1349259066 -3600
# Node ID ffb6e90fee6b4247389203a450aa5d51a4b2bcbe
# Parent  d7de8495d21cc25e4ff3dbedd4b165d6b6ca0af3
trace: improve usefulness of hypercall trace record

Trace hypercalls using a more useful trace record format.

The EIP field is removed (it was always somewhere in the hypercall
page) and include selected hypercall arguments (e.g., the number of
calls in a multicall, and the number of PTE updates in an mmu_update
etc.).  12 bits in the first extra word are used to indicate which
arguments are present in the record and what size they are (32 or
64-bit).

This is an incompatible record format so a new event ID is used so
tools can distinguish between the two formats.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r d7de8495d21c -r ffb6e90fee6b tools/xentrace/formats
--- a/tools/xentrace/formats	Wed Oct 03 11:10:33 2012 +0100
+++ b/tools/xentrace/formats	Wed Oct 03 11:11:06 2012 +0100
@@ -104,6 +104,7 @@ 0x0020100b  CPU%(cpu)d  %(tsc)d (+%(relt
 0x0020110b  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  ptwr_emulation      [ addr = 0x%(4)08x%(3)08x, rip = 0x%(6)08x%(5)08x, npte = 0x%(2)08x%(1)08x ]
 0x0020100c  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  ptwr_emulation_pae  [ addr = 0x%(3)08x, eip = 0x%(4)08x, npte = 0x%(2)08x%(1)08x ]
 0x0020110c  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  ptwr_emulation_pae  [ addr = 0x%(4)08x%(3)08x, rip = 0x%(6)08x%(5)08x, npte = 0x%(2)08x%(1)08x ]
+0x0020100d  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  hypercall  [ op = 0x%(1)08x ]
 
 0x0040f001  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  shadow_not_shadow                 [ gl1e = 0x%(2)08x%(1)08x, va = 0x%(3)08x, flags = 0x%(4)08x ]
 0x0040f101  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  shadow_not_shadow                 [ gl1e = 0x%(2)08x%(1)08x, va = 0x%(4)08x%(3)08x, flags = 0x%(5)08x ]
diff -r d7de8495d21c -r ffb6e90fee6b tools/xentrace/xentrace_format
--- a/tools/xentrace/xentrace_format	Wed Oct 03 11:10:33 2012 +0100
+++ b/tools/xentrace/xentrace_format	Wed Oct 03 11:11:06 2012 +0100
@@ -111,6 +111,8 @@ D7REC  = "IIIIIII"
 last_tsc = [0]
 
 TRC_TRACE_IRQ = 0x1f004
+TRC_PV_HYPERCALL_V2 = 0x20100d
+
 NR_VECTORS = 256
 irq_measure = [{'count':0, 'tot_cycles':0, 'max_cycles':0}] * NR_VECTORS
 
@@ -197,6 +199,10 @@ while not interrupted:
             d3 = irq_measure[d1]['tot_cycles']
             d4 = irq_measure[d1]['max_cycles']
 
+        if event == TRC_PV_HYPERCALL_V2:
+            # Mask off the argument present bits.
+            d1 &= 0x000fffff
+
         #tsc = (tscH<<32) | tscL
 
         #print i, tsc
diff -r d7de8495d21c -r ffb6e90fee6b xen/arch/x86/trace.c
--- a/xen/arch/x86/trace.c	Wed Oct 03 11:10:33 2012 +0100
+++ b/xen/arch/x86/trace.c	Wed Oct 03 11:11:06 2012 +0100
@@ -9,33 +9,28 @@
 void trace_hypercall(void)
 {
     struct cpu_user_regs *regs = guest_cpu_user_regs();
+    unsigned long args[6];
 
     if ( is_pv_32on64_vcpu(current) )
     {
-        struct {
-            u32 eip,eax;
-        } __attribute__((packed)) d;
-            
-        d.eip = regs->eip;
-        d.eax = regs->eax;
-
-        __trace_var(TRC_PV_HYPERCALL, 1, sizeof(d), &d);
+        args[0] = regs->ebx;
+        args[1] = regs->ecx;
+        args[2] = regs->edx;
+        args[3] = regs->esi;
+        args[4] = regs->edi;
+        args[5] = regs->ebp;
     }
     else
     {
-        struct {
-            unsigned long eip;
-            u32 eax;
-        } __attribute__((packed)) d;
-        u32 event;
+        args[0] = regs->rdi;
+        args[1] = regs->rsi;
+        args[2] = regs->rdx;
+        args[3] = regs->r10;
+        args[4] = regs->r8;
+        args[5] = regs->r9;
+    }
 
-        event = TRC_PV_HYPERCALL;
-        event |= TRC_64_FLAG;
-        d.eip = regs->eip;
-        d.eax = regs->eax;
-
-        __trace_var(event, 1/*tsc*/, sizeof(d), &d);
-    }
+    __trace_hypercall(regs->eax, args);
 }
 
 void __trace_pv_trap(int trapnr, unsigned long eip,
diff -r d7de8495d21c -r ffb6e90fee6b xen/common/trace.c
--- a/xen/common/trace.c	Wed Oct 03 11:10:33 2012 +0100
+++ b/xen/common/trace.c	Wed Oct 03 11:11:06 2012 +0100
@@ -816,6 +816,58 @@ unlock:
         tasklet_schedule(&trace_notify_dom0_tasklet);
 }
 
+void __trace_hypercall(unsigned long op, const unsigned long *args)
+{
+    struct {
+        uint32_t op;
+        uint32_t args[6];
+    } __attribute__((packed)) d;
+    uint32_t *a = d.args;
+
+#define APPEND_ARG32(i)                         \
+    do {                                        \
+        unsigned i_ = (i);                      \
+        *a++ = args[(i_)];                      \
+        d.op |= TRC_PV_HYPERCALL_V2_ARG_32(i_); \
+    } while( 0 )
+
+    /*
+     * This shouldn't happen as @op should be small enough but just in
+     * case, warn if the argument bits in the trace record would
+     * clobber the hypercall op.
+     */
+    WARN_ON(op & TRC_PV_HYPERCALL_V2_ARG_MASK);
+
+    d.op = op;
+
+    switch ( op )
+    {
+    case __HYPERVISOR_mmu_update:
+        APPEND_ARG32(1); /* count */
+        break;
+    case __HYPERVISOR_multicall:
+        APPEND_ARG32(1); /* count */
+        break;
+    case __HYPERVISOR_grant_table_op:
+        APPEND_ARG32(0); /* cmd */
+        APPEND_ARG32(2); /* count */
+        break;
+    case __HYPERVISOR_vcpu_op:
+        APPEND_ARG32(0); /* cmd */
+        APPEND_ARG32(1); /* vcpuid */
+        break;
+    case __HYPERVISOR_mmuext_op:
+        APPEND_ARG32(1); /* count */
+        break;
+    case __HYPERVISOR_sched_op:
+        APPEND_ARG32(0); /* cmd */
+        break;
+    }
+
+    __trace_var(TRC_PV_HYPERCALL_V2, 1,
+                sizeof(uint32_t) * (1 + (a - d.args)), &d);
+}
+
 /*
  * Local variables:
  * mode: C
diff -r d7de8495d21c -r ffb6e90fee6b xen/include/public/trace.h
--- a/xen/include/public/trace.h	Wed Oct 03 11:10:33 2012 +0100
+++ b/xen/include/public/trace.h	Wed Oct 03 11:11:06 2012 +0100
@@ -107,6 +107,36 @@
 #define TRC_PV_GDT_LDT_MAPPING_FAULT (TRC_PV_ENTRY + 10)
 #define TRC_PV_PTWR_EMULATION        (TRC_PV_ENTRY + 11)
 #define TRC_PV_PTWR_EMULATION_PAE    (TRC_PV_ENTRY + 12)
+#define TRC_PV_HYPERCALL_V2          (TRC_PV_ENTRY + 13)
+
+/*
+ * TRC_PV_HYPERCALL_V2 format
+ *
+ * Only some of the hypercall argument are recorded. Bit fields A0 to
+ * A5 in the first extra word are set if the argument is present and
+ * the arguments themselves are packed sequentially in the following
+ * words.
+ *
+ * The TRC_64_FLAG bit is not set for these events (even if there are
+ * 64-bit arguments in the record).
+ *
+ * Word
+ * 0    bit 31 30|29 28|27 26|25 24|23 22|21 20|19 ... 0
+ *          A5   |A4   |A3   |A2   |A1   |A0   |Hypercall op
+ * 1    First 32 bit (or low word of first 64 bit) arg in record
+ * 2    Second 32 bit (or high word of first 64 bit) arg in record
+ * ...
+ *
+ * A0-A5 bitfield values:
+ *
+ *   00b  Argument not present
+ *   01b  32-bit argument present
+ *   10b  64-bit argument present
+ *   11b  Reserved
+ */
+#define TRC_PV_HYPERCALL_V2_ARG_32(i) (0x1 << (20 + 2*(i)))
+#define TRC_PV_HYPERCALL_V2_ARG_64(i) (0x2 << (20 + 2*(i)))
+#define TRC_PV_HYPERCALL_V2_ARG_MASK  (0xfff00000)
 
 #define TRC_SHADOW_NOT_SHADOW                 (TRC_SHADOW +  1)
 #define TRC_SHADOW_FAST_PROPAGATE             (TRC_SHADOW +  2)
diff -r d7de8495d21c -r ffb6e90fee6b xen/include/xen/trace.h
--- a/xen/include/xen/trace.h	Wed Oct 03 11:10:33 2012 +0100
+++ b/xen/include/xen/trace.h	Wed Oct 03 11:11:06 2012 +0100
@@ -44,6 +44,8 @@ static inline void trace_var(u32 event, 
         __trace_var(event, cycles, extra, extra_data);
 }
 
+void __trace_hypercall(unsigned long call, const unsigned long *args);
+
 /* Convenience macros for calling the trace function. */
 #define TRACE_0D(_e)                            \
     do {                                        \

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

From xen-changelog-bounces@lists.xen.org Wed Oct 03 15:33:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 03 Oct 2012 15: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 1TJQwj-0001Al-Cd; Wed, 03 Oct 2012 15:33:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJQwh-00019a-RH
	for xen-changelog@lists.xensource.com; Wed, 03 Oct 2012 15:33:12 +0000
Received: from [85.158.139.83:59177] by server-14.bemta-5.messagelabs.com id
	11/04-05772-7BA5C605; Wed, 03 Oct 2012 15:33:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1349278388!29304773!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18559 invoked from network); 3 Oct 2012 15:33:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2012 15:33:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJQwe-0002vF-Dn
	for xen-changelog@lists.xensource.com; Wed, 03 Oct 2012 15:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJQwe-0001eL-5k
	for xen-changelog@lists.xensource.com; Wed, 03 Oct 2012 15:33:08 +0000
Message-Id: <E1TJQwe-0001eL-5k@xenbits.xen.org>
Date: Wed, 03 Oct 2012 15:33:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] trace: improve usefulness of
	hypercall trace record
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User David Vrabel <david.vrabel@citrix.com>
# Date 1349259066 -3600
# Node ID ffb6e90fee6b4247389203a450aa5d51a4b2bcbe
# Parent  d7de8495d21cc25e4ff3dbedd4b165d6b6ca0af3
trace: improve usefulness of hypercall trace record

Trace hypercalls using a more useful trace record format.

The EIP field is removed (it was always somewhere in the hypercall
page) and include selected hypercall arguments (e.g., the number of
calls in a multicall, and the number of PTE updates in an mmu_update
etc.).  12 bits in the first extra word are used to indicate which
arguments are present in the record and what size they are (32 or
64-bit).

This is an incompatible record format so a new event ID is used so
tools can distinguish between the two formats.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r d7de8495d21c -r ffb6e90fee6b tools/xentrace/formats
--- a/tools/xentrace/formats	Wed Oct 03 11:10:33 2012 +0100
+++ b/tools/xentrace/formats	Wed Oct 03 11:11:06 2012 +0100
@@ -104,6 +104,7 @@ 0x0020100b  CPU%(cpu)d  %(tsc)d (+%(relt
 0x0020110b  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  ptwr_emulation      [ addr = 0x%(4)08x%(3)08x, rip = 0x%(6)08x%(5)08x, npte = 0x%(2)08x%(1)08x ]
 0x0020100c  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  ptwr_emulation_pae  [ addr = 0x%(3)08x, eip = 0x%(4)08x, npte = 0x%(2)08x%(1)08x ]
 0x0020110c  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  ptwr_emulation_pae  [ addr = 0x%(4)08x%(3)08x, rip = 0x%(6)08x%(5)08x, npte = 0x%(2)08x%(1)08x ]
+0x0020100d  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  hypercall  [ op = 0x%(1)08x ]
 
 0x0040f001  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  shadow_not_shadow                 [ gl1e = 0x%(2)08x%(1)08x, va = 0x%(3)08x, flags = 0x%(4)08x ]
 0x0040f101  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  shadow_not_shadow                 [ gl1e = 0x%(2)08x%(1)08x, va = 0x%(4)08x%(3)08x, flags = 0x%(5)08x ]
diff -r d7de8495d21c -r ffb6e90fee6b tools/xentrace/xentrace_format
--- a/tools/xentrace/xentrace_format	Wed Oct 03 11:10:33 2012 +0100
+++ b/tools/xentrace/xentrace_format	Wed Oct 03 11:11:06 2012 +0100
@@ -111,6 +111,8 @@ D7REC  = "IIIIIII"
 last_tsc = [0]
 
 TRC_TRACE_IRQ = 0x1f004
+TRC_PV_HYPERCALL_V2 = 0x20100d
+
 NR_VECTORS = 256
 irq_measure = [{'count':0, 'tot_cycles':0, 'max_cycles':0}] * NR_VECTORS
 
@@ -197,6 +199,10 @@ while not interrupted:
             d3 = irq_measure[d1]['tot_cycles']
             d4 = irq_measure[d1]['max_cycles']
 
+        if event == TRC_PV_HYPERCALL_V2:
+            # Mask off the argument present bits.
+            d1 &= 0x000fffff
+
         #tsc = (tscH<<32) | tscL
 
         #print i, tsc
diff -r d7de8495d21c -r ffb6e90fee6b xen/arch/x86/trace.c
--- a/xen/arch/x86/trace.c	Wed Oct 03 11:10:33 2012 +0100
+++ b/xen/arch/x86/trace.c	Wed Oct 03 11:11:06 2012 +0100
@@ -9,33 +9,28 @@
 void trace_hypercall(void)
 {
     struct cpu_user_regs *regs = guest_cpu_user_regs();
+    unsigned long args[6];
 
     if ( is_pv_32on64_vcpu(current) )
     {
-        struct {
-            u32 eip,eax;
-        } __attribute__((packed)) d;
-            
-        d.eip = regs->eip;
-        d.eax = regs->eax;
-
-        __trace_var(TRC_PV_HYPERCALL, 1, sizeof(d), &d);
+        args[0] = regs->ebx;
+        args[1] = regs->ecx;
+        args[2] = regs->edx;
+        args[3] = regs->esi;
+        args[4] = regs->edi;
+        args[5] = regs->ebp;
     }
     else
     {
-        struct {
-            unsigned long eip;
-            u32 eax;
-        } __attribute__((packed)) d;
-        u32 event;
+        args[0] = regs->rdi;
+        args[1] = regs->rsi;
+        args[2] = regs->rdx;
+        args[3] = regs->r10;
+        args[4] = regs->r8;
+        args[5] = regs->r9;
+    }
 
-        event = TRC_PV_HYPERCALL;
-        event |= TRC_64_FLAG;
-        d.eip = regs->eip;
-        d.eax = regs->eax;
-
-        __trace_var(event, 1/*tsc*/, sizeof(d), &d);
-    }
+    __trace_hypercall(regs->eax, args);
 }
 
 void __trace_pv_trap(int trapnr, unsigned long eip,
diff -r d7de8495d21c -r ffb6e90fee6b xen/common/trace.c
--- a/xen/common/trace.c	Wed Oct 03 11:10:33 2012 +0100
+++ b/xen/common/trace.c	Wed Oct 03 11:11:06 2012 +0100
@@ -816,6 +816,58 @@ unlock:
         tasklet_schedule(&trace_notify_dom0_tasklet);
 }
 
+void __trace_hypercall(unsigned long op, const unsigned long *args)
+{
+    struct {
+        uint32_t op;
+        uint32_t args[6];
+    } __attribute__((packed)) d;
+    uint32_t *a = d.args;
+
+#define APPEND_ARG32(i)                         \
+    do {                                        \
+        unsigned i_ = (i);                      \
+        *a++ = args[(i_)];                      \
+        d.op |= TRC_PV_HYPERCALL_V2_ARG_32(i_); \
+    } while( 0 )
+
+    /*
+     * This shouldn't happen as @op should be small enough but just in
+     * case, warn if the argument bits in the trace record would
+     * clobber the hypercall op.
+     */
+    WARN_ON(op & TRC_PV_HYPERCALL_V2_ARG_MASK);
+
+    d.op = op;
+
+    switch ( op )
+    {
+    case __HYPERVISOR_mmu_update:
+        APPEND_ARG32(1); /* count */
+        break;
+    case __HYPERVISOR_multicall:
+        APPEND_ARG32(1); /* count */
+        break;
+    case __HYPERVISOR_grant_table_op:
+        APPEND_ARG32(0); /* cmd */
+        APPEND_ARG32(2); /* count */
+        break;
+    case __HYPERVISOR_vcpu_op:
+        APPEND_ARG32(0); /* cmd */
+        APPEND_ARG32(1); /* vcpuid */
+        break;
+    case __HYPERVISOR_mmuext_op:
+        APPEND_ARG32(1); /* count */
+        break;
+    case __HYPERVISOR_sched_op:
+        APPEND_ARG32(0); /* cmd */
+        break;
+    }
+
+    __trace_var(TRC_PV_HYPERCALL_V2, 1,
+                sizeof(uint32_t) * (1 + (a - d.args)), &d);
+}
+
 /*
  * Local variables:
  * mode: C
diff -r d7de8495d21c -r ffb6e90fee6b xen/include/public/trace.h
--- a/xen/include/public/trace.h	Wed Oct 03 11:10:33 2012 +0100
+++ b/xen/include/public/trace.h	Wed Oct 03 11:11:06 2012 +0100
@@ -107,6 +107,36 @@
 #define TRC_PV_GDT_LDT_MAPPING_FAULT (TRC_PV_ENTRY + 10)
 #define TRC_PV_PTWR_EMULATION        (TRC_PV_ENTRY + 11)
 #define TRC_PV_PTWR_EMULATION_PAE    (TRC_PV_ENTRY + 12)
+#define TRC_PV_HYPERCALL_V2          (TRC_PV_ENTRY + 13)
+
+/*
+ * TRC_PV_HYPERCALL_V2 format
+ *
+ * Only some of the hypercall argument are recorded. Bit fields A0 to
+ * A5 in the first extra word are set if the argument is present and
+ * the arguments themselves are packed sequentially in the following
+ * words.
+ *
+ * The TRC_64_FLAG bit is not set for these events (even if there are
+ * 64-bit arguments in the record).
+ *
+ * Word
+ * 0    bit 31 30|29 28|27 26|25 24|23 22|21 20|19 ... 0
+ *          A5   |A4   |A3   |A2   |A1   |A0   |Hypercall op
+ * 1    First 32 bit (or low word of first 64 bit) arg in record
+ * 2    Second 32 bit (or high word of first 64 bit) arg in record
+ * ...
+ *
+ * A0-A5 bitfield values:
+ *
+ *   00b  Argument not present
+ *   01b  32-bit argument present
+ *   10b  64-bit argument present
+ *   11b  Reserved
+ */
+#define TRC_PV_HYPERCALL_V2_ARG_32(i) (0x1 << (20 + 2*(i)))
+#define TRC_PV_HYPERCALL_V2_ARG_64(i) (0x2 << (20 + 2*(i)))
+#define TRC_PV_HYPERCALL_V2_ARG_MASK  (0xfff00000)
 
 #define TRC_SHADOW_NOT_SHADOW                 (TRC_SHADOW +  1)
 #define TRC_SHADOW_FAST_PROPAGATE             (TRC_SHADOW +  2)
diff -r d7de8495d21c -r ffb6e90fee6b xen/include/xen/trace.h
--- a/xen/include/xen/trace.h	Wed Oct 03 11:10:33 2012 +0100
+++ b/xen/include/xen/trace.h	Wed Oct 03 11:11:06 2012 +0100
@@ -44,6 +44,8 @@ static inline void trace_var(u32 event, 
         __trace_var(event, cycles, extra, extra_data);
 }
 
+void __trace_hypercall(unsigned long call, const unsigned long *args);
+
 /* Convenience macros for calling the trace function. */
 #define TRACE_0D(_e)                            \
     do {                                        \

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

From xen-changelog-bounces@lists.xen.org Thu Oct 04 00:55:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 04 Oct 2012 00: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 1TJZid-0002KL-Pu; Thu, 04 Oct 2012 00:55:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJZic-0002KG-DO
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 00:55:14 +0000
Received: from [85.158.138.51:36593] by server-1.bemta-3.messagelabs.com id
	7D/EE-16425-17EDC605; Thu, 04 Oct 2012 00:55:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1349312111!32927586!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17514 invoked from network); 4 Oct 2012 00:55:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2012 00:55:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJZiZ-0001Xk-0y
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 00:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJZiY-0007St-Gs
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 00:55:10 +0000
Message-Id: <E1TJZiY-0007St-Gs@xenbits.xen.org>
Date: Thu, 04 Oct 2012 00:55:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] MAINTAINERS: Move and fix up VTPM
	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

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1349265570 -3600
# Node ID 572821a5682bbad552fb597194752b882ca12fae
# Parent  59dc1c2e7c54315f6442cca48bb7b7486612e84e
MAINTAINERS: Move and fix up VTPM entry

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


diff -r 59dc1c2e7c54 -r 572821a5682b MAINTAINERS
--- a/MAINTAINERS	Wed Oct 03 11:13:54 2012 +0100
+++ b/MAINTAINERS	Wed Oct 03 12:59:30 2012 +0100
@@ -242,6 +242,21 @@ S:	Supported
 T:	hg http://xenbits.xen.org/linux-2.6.18-xen.hg
 F:	drivers/xen/usb*/
 
+VTPM
+M:	Matthew Fioravante <matthew.fioravante@jhuapl.edu>
+S:	Supported
+F:	extras/minios-os/tpmfront.c
+F:	extras/minios-os/tpmback.c
+F:	extras/minios-os/tpm-tis.c
+F:	extras/minios-os/include/tpmfront.h
+F:	extras/minios-os/include/tpmback.h
+F:	extras/minios-os/include/tpm-tis.h
+F:	tools/vtpm/
+F:	tools/vtpm_manager/
+F:	stubdom/vtpm/
+F:	stubdom/vtpmmgr/
+F:	docs/misc/vtpm.txt
+
 X86 ARCHITECTURE
 M:	Keir Fraser <keir@xen.org>
 M:	Jan Beulich <jbeulich@suse.com>
@@ -261,21 +276,6 @@ S:	Supported
 F:	tools/xentrace/
 F:	xen/common/trace.c
 
-VTPM
-M:	Matthew Fioravante <matthew.fioravante@jhuapl.edu>
-S:	Supported
-F:	tools/vtpm
-F:	tools/vtpm_manager
-F:	extras/minios-os/tpmfront.c
-F:	extras/minios-os/tpmback.c
-F:	extras/minios-os/tpm-tis.c
-F:	extras/minios-os/include/tpmfront.h
-F:	extras/minios-os/include/tpmback.h
-F:	extras/minios-os/include/tpm-tis.h
-F:	stubdom/vtpm
-F:	stubdom/vtpmmgr
-F:	docs/misc/vtpm.txt
-
 THE REST
 M:	Keir Fraser <keir@xen.org>
 L:	xen-devel@lists.xen.org

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

From xen-changelog-bounces@lists.xen.org Thu Oct 04 00:55:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 04 Oct 2012 00: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 1TJZid-0002KL-Pu; Thu, 04 Oct 2012 00:55:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJZic-0002KG-DO
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 00:55:14 +0000
Received: from [85.158.138.51:36593] by server-1.bemta-3.messagelabs.com id
	7D/EE-16425-17EDC605; Thu, 04 Oct 2012 00:55:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1349312111!32927586!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17514 invoked from network); 4 Oct 2012 00:55:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2012 00:55:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJZiZ-0001Xk-0y
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 00:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJZiY-0007St-Gs
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 00:55:10 +0000
Message-Id: <E1TJZiY-0007St-Gs@xenbits.xen.org>
Date: Thu, 04 Oct 2012 00:55:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] MAINTAINERS: Move and fix up VTPM
	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

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1349265570 -3600
# Node ID 572821a5682bbad552fb597194752b882ca12fae
# Parent  59dc1c2e7c54315f6442cca48bb7b7486612e84e
MAINTAINERS: Move and fix up VTPM entry

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


diff -r 59dc1c2e7c54 -r 572821a5682b MAINTAINERS
--- a/MAINTAINERS	Wed Oct 03 11:13:54 2012 +0100
+++ b/MAINTAINERS	Wed Oct 03 12:59:30 2012 +0100
@@ -242,6 +242,21 @@ S:	Supported
 T:	hg http://xenbits.xen.org/linux-2.6.18-xen.hg
 F:	drivers/xen/usb*/
 
+VTPM
+M:	Matthew Fioravante <matthew.fioravante@jhuapl.edu>
+S:	Supported
+F:	extras/minios-os/tpmfront.c
+F:	extras/minios-os/tpmback.c
+F:	extras/minios-os/tpm-tis.c
+F:	extras/minios-os/include/tpmfront.h
+F:	extras/minios-os/include/tpmback.h
+F:	extras/minios-os/include/tpm-tis.h
+F:	tools/vtpm/
+F:	tools/vtpm_manager/
+F:	stubdom/vtpm/
+F:	stubdom/vtpmmgr/
+F:	docs/misc/vtpm.txt
+
 X86 ARCHITECTURE
 M:	Keir Fraser <keir@xen.org>
 M:	Jan Beulich <jbeulich@suse.com>
@@ -261,21 +276,6 @@ S:	Supported
 F:	tools/xentrace/
 F:	xen/common/trace.c
 
-VTPM
-M:	Matthew Fioravante <matthew.fioravante@jhuapl.edu>
-S:	Supported
-F:	tools/vtpm
-F:	tools/vtpm_manager
-F:	extras/minios-os/tpmfront.c
-F:	extras/minios-os/tpmback.c
-F:	extras/minios-os/tpm-tis.c
-F:	extras/minios-os/include/tpmfront.h
-F:	extras/minios-os/include/tpmback.h
-F:	extras/minios-os/include/tpm-tis.h
-F:	stubdom/vtpm
-F:	stubdom/vtpmmgr
-F:	docs/misc/vtpm.txt
-
 THE REST
 M:	Keir Fraser <keir@xen.org>
 L:	xen-devel@lists.xen.org

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

From xen-changelog-bounces@lists.xen.org Thu Oct 04 09:22:13 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 04 Oct 2012 09: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 1TJhdC-0005iE-8a; Thu, 04 Oct 2012 09:22:10 +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 1TJhdA-0005i9-Ht
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 09:22:09 +0000
Received: from [85.158.139.83:52060] by server-4.bemta-5.messagelabs.com id
	27/9E-20767-F355D605; Thu, 04 Oct 2012 09:22:07 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-182.messagelabs.com!1349342524!28833613!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21951 invoked from network); 4 Oct 2012 09:22:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2012 09:22: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 1TJhd6-00088f-FA
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 09:22:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJhd6-0003Zc-4x
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 09:22:04 +0000
Message-Id: <E1TJhd6-0003Zc-4x@xenbits.xen.org>
Date: Thu, 04 Oct 2012 09:22:03 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] sync Xen public headers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3802705711577480233=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1349341984 -7200
# Node ID 480fbb0fc4b54af94c5682fadb737c9df8af57ef
# Parent  f91e59ea970843355ab682d41c2181c1d5ec8850
sync Xen public headers

(without dropping ia64 bits)
---


diff -r f91e59ea9708 -r 480fbb0fc4b5 include/xen/interface/arch-arm.h
--- a/include/xen/interface/arch-arm.h	Wed Sep 26 11:36:23 2012 +0200
+++ b/include/xen/interface/arch-arm.h	Thu Oct 04 11:13:04 2012 +0200
@@ -42,8 +42,10 @@
  *
  * The return value is in r0.
  *
- * The hypercall will always clobber r0, r1, r2, r3, r4 and r12,
- * regardless of how many arguments the particular hypercall takes.
+ * The hypercall will clobber r12 and the argument registers used by
+ * that hypercall (except r0 which is the return value) i.e. a 2
+ * argument hypercall will clobber r1 and a 4 argument hypercall will
+ * clobber r1, r2 and r3.
  *
  */
 
@@ -124,15 +126,9 @@ typedef uint32_t xen_ulong_t;
 
 struct vcpu_guest_context {
     struct cpu_user_regs user_regs;         /* User-level CPU registers     */
-    union {
-        uint32_t reg[16];
-        struct {
-            uint32_t __pad[12];
-            uint32_t sp; /* r13 */
-            uint32_t lr; /* r14 */
-            uint32_t pc; /* r15 */
-        };
-    };
+
+    uint32_t sctlr;
+    uint32_t ttbr0, ttbr1, ttbcr;
 };
 typedef struct vcpu_guest_context vcpu_guest_context_t;
 DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t);
@@ -144,7 +140,28 @@ struct arch_shared_info { };
 typedef struct arch_shared_info arch_shared_info_t;
 typedef uint64_t xen_callback_t;
 
-#endif
+#endif /* ifndef __ASSEMBLY __ */
+
+/* PSR bits (CPSR, SPSR)*/
+
+/* 0-4: Mode */
+#define PSR_MODE_MASK 0x1f
+#define PSR_MODE_USR 0x10
+#define PSR_MODE_FIQ 0x11
+#define PSR_MODE_IRQ 0x12
+#define PSR_MODE_SVC 0x13
+#define PSR_MODE_MON 0x16
+#define PSR_MODE_ABT 0x17
+#define PSR_MODE_HYP 0x1a
+#define PSR_MODE_UND 0x1b
+#define PSR_MODE_SYS 0x1f
+
+#define PSR_THUMB       (1<<5)        /* Thumb Mode enable */
+#define PSR_FIQ_MASK    (1<<6)        /* Fast Interrupt mask */
+#define PSR_IRQ_MASK    (1<<7)        /* Interrupt mask */
+#define PSR_ABT_MASK    (1<<8)        /* Asynchronous Abort mask */
+#define PSR_BIG_ENDIAN  (1<<9)        /* Big Endian Mode */
+#define PSR_JAZELLE     (1<<24)       /* Jazelle Mode */
 
 #endif /*  __XEN_PUBLIC_ARCH_ARM_H__ */
 
diff -r f91e59ea9708 -r 480fbb0fc4b5 include/xen/interface/arch-x86/hvm/save.h
--- a/include/xen/interface/arch-x86/hvm/save.h	Wed Sep 26 11:36:23 2012 +0200
+++ b/include/xen/interface/arch-x86/hvm/save.h	Thu Oct 04 11:13:04 2012 +0200
@@ -577,13 +577,21 @@ DECLARE_HVM_SAVE_TYPE(VIRIDIAN_VCPU, 17,
 
 struct hvm_vmce_vcpu {
     uint64_t caps;
+    uint64_t mci_ctl2_bank0;
+    uint64_t mci_ctl2_bank1;
 };
 
 DECLARE_HVM_SAVE_TYPE(VMCE_VCPU, 18, struct hvm_vmce_vcpu);
 
+struct hvm_tsc_adjust {
+    uint64_t tsc_adjust;
+};
+
+DECLARE_HVM_SAVE_TYPE(TSC_ADJUST, 19, struct hvm_tsc_adjust);
+
 /* 
  * Largest type-code in use
  */
-#define HVM_SAVE_CODE_MAX 18
+#define HVM_SAVE_CODE_MAX 19
 
 #endif /* __XEN_PUBLIC_HVM_SAVE_X86_H__ */
diff -r f91e59ea9708 -r 480fbb0fc4b5 include/xen/interface/arch-x86/xen-x86_32.h
--- a/include/xen/interface/arch-x86/xen-x86_32.h	Wed Sep 26 11:36:23 2012 +0200
+++ b/include/xen/interface/arch-x86/xen-x86_32.h	Thu Oct 04 11:13:04 2012 +0200
@@ -29,7 +29,7 @@
 
 /*
  * Hypercall interface:
- *  Input:  %ebx, %ecx, %edx, %esi, %edi (arguments 1-5)
+ *  Input:  %ebx, %ecx, %edx, %esi, %edi, %ebp (arguments 1-6)
  *  Output: %eax
  * Access is via hypercall page (set up by guest loader or via a Xen MSR):
  *  call hypercall_page + hypercall-number * 32
diff -r f91e59ea9708 -r 480fbb0fc4b5 include/xen/interface/arch-x86/xen-x86_64.h
--- a/include/xen/interface/arch-x86/xen-x86_64.h	Wed Sep 26 11:36:23 2012 +0200
+++ b/include/xen/interface/arch-x86/xen-x86_64.h	Thu Oct 04 11:13:04 2012 +0200
@@ -29,7 +29,7 @@
 
 /*
  * Hypercall interface:
- *  Input:  %rdi, %rsi, %rdx, %r10, %r8 (arguments 1-5)
+ *  Input:  %rdi, %rsi, %rdx, %r10, %r8, %r9 (arguments 1-6)
  *  Output: %rax
  * Access is via hypercall page (set up by guest loader or via a Xen MSR):
  *  call hypercall_page + hypercall-number * 32
diff -r f91e59ea9708 -r 480fbb0fc4b5 include/xen/interface/arch-x86/xen.h
--- a/include/xen/interface/arch-x86/xen.h	Wed Sep 26 11:36:23 2012 +0200
+++ b/include/xen/interface/arch-x86/xen.h	Thu Oct 04 11:13:04 2012 +0200
@@ -65,6 +65,11 @@ typedef unsigned long xen_pfn_t;
  * SEGMENT DESCRIPTOR TABLES
  */
 /*
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_set_gdt(const xen_pfn_t frames[], unsigned int entries);
+ * `
+ */
+/*
  * A number of GDT entries are reserved by Xen. These are not situated at the
  * start of the GDT because some stupid OSes export hard-coded selector values
  * in their ABI. These hard-coded values are always near the start of the GDT,
@@ -83,6 +88,13 @@ typedef unsigned long xen_ulong_t;
 
 /*
  * ` enum neg_errnoval
+ * ` HYPERVISOR_stack_switch(unsigned long ss, unsigned long esp);
+ * `
+ * Sets the stack segment and pointer for the current vcpu.
+ */
+
+/*
+ * ` enum neg_errnoval
  * ` HYPERVISOR_set_trap_table(const struct trap_info traps[]);
  * `
  */
@@ -183,6 +195,24 @@ typedef struct arch_shared_info arch_sha
 #endif /* !__ASSEMBLY__ */
 
 /*
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_fpu_taskswitch(int set);
+ * `
+ * Sets (if set!=0) or clears (if set==0) CR0.TS.
+ */
+
+/*
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_set_debugreg(int regno, unsigned long value);
+ *
+ * ` unsigned long
+ * ` HYPERVISOR_get_debugreg(int regno);
+ * For 0<=reg<=7, returns the debug register value.
+ * For other values of reg, returns ((unsigned long)-EINVAL).
+ * (Unfortunately, this interface is defective.)
+ */
+
+/*
  * Prefix forces emulation of some non-trapping instructions.
  * Currently only CPUID.
  */
diff -r f91e59ea9708 -r 480fbb0fc4b5 include/xen/interface/arch-x86_64.h
--- a/include/xen/interface/arch-x86_64.h	Wed Sep 26 11:36:23 2012 +0200
+++ b/include/xen/interface/arch-x86_64.h	Thu Oct 04 11:13:04 2012 +0200
@@ -25,3 +25,19 @@
  */
 
 #include "arch-x86/xen.h"
+
+/*
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_set_callbacks(unsigned long event_selector,
+ * `                          unsigned long event_address,
+ * `                          unsigned long failsafe_selector,
+ * `                          unsigned long failsafe_address);
+ * `
+ * Register for callbacks on events.  When an event (from an event
+ * channel) occurs, event_address is used as the value of eip.
+ *
+ * A similar callback occurs if the segment selectors are invalid.
+ * failsafe_address is used as the value of eip.
+ *
+ * On x86_64, event_selector and failsafe_selector are ignored (???).
+ */
diff -r f91e59ea9708 -r 480fbb0fc4b5 include/xen/interface/domctl.h
--- a/include/xen/interface/domctl.h	Wed Sep 26 11:36:23 2012 +0200
+++ b/include/xen/interface/domctl.h	Thu Oct 04 11:13:04 2012 +0200
@@ -32,6 +32,7 @@
 #error "domctl operations are intended for use by node control tools only"
 #endif
 
+#include <xen/hvm/save.h>
 #include "xen.h"
 #include "grant_table.h"
 
@@ -571,7 +572,14 @@ struct xen_domctl_ext_vcpucontext {
     uint16_t         sysenter_callback_cs;
     uint8_t          syscall32_disables_events;
     uint8_t          sysenter_disables_events;
-    uint64_aligned_t mcg_cap;
+#if defined(__GNUC__)
+    union {
+        uint64_aligned_t mcg_cap;
+        struct hvm_vmce_vcpu vmce;
+    };
+#else
+    struct hvm_vmce_vcpu vmce;
+#endif
 #endif
 };
 typedef struct xen_domctl_ext_vcpucontext xen_domctl_ext_vcpucontext_t;
@@ -716,6 +724,13 @@ struct xen_domctl_gdbsx_domstatus {
  * Domctl interface to set up and tear down the 
  * pager<->hypervisor interface. Use XENMEM_paging_op*
  * to perform per-page operations.
+ *
+ * The XEN_DOMCTL_MEM_EVENT_OP_PAGING_ENABLE domctl returns several
+ * non-standard error codes to indicate why paging could not be enabled:
+ * ENODEV - host lacks HAP support (EPT/NPT) or HAP is disabled in guest
+ * EMLINK - guest has iommu passthrough enabled
+ * EXDEV  - guest has PoD enabled
+ * EBUSY  - guest has or had paging enabled, ring buffer still active
  */
 #define XEN_DOMCTL_MEM_EVENT_OP_PAGING            1
 
@@ -735,6 +750,11 @@ struct xen_domctl_gdbsx_domstatus {
  *
  * The memory event handler can then resume the VCPU and redo the access 
  * with a XENMEM_access_op_resume hypercall.
+ *
+ * The XEN_DOMCTL_MEM_EVENT_OP_ACCESS_ENABLE domctl returns several
+ * non-standard error codes to indicate why access could not be enabled:
+ * ENODEV - host lacks HAP support (EPT/NPT) or HAP is disabled in guest
+ * EBUSY  - guest has or had access enabled, ring buffer still active
  */
 #define XEN_DOMCTL_MEM_EVENT_OP_ACCESS            2
 
diff -r f91e59ea9708 -r 480fbb0fc4b5 include/xen/interface/grant_table.h
--- a/include/xen/interface/grant_table.h	Wed Sep 26 11:36:23 2012 +0200
+++ b/include/xen/interface/grant_table.h	Thu Oct 04 11:13:04 2012 +0200
@@ -1,9 +1,9 @@
 /******************************************************************************
  * grant_table.h
- * 
+ *
  * Interface for granting foreign access to page frames, and receiving
  * page-ownership transfers.
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
  * deal in the Software without restriction, including without limitation the
@@ -30,17 +30,41 @@
 
 #include "xen.h"
 
+/*
+ * `incontents 150 gnttab Grant Tables
+ *
+ * Xen's grant tables provide a generic mechanism to memory sharing
+ * between domains. This shared memory interface underpins the split
+ * device drivers for block and network IO.
+ *
+ * Each domain has its own grant table. This is a data structure that
+ * is shared with Xen; it allows the domain to tell Xen what kind of
+ * permissions other domains have on its pages. Entries in the grant
+ * table are identified by grant references. A grant reference is an
+ * integer, which indexes into the grant table. It acts as a
+ * capability which the grantee can use to perform operations on the
+ * granter’s memory.
+ *
+ * This capability-based system allows shared-memory communications
+ * between unprivileged domains. A grant reference also encapsulates
+ * the details of a shared page, removing the need for a domain to
+ * know the real machine address of a page it is sharing. This makes
+ * it possible to share memory correctly with domains running in
+ * fully virtualised memory.
+ */
+
 /***********************************
  * GRANT TABLE REPRESENTATION
  */
 
 /* Some rough guidelines on accessing and updating grant-table entries
  * in a concurrency-safe manner. For more information, Linux contains a
- * reference implementation for guest OSes (arch/xen/kernel/grant_table.c).
- * 
+ * reference implementation for guest OSes (drivers/xen/grant_table.c, see
+ * http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=drivers/xen/grant-table.c;hb=HEAD
+ *
  * NB. WMB is a no-op on current-generation x86 processors. However, a
  *     compiler barrier will still be required.
- * 
+ *
  * Introducing a valid entry into the grant table:
  *  1. Write ent->domid.
  *  2. Write ent->frame:
@@ -49,7 +73,7 @@
  *                           frame, or zero if none.
  *  3. Write memory barrier (WMB).
  *  4. Write ent->flags, inc. valid type.
- * 
+ *
  * Invalidating an unused GTF_permit_access entry:
  *  1. flags = ent->flags.
  *  2. Observe that !(flags & (GTF_reading|GTF_writing)).
@@ -61,7 +85,7 @@
  *  This cannot be done directly. Request assistance from the domain controller
  *  which can set a timeout on the use of a grant entry and take necessary
  *  action. (NB. This is not yet implemented!).
- * 
+ *
  * Invalidating an unused GTF_accept_transfer entry:
  *  1. flags = ent->flags.
  *  2. Observe that !(flags & GTF_transfer_committed). [*]
@@ -79,7 +103,7 @@
  *
  * Changing a GTF_permit_access from writable to read-only:
  *  Use SMP-safe CMPXCHG to set GTF_readonly, while checking !GTF_writing.
- * 
+ *
  * Changing a GTF_permit_access from read-only to writable:
  *  Use SMP-safe bit-setting instruction.
  */
@@ -261,6 +285,33 @@ typedef uint16_t grant_status_t;
  * GRANT TABLE QUERIES AND USES
  */
 
+/* ` enum neg_errnoval
+ * ` HYPERVISOR_grant_table_op(enum grant_table_op cmd,
+ * `                           void *args,
+ * `                           unsigned int count)
+ * `
+ *
+ * @args points to an array of a per-command data structure. The array
+ * has @count members
+ */
+
+/* ` enum grant_table_op { // GNTTABOP_* => struct gnttab_* */
+#define GNTTABOP_map_grant_ref        0
+#define GNTTABOP_unmap_grant_ref      1
+#define GNTTABOP_setup_table          2
+#define GNTTABOP_dump_table           3
+#define GNTTABOP_transfer             4
+#define GNTTABOP_copy                 5
+#define GNTTABOP_query_size           6
+#define GNTTABOP_unmap_and_replace    7
+#if __XEN_INTERFACE_VERSION__ >= 0x0003020a
+#define GNTTABOP_set_version          8
+#define GNTTABOP_get_status_frames    9
+#define GNTTABOP_get_version          10
+#define GNTTABOP_swap_grant_ref	      11
+#endif /* __XEN_INTERFACE_VERSION__ */
+/* ` } */
+
 /*
  * Handle to track a mapping created via a grant reference.
  */
@@ -277,13 +328,12 @@ typedef uint32_t grant_handle_t;
  *  2. If GNTMAP_host_map is specified then a mapping will be added at
  *     either a host virtual address in the current address space, or at
  *     a PTE at the specified machine address.  The type of mapping to
- *     perform is selected through the GNTMAP_contains_pte flag, and the 
+ *     perform is selected through the GNTMAP_contains_pte flag, and the
  *     address is specified in <host_addr>.
  *  3. Mappings should only be destroyed via GNTTABOP_unmap_grant_ref. If a
  *     host mapping is destroyed by other means then it is *NOT* guaranteed
  *     to be accounted to the correct grant reference!
  */
-#define GNTTABOP_map_grant_ref        0
 struct gnttab_map_grant_ref {
     /* IN parameters. */
     uint64_t host_addr;
@@ -291,7 +341,7 @@ struct gnttab_map_grant_ref {
     grant_ref_t ref;
     domid_t  dom;
     /* OUT parameters. */
-    int16_t  status;              /* GNTST_* */
+    int16_t  status;              /* => enum grant_status */
     grant_handle_t handle;
     uint64_t dev_bus_addr;
 };
@@ -309,14 +359,13 @@ DEFINE_XEN_GUEST_HANDLE(gnttab_map_grant
  *  3. After executing a batch of unmaps, it is guaranteed that no stale
  *     mappings will remain in the device or host TLBs.
  */
-#define GNTTABOP_unmap_grant_ref      1
 struct gnttab_unmap_grant_ref {
     /* IN parameters. */
     uint64_t host_addr;
     uint64_t dev_bus_addr;
     grant_handle_t handle;
     /* OUT parameters. */
-    int16_t  status;              /* GNTST_* */
+    int16_t  status;              /* => enum grant_status */
 };
 typedef struct gnttab_unmap_grant_ref gnttab_unmap_grant_ref_t;
 DEFINE_XEN_GUEST_HANDLE(gnttab_unmap_grant_ref_t);
@@ -330,13 +379,12 @@ DEFINE_XEN_GUEST_HANDLE(gnttab_unmap_gra
  *  2. Only a sufficiently-privileged domain may specify <dom> != DOMID_SELF.
  *  3. Xen may not support more than a single grant-table page per domain.
  */
-#define GNTTABOP_setup_table          2
 struct gnttab_setup_table {
     /* IN parameters. */
     domid_t  dom;
     uint32_t nr_frames;
     /* OUT parameters. */
-    int16_t  status;              /* GNTST_* */
+    int16_t  status;              /* => enum grant_status */
     XEN_GUEST_HANDLE(ulong) frame_list;
 };
 typedef struct gnttab_setup_table gnttab_setup_table_t;
@@ -346,12 +394,11 @@ DEFINE_XEN_GUEST_HANDLE(gnttab_setup_tab
  * GNTTABOP_dump_table: Dump the contents of the grant table to the
  * xen console. Debugging use only.
  */
-#define GNTTABOP_dump_table           3
 struct gnttab_dump_table {
     /* IN parameters. */
     domid_t dom;
     /* OUT parameters. */
-    int16_t status;               /* GNTST_* */
+    int16_t status;               /* => enum grant_status */
 };
 typedef struct gnttab_dump_table gnttab_dump_table_t;
 DEFINE_XEN_GUEST_HANDLE(gnttab_dump_table_t);
@@ -360,11 +407,10 @@ DEFINE_XEN_GUEST_HANDLE(gnttab_dump_tabl
  * GNTTABOP_transfer_grant_ref: Transfer <frame> to a foreign domain. The
  * foreign domain has previously registered its interest in the transfer via
  * <domid, ref>.
- * 
+ *
  * Note that, even if the transfer fails, the specified page no longer belongs
  * to the calling domain *unless* the error is GNTST_bad_page.
  */
-#define GNTTABOP_transfer                4
 struct gnttab_transfer {
     /* IN parameters. */
     xen_pfn_t     mfn;
@@ -400,10 +446,9 @@ DEFINE_XEN_GUEST_HANDLE(gnttab_transfer_
 #define _GNTCOPY_dest_gref        (1)
 #define GNTCOPY_dest_gref         (1<<_GNTCOPY_dest_gref)
 #define _GNTCOPY_can_fail         (2)
-#define GNTCOPY_can_fail          (1<<_GNTCOPY_can_fail) 
+#define GNTCOPY_can_fail          (1<<_GNTCOPY_can_fail)
 
-#define GNTTABOP_copy                 5
-typedef struct gnttab_copy {
+struct gnttab_copy {
     /* IN parameters. */
     struct {
         union {
@@ -417,7 +462,8 @@ typedef struct gnttab_copy {
     uint16_t      flags;          /* GNTCOPY_* */
     /* OUT parameters. */
     int16_t       status;
-} gnttab_copy_t;
+};
+typedef struct gnttab_copy  gnttab_copy_t;
 DEFINE_XEN_GUEST_HANDLE(gnttab_copy_t);
 
 /*
@@ -427,14 +473,13 @@ DEFINE_XEN_GUEST_HANDLE(gnttab_copy_t);
  *  1. <dom> may be specified as DOMID_SELF.
  *  2. Only a sufficiently-privileged domain may specify <dom> != DOMID_SELF.
  */
-#define GNTTABOP_query_size           6
 struct gnttab_query_size {
     /* IN parameters. */
     domid_t  dom;
     /* OUT parameters. */
     uint32_t nr_frames;
     uint32_t max_nr_frames;
-    int16_t  status;              /* GNTST_* */
+    int16_t  status;              /* => enum grant_status */
 };
 typedef struct gnttab_query_size gnttab_query_size_t;
 DEFINE_XEN_GUEST_HANDLE(gnttab_query_size_t);
@@ -450,14 +495,13 @@ DEFINE_XEN_GUEST_HANDLE(gnttab_query_siz
  *  2. After executing a batch of unmaps, it is guaranteed that no stale
  *     mappings will remain in the device or host TLBs.
  */
-#define GNTTABOP_unmap_and_replace    7
 struct gnttab_unmap_and_replace {
     /* IN parameters. */
     uint64_t host_addr;
     uint64_t new_addr;
     grant_handle_t handle;
     /* OUT parameters. */
-    int16_t  status;              /* GNTST_* */
+    int16_t  status;              /* => enum grant_status */
 };
 typedef struct gnttab_unmap_and_replace gnttab_unmap_and_replace_t;
 DEFINE_XEN_GUEST_HANDLE(gnttab_unmap_and_replace_t);
@@ -470,7 +514,6 @@ DEFINE_XEN_GUEST_HANDLE(gnttab_unmap_and
  * are activated; otherwise, the domain will be stuck with version 1.
  * The only defined versions are 1 and 2.
  */
-#define GNTTABOP_set_version          8
 struct gnttab_set_version {
     /* IN/OUT parameters */
     uint32_t version;
@@ -491,13 +534,12 @@ DEFINE_XEN_GUEST_HANDLE(gnttab_set_versi
  *  1. <dom> may be specified as DOMID_SELF.
  *  2. Only a sufficiently-privileged domain may specify <dom> != DOMID_SELF.
  */
-#define GNTTABOP_get_status_frames     9
 struct gnttab_get_status_frames {
     /* IN parameters. */
     uint32_t nr_frames;
     domid_t  dom;
     /* OUT parameters. */
-    int16_t  status;              /* GNTST_* */
+    int16_t  status;              /* => enum grant_status */
     XEN_GUEST_HANDLE(uint64_t) frame_list;
 };
 typedef struct gnttab_get_status_frames gnttab_get_status_frames_t;
@@ -507,7 +549,6 @@ DEFINE_XEN_GUEST_HANDLE(gnttab_get_statu
  * GNTTABOP_get_version: Get the grant table version which is in
  * effect for domain <dom>.
  */
-#define GNTTABOP_get_version          10
 struct gnttab_get_version {
     /* IN parameters */
     domid_t dom;
@@ -518,16 +559,15 @@ struct gnttab_get_version {
 typedef struct gnttab_get_version gnttab_get_version_t;
 DEFINE_XEN_GUEST_HANDLE(gnttab_get_version_t);
 
-/* 
+/*
  * GNTTABOP_swap_grant_ref: Swap the contents of two grant entries.
  */
-#define GNTTABOP_swap_grant_ref	      11
 struct gnttab_swap_grant_ref {
     /* IN parameters */
     grant_ref_t ref_a;
     grant_ref_t ref_b;
     /* OUT parameters */
-    int16_t status;             /* GNTST_* */
+    int16_t status;             /* => enum grant_status */
 };
 typedef struct gnttab_swap_grant_ref gnttab_swap_grant_ref_t;
 DEFINE_XEN_GUEST_HANDLE(gnttab_swap_grant_ref_t);
@@ -575,6 +615,7 @@ DEFINE_XEN_GUEST_HANDLE(gnttab_swap_gran
 /*
  * Values for error status returns. All errors are -ve.
  */
+/* ` enum grant_status { */
 #define GNTST_okay             (0)  /* Normal return.                        */
 #define GNTST_general_error    (-1) /* General undefined error.              */
 #define GNTST_bad_domain       (-2) /* Unrecognsed domain id.                */
@@ -588,6 +629,7 @@ DEFINE_XEN_GUEST_HANDLE(gnttab_swap_gran
 #define GNTST_bad_copy_arg    (-10) /* copy arguments cross page boundary.   */
 #define GNTST_address_too_big (-11) /* transfer page address too large.      */
 #define GNTST_eagain          (-12) /* Operation not done; try again.        */
+/* ` } */
 
 #define GNTTABOP_error_msgs {                   \
     "okay",                                     \
diff -r f91e59ea9708 -r 480fbb0fc4b5 include/xen/interface/hvm/hvm_op.h
--- a/include/xen/interface/hvm/hvm_op.h	Wed Sep 26 11:36:23 2012 +0200
+++ b/include/xen/interface/hvm/hvm_op.h	Thu Oct 04 11:13:04 2012 +0200
@@ -217,10 +217,21 @@ struct xen_hvm_inject_trap {
     domid_t domid;
     /* VCPU */
     uint32_t vcpuid;
-    /* Trap number */
-    uint32_t trap;
-    /* Error code, or -1 to skip */
+    /* Vector number */
+    uint32_t vector;
+    /* Trap type (HVMOP_TRAP_*) */
+    uint32_t type;
+/* NB. This enumeration precisely matches hvm.h:X86_EVENTTYPE_* */
+# define HVMOP_TRAP_ext_int    0 /* external interrupt */
+# define HVMOP_TRAP_nmi        2 /* nmi */
+# define HVMOP_TRAP_hw_exc     3 /* hardware exception */
+# define HVMOP_TRAP_sw_int     4 /* software interrupt (CD nn) */
+# define HVMOP_TRAP_pri_sw_exc 5 /* ICEBP (F1) */
+# define HVMOP_TRAP_sw_exc     6 /* INT3 (CC), INTO (CE) */
+    /* Error code, or ~0u to skip */
     uint32_t error_code;
+    /* Intruction length */
+    uint32_t insn_len;
     /* CR2 for page faults */
     uint64_aligned_t cr2;
 };
diff -r f91e59ea9708 -r 480fbb0fc4b5 include/xen/interface/hvm/pvdrivers.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/xen/interface/hvm/pvdrivers.h	Thu Oct 04 11:13:04 2012 +0200
@@ -0,0 +1,47 @@
+/*
+ * pvdrivers.h: Register of PV drivers product numbers.
+ * Copyright (c) 2012, Citrix Systems Inc.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef _XEN_PUBLIC_PVDRIVERS_H_
+#define _XEN_PUBLIC_PVDRIVERS_H_
+
+/*
+ * This is the master registry of product numbers for
+ * PV drivers. 
+ * If you need a new product number allocating, please
+ * post to xen-devel@lists.xensource.com.  You should NOT use
+ * a product number without allocating one.
+ * If you maintain a separate versioning and distribution path
+ * for PV drivers you should have a separate product number so
+ * that your drivers can be separated from others.
+ *
+ * During development, you may use the product ID to
+ * indicate a driver which is yet to be released.
+ */
+
+#define PVDRIVERS_PRODUCT_LIST(EACH)                         \
+        EACH("xensource-windows", 0x0001) /* Citrix */       \
+        EACH("gplpv-windows",     0x0002) /* James Harper */ \
+        EACH("linux",             0x0003)                    \
+        EACH("experimental",      0xffff)
+
+#endif /* _XEN_PUBLIC_PVDRIVERS_H_ */
diff -r f91e59ea9708 -r 480fbb0fc4b5 include/xen/interface/physdev.h
--- a/include/xen/interface/physdev.h	Wed Sep 26 11:36:23 2012 +0200
+++ b/include/xen/interface/physdev.h	Thu Oct 04 11:13:04 2012 +0200
@@ -312,6 +312,24 @@ struct physdev_pci_device {
 typedef struct physdev_pci_device physdev_pci_device_t;
 DEFINE_XEN_GUEST_HANDLE(physdev_pci_device_t);
 
+#define PHYSDEVOP_DBGP_RESET_PREPARE    1
+#define PHYSDEVOP_DBGP_RESET_DONE       2
+
+#define PHYSDEVOP_DBGP_BUS_UNKNOWN      0
+#define PHYSDEVOP_DBGP_BUS_PCI          1
+
+#define PHYSDEVOP_dbgp_op               29
+struct physdev_dbgp_op {
+    /* IN */
+    uint8_t op;
+    uint8_t bus;
+    union {
+        struct physdev_pci_device pci;
+    } u;
+};
+typedef struct physdev_dbgp_op physdev_dbgp_op_t;
+DEFINE_XEN_GUEST_HANDLE(physdev_dbgp_op_t);
+
 /*
  * Notify that some PIRQ-bound event channels have been unmasked.
  * ** This command is obsolete since interface version 0x00030202 and is **
diff -r f91e59ea9708 -r 480fbb0fc4b5 include/xen/interface/platform.h
--- a/include/xen/interface/platform.h	Wed Sep 26 11:36:23 2012 +0200
+++ b/include/xen/interface/platform.h	Thu Oct 04 11:13:04 2012 +0200
@@ -218,6 +218,7 @@ DEFINE_XEN_GUEST_HANDLE(xenpf_efi_runtim
 #define  XEN_FW_EFI_VENDOR         2
 #define  XEN_FW_EFI_MEM_INFO       3
 #define  XEN_FW_EFI_RT_VERSION     4
+#define XEN_FW_KBD_SHIFT_FLAGS    5
 struct xenpf_firmware_info {
     /* IN variables. */
     uint32_t type;
@@ -266,6 +267,9 @@ struct xenpf_firmware_info {
                 uint32_t type;
             } mem;
         } efi_info; /* XEN_FW_EFI_INFO */
+
+        /* Int16, Fn02: Get keyboard shift flags. */
+        uint8_t kbd_shift_flags; /* XEN_FW_KBD_SHIFT_FLAGS */
     } u;
 };
 typedef struct xenpf_firmware_info xenpf_firmware_info_t;
@@ -504,6 +508,10 @@ struct xenpf_core_parking {
 typedef struct xenpf_core_parking xenpf_core_parking_t;
 DEFINE_XEN_GUEST_HANDLE(xenpf_core_parking_t);
 
+/*
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_platform_op(const struct xen_platform_op*);
+ */
 struct xen_platform_op {
     uint32_t cmd;
     uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
diff -r f91e59ea9708 -r 480fbb0fc4b5 include/xen/interface/sysctl.h
--- a/include/xen/interface/sysctl.h	Wed Sep 26 11:36:23 2012 +0200
+++ b/include/xen/interface/sysctl.h	Thu Oct 04 11:13:04 2012 +0200
@@ -484,6 +484,7 @@ typedef struct xen_sysctl_topologyinfo x
 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_topologyinfo_t);
 
 /* XEN_SYSCTL_numainfo */
+#define INVALID_NUMAINFO_ID (~0U)
 struct xen_sysctl_numainfo {
     /*
      * IN: maximum addressable entry in the caller-provided arrays.
diff -r f91e59ea9708 -r 480fbb0fc4b5 include/xen/interface/trace.h
--- a/include/xen/interface/trace.h	Wed Sep 26 11:36:23 2012 +0200
+++ b/include/xen/interface/trace.h	Thu Oct 04 11:13:04 2012 +0200
@@ -94,20 +94,51 @@
 #define TRC_MEM_POD_ZERO_RECLAIM    (TRC_MEM + 17)
 #define TRC_MEM_POD_SUPERPAGE_SPLINTER (TRC_MEM + 18)
 
+#define TRC_PV_ENTRY   0x00201000 /* Hypervisor entry points for PV guests. */
+#define TRC_PV_SUBCALL 0x00202000 /* Sub-call in a multicall hypercall */
 
-#define TRC_PV_HYPERCALL             (TRC_PV +  1)
-#define TRC_PV_TRAP                  (TRC_PV +  3)
-#define TRC_PV_PAGE_FAULT            (TRC_PV +  4)
-#define TRC_PV_FORCED_INVALID_OP     (TRC_PV +  5)
-#define TRC_PV_EMULATE_PRIVOP        (TRC_PV +  6)
-#define TRC_PV_EMULATE_4GB           (TRC_PV +  7)
-#define TRC_PV_MATH_STATE_RESTORE    (TRC_PV +  8)
-#define TRC_PV_PAGING_FIXUP          (TRC_PV +  9)
-#define TRC_PV_GDT_LDT_MAPPING_FAULT (TRC_PV + 10)
-#define TRC_PV_PTWR_EMULATION        (TRC_PV + 11)
-#define TRC_PV_PTWR_EMULATION_PAE    (TRC_PV + 12)
-  /* Indicates that addresses in trace record are 64 bits */
-#define TRC_64_FLAG               (0x100) 
+#define TRC_PV_HYPERCALL             (TRC_PV_ENTRY +  1)
+#define TRC_PV_TRAP                  (TRC_PV_ENTRY +  3)
+#define TRC_PV_PAGE_FAULT            (TRC_PV_ENTRY +  4)
+#define TRC_PV_FORCED_INVALID_OP     (TRC_PV_ENTRY +  5)
+#define TRC_PV_EMULATE_PRIVOP        (TRC_PV_ENTRY +  6)
+#define TRC_PV_EMULATE_4GB           (TRC_PV_ENTRY +  7)
+#define TRC_PV_MATH_STATE_RESTORE    (TRC_PV_ENTRY +  8)
+#define TRC_PV_PAGING_FIXUP          (TRC_PV_ENTRY +  9)
+#define TRC_PV_GDT_LDT_MAPPING_FAULT (TRC_PV_ENTRY + 10)
+#define TRC_PV_PTWR_EMULATION        (TRC_PV_ENTRY + 11)
+#define TRC_PV_PTWR_EMULATION_PAE    (TRC_PV_ENTRY + 12)
+#define TRC_PV_HYPERCALL_V2          (TRC_PV_ENTRY + 13)
+#define TRC_PV_HYPERCALL_SUBCALL     (TRC_PV_SUBCALL + 14)
+
+/*
+ * TRC_PV_HYPERCALL_V2 format
+ *
+ * Only some of the hypercall argument are recorded. Bit fields A0 to
+ * A5 in the first extra word are set if the argument is present and
+ * the arguments themselves are packed sequentially in the following
+ * words.
+ *
+ * The TRC_64_FLAG bit is not set for these events (even if there are
+ * 64-bit arguments in the record).
+ *
+ * Word
+ * 0    bit 31 30|29 28|27 26|25 24|23 22|21 20|19 ... 0
+ *          A5   |A4   |A3   |A2   |A1   |A0   |Hypercall op
+ * 1    First 32 bit (or low word of first 64 bit) arg in record
+ * 2    Second 32 bit (or high word of first 64 bit) arg in record
+ * ...
+ *
+ * A0-A5 bitfield values:
+ *
+ *   00b  Argument not present
+ *   01b  32-bit argument present
+ *   10b  64-bit argument present
+ *   11b  Reserved
+ */
+#define TRC_PV_HYPERCALL_V2_ARG_32(i) (0x1 << (20 + 2*(i)))
+#define TRC_PV_HYPERCALL_V2_ARG_64(i) (0x2 << (20 + 2*(i)))
+#define TRC_PV_HYPERCALL_V2_ARG_MASK  (0xfff00000)
 
 #define TRC_SHADOW_NOT_SHADOW                 (TRC_SHADOW +  1)
 #define TRC_SHADOW_FAST_PROPAGATE             (TRC_SHADOW +  2)
@@ -187,6 +218,14 @@
 #define TRC_HW_IRQ_UNMAPPED_VECTOR    (TRC_HW_IRQ + 0x7)
 #define TRC_HW_IRQ_HANDLED            (TRC_HW_IRQ + 0x8)
 
+/*
+ * Event Flags
+ *
+ * Some events (e.g, TRC_PV_TRAP and TRC_HVM_IOMEM_READ) have multiple
+ * record formats.  These event flags distinguish between the
+ * different formats.
+ */
+#define TRC_64_FLAG 0x100 /* Addresses are 64 bits (instead of 32 bits) */
 
 /* This structure represents a single trace buffer record. */
 struct t_rec {
diff -r f91e59ea9708 -r 480fbb0fc4b5 include/xen/interface/xsm/flask_op.h
--- a/include/xen/interface/xsm/flask_op.h	Wed Sep 26 11:36:23 2012 +0200
+++ b/include/xen/interface/xsm/flask_op.h	Thu Oct 04 11:13:04 2012 +0200
@@ -142,6 +142,12 @@ struct xen_flask_peersid {
     uint32_t sid;
 };
 
+struct xen_flask_relabel {
+    /* IN */
+    uint32_t domid;
+    uint32_t sid;
+};
+
 struct xen_flask_op {
     uint32_t cmd;
 #define FLASK_LOAD              1
@@ -167,6 +173,7 @@ struct xen_flask_op {
 #define FLASK_ADD_OCONTEXT      21
 #define FLASK_DEL_OCONTEXT      22
 #define FLASK_GET_PEER_SID      23
+#define FLASK_RELABEL_DOMAIN    24
     uint32_t interface_version; /* XEN_FLASK_INTERFACE_VERSION */
     union {
         struct xen_flask_load load;
@@ -185,6 +192,7 @@ struct xen_flask_op {
         /* FLASK_ADD_OCONTEXT, FLASK_DEL_OCONTEXT */
         struct xen_flask_ocontext ocontext;
         struct xen_flask_peersid peersid;
+        struct xen_flask_relabel relabel;
     } u;
 };
 typedef struct xen_flask_op xen_flask_op_t;


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

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

From xen-changelog-bounces@lists.xen.org Thu Oct 04 09:22:13 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 04 Oct 2012 09: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 1TJhdC-0005iE-8a; Thu, 04 Oct 2012 09:22:10 +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 1TJhdA-0005i9-Ht
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 09:22:09 +0000
Received: from [85.158.139.83:52060] by server-4.bemta-5.messagelabs.com id
	27/9E-20767-F355D605; Thu, 04 Oct 2012 09:22:07 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-182.messagelabs.com!1349342524!28833613!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21951 invoked from network); 4 Oct 2012 09:22:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2012 09:22: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 1TJhd6-00088f-FA
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 09:22:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJhd6-0003Zc-4x
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 09:22:04 +0000
Message-Id: <E1TJhd6-0003Zc-4x@xenbits.xen.org>
Date: Thu, 04 Oct 2012 09:22:03 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] sync Xen public headers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3802705711577480233=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1349341984 -7200
# Node ID 480fbb0fc4b54af94c5682fadb737c9df8af57ef
# Parent  f91e59ea970843355ab682d41c2181c1d5ec8850
sync Xen public headers

(without dropping ia64 bits)
---


diff -r f91e59ea9708 -r 480fbb0fc4b5 include/xen/interface/arch-arm.h
--- a/include/xen/interface/arch-arm.h	Wed Sep 26 11:36:23 2012 +0200
+++ b/include/xen/interface/arch-arm.h	Thu Oct 04 11:13:04 2012 +0200
@@ -42,8 +42,10 @@
  *
  * The return value is in r0.
  *
- * The hypercall will always clobber r0, r1, r2, r3, r4 and r12,
- * regardless of how many arguments the particular hypercall takes.
+ * The hypercall will clobber r12 and the argument registers used by
+ * that hypercall (except r0 which is the return value) i.e. a 2
+ * argument hypercall will clobber r1 and a 4 argument hypercall will
+ * clobber r1, r2 and r3.
  *
  */
 
@@ -124,15 +126,9 @@ typedef uint32_t xen_ulong_t;
 
 struct vcpu_guest_context {
     struct cpu_user_regs user_regs;         /* User-level CPU registers     */
-    union {
-        uint32_t reg[16];
-        struct {
-            uint32_t __pad[12];
-            uint32_t sp; /* r13 */
-            uint32_t lr; /* r14 */
-            uint32_t pc; /* r15 */
-        };
-    };
+
+    uint32_t sctlr;
+    uint32_t ttbr0, ttbr1, ttbcr;
 };
 typedef struct vcpu_guest_context vcpu_guest_context_t;
 DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t);
@@ -144,7 +140,28 @@ struct arch_shared_info { };
 typedef struct arch_shared_info arch_shared_info_t;
 typedef uint64_t xen_callback_t;
 
-#endif
+#endif /* ifndef __ASSEMBLY __ */
+
+/* PSR bits (CPSR, SPSR)*/
+
+/* 0-4: Mode */
+#define PSR_MODE_MASK 0x1f
+#define PSR_MODE_USR 0x10
+#define PSR_MODE_FIQ 0x11
+#define PSR_MODE_IRQ 0x12
+#define PSR_MODE_SVC 0x13
+#define PSR_MODE_MON 0x16
+#define PSR_MODE_ABT 0x17
+#define PSR_MODE_HYP 0x1a
+#define PSR_MODE_UND 0x1b
+#define PSR_MODE_SYS 0x1f
+
+#define PSR_THUMB       (1<<5)        /* Thumb Mode enable */
+#define PSR_FIQ_MASK    (1<<6)        /* Fast Interrupt mask */
+#define PSR_IRQ_MASK    (1<<7)        /* Interrupt mask */
+#define PSR_ABT_MASK    (1<<8)        /* Asynchronous Abort mask */
+#define PSR_BIG_ENDIAN  (1<<9)        /* Big Endian Mode */
+#define PSR_JAZELLE     (1<<24)       /* Jazelle Mode */
 
 #endif /*  __XEN_PUBLIC_ARCH_ARM_H__ */
 
diff -r f91e59ea9708 -r 480fbb0fc4b5 include/xen/interface/arch-x86/hvm/save.h
--- a/include/xen/interface/arch-x86/hvm/save.h	Wed Sep 26 11:36:23 2012 +0200
+++ b/include/xen/interface/arch-x86/hvm/save.h	Thu Oct 04 11:13:04 2012 +0200
@@ -577,13 +577,21 @@ DECLARE_HVM_SAVE_TYPE(VIRIDIAN_VCPU, 17,
 
 struct hvm_vmce_vcpu {
     uint64_t caps;
+    uint64_t mci_ctl2_bank0;
+    uint64_t mci_ctl2_bank1;
 };
 
 DECLARE_HVM_SAVE_TYPE(VMCE_VCPU, 18, struct hvm_vmce_vcpu);
 
+struct hvm_tsc_adjust {
+    uint64_t tsc_adjust;
+};
+
+DECLARE_HVM_SAVE_TYPE(TSC_ADJUST, 19, struct hvm_tsc_adjust);
+
 /* 
  * Largest type-code in use
  */
-#define HVM_SAVE_CODE_MAX 18
+#define HVM_SAVE_CODE_MAX 19
 
 #endif /* __XEN_PUBLIC_HVM_SAVE_X86_H__ */
diff -r f91e59ea9708 -r 480fbb0fc4b5 include/xen/interface/arch-x86/xen-x86_32.h
--- a/include/xen/interface/arch-x86/xen-x86_32.h	Wed Sep 26 11:36:23 2012 +0200
+++ b/include/xen/interface/arch-x86/xen-x86_32.h	Thu Oct 04 11:13:04 2012 +0200
@@ -29,7 +29,7 @@
 
 /*
  * Hypercall interface:
- *  Input:  %ebx, %ecx, %edx, %esi, %edi (arguments 1-5)
+ *  Input:  %ebx, %ecx, %edx, %esi, %edi, %ebp (arguments 1-6)
  *  Output: %eax
  * Access is via hypercall page (set up by guest loader or via a Xen MSR):
  *  call hypercall_page + hypercall-number * 32
diff -r f91e59ea9708 -r 480fbb0fc4b5 include/xen/interface/arch-x86/xen-x86_64.h
--- a/include/xen/interface/arch-x86/xen-x86_64.h	Wed Sep 26 11:36:23 2012 +0200
+++ b/include/xen/interface/arch-x86/xen-x86_64.h	Thu Oct 04 11:13:04 2012 +0200
@@ -29,7 +29,7 @@
 
 /*
  * Hypercall interface:
- *  Input:  %rdi, %rsi, %rdx, %r10, %r8 (arguments 1-5)
+ *  Input:  %rdi, %rsi, %rdx, %r10, %r8, %r9 (arguments 1-6)
  *  Output: %rax
  * Access is via hypercall page (set up by guest loader or via a Xen MSR):
  *  call hypercall_page + hypercall-number * 32
diff -r f91e59ea9708 -r 480fbb0fc4b5 include/xen/interface/arch-x86/xen.h
--- a/include/xen/interface/arch-x86/xen.h	Wed Sep 26 11:36:23 2012 +0200
+++ b/include/xen/interface/arch-x86/xen.h	Thu Oct 04 11:13:04 2012 +0200
@@ -65,6 +65,11 @@ typedef unsigned long xen_pfn_t;
  * SEGMENT DESCRIPTOR TABLES
  */
 /*
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_set_gdt(const xen_pfn_t frames[], unsigned int entries);
+ * `
+ */
+/*
  * A number of GDT entries are reserved by Xen. These are not situated at the
  * start of the GDT because some stupid OSes export hard-coded selector values
  * in their ABI. These hard-coded values are always near the start of the GDT,
@@ -83,6 +88,13 @@ typedef unsigned long xen_ulong_t;
 
 /*
  * ` enum neg_errnoval
+ * ` HYPERVISOR_stack_switch(unsigned long ss, unsigned long esp);
+ * `
+ * Sets the stack segment and pointer for the current vcpu.
+ */
+
+/*
+ * ` enum neg_errnoval
  * ` HYPERVISOR_set_trap_table(const struct trap_info traps[]);
  * `
  */
@@ -183,6 +195,24 @@ typedef struct arch_shared_info arch_sha
 #endif /* !__ASSEMBLY__ */
 
 /*
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_fpu_taskswitch(int set);
+ * `
+ * Sets (if set!=0) or clears (if set==0) CR0.TS.
+ */
+
+/*
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_set_debugreg(int regno, unsigned long value);
+ *
+ * ` unsigned long
+ * ` HYPERVISOR_get_debugreg(int regno);
+ * For 0<=reg<=7, returns the debug register value.
+ * For other values of reg, returns ((unsigned long)-EINVAL).
+ * (Unfortunately, this interface is defective.)
+ */
+
+/*
  * Prefix forces emulation of some non-trapping instructions.
  * Currently only CPUID.
  */
diff -r f91e59ea9708 -r 480fbb0fc4b5 include/xen/interface/arch-x86_64.h
--- a/include/xen/interface/arch-x86_64.h	Wed Sep 26 11:36:23 2012 +0200
+++ b/include/xen/interface/arch-x86_64.h	Thu Oct 04 11:13:04 2012 +0200
@@ -25,3 +25,19 @@
  */
 
 #include "arch-x86/xen.h"
+
+/*
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_set_callbacks(unsigned long event_selector,
+ * `                          unsigned long event_address,
+ * `                          unsigned long failsafe_selector,
+ * `                          unsigned long failsafe_address);
+ * `
+ * Register for callbacks on events.  When an event (from an event
+ * channel) occurs, event_address is used as the value of eip.
+ *
+ * A similar callback occurs if the segment selectors are invalid.
+ * failsafe_address is used as the value of eip.
+ *
+ * On x86_64, event_selector and failsafe_selector are ignored (???).
+ */
diff -r f91e59ea9708 -r 480fbb0fc4b5 include/xen/interface/domctl.h
--- a/include/xen/interface/domctl.h	Wed Sep 26 11:36:23 2012 +0200
+++ b/include/xen/interface/domctl.h	Thu Oct 04 11:13:04 2012 +0200
@@ -32,6 +32,7 @@
 #error "domctl operations are intended for use by node control tools only"
 #endif
 
+#include <xen/hvm/save.h>
 #include "xen.h"
 #include "grant_table.h"
 
@@ -571,7 +572,14 @@ struct xen_domctl_ext_vcpucontext {
     uint16_t         sysenter_callback_cs;
     uint8_t          syscall32_disables_events;
     uint8_t          sysenter_disables_events;
-    uint64_aligned_t mcg_cap;
+#if defined(__GNUC__)
+    union {
+        uint64_aligned_t mcg_cap;
+        struct hvm_vmce_vcpu vmce;
+    };
+#else
+    struct hvm_vmce_vcpu vmce;
+#endif
 #endif
 };
 typedef struct xen_domctl_ext_vcpucontext xen_domctl_ext_vcpucontext_t;
@@ -716,6 +724,13 @@ struct xen_domctl_gdbsx_domstatus {
  * Domctl interface to set up and tear down the 
  * pager<->hypervisor interface. Use XENMEM_paging_op*
  * to perform per-page operations.
+ *
+ * The XEN_DOMCTL_MEM_EVENT_OP_PAGING_ENABLE domctl returns several
+ * non-standard error codes to indicate why paging could not be enabled:
+ * ENODEV - host lacks HAP support (EPT/NPT) or HAP is disabled in guest
+ * EMLINK - guest has iommu passthrough enabled
+ * EXDEV  - guest has PoD enabled
+ * EBUSY  - guest has or had paging enabled, ring buffer still active
  */
 #define XEN_DOMCTL_MEM_EVENT_OP_PAGING            1
 
@@ -735,6 +750,11 @@ struct xen_domctl_gdbsx_domstatus {
  *
  * The memory event handler can then resume the VCPU and redo the access 
  * with a XENMEM_access_op_resume hypercall.
+ *
+ * The XEN_DOMCTL_MEM_EVENT_OP_ACCESS_ENABLE domctl returns several
+ * non-standard error codes to indicate why access could not be enabled:
+ * ENODEV - host lacks HAP support (EPT/NPT) or HAP is disabled in guest
+ * EBUSY  - guest has or had access enabled, ring buffer still active
  */
 #define XEN_DOMCTL_MEM_EVENT_OP_ACCESS            2
 
diff -r f91e59ea9708 -r 480fbb0fc4b5 include/xen/interface/grant_table.h
--- a/include/xen/interface/grant_table.h	Wed Sep 26 11:36:23 2012 +0200
+++ b/include/xen/interface/grant_table.h	Thu Oct 04 11:13:04 2012 +0200
@@ -1,9 +1,9 @@
 /******************************************************************************
  * grant_table.h
- * 
+ *
  * Interface for granting foreign access to page frames, and receiving
  * page-ownership transfers.
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
  * deal in the Software without restriction, including without limitation the
@@ -30,17 +30,41 @@
 
 #include "xen.h"
 
+/*
+ * `incontents 150 gnttab Grant Tables
+ *
+ * Xen's grant tables provide a generic mechanism to memory sharing
+ * between domains. This shared memory interface underpins the split
+ * device drivers for block and network IO.
+ *
+ * Each domain has its own grant table. This is a data structure that
+ * is shared with Xen; it allows the domain to tell Xen what kind of
+ * permissions other domains have on its pages. Entries in the grant
+ * table are identified by grant references. A grant reference is an
+ * integer, which indexes into the grant table. It acts as a
+ * capability which the grantee can use to perform operations on the
+ * granter’s memory.
+ *
+ * This capability-based system allows shared-memory communications
+ * between unprivileged domains. A grant reference also encapsulates
+ * the details of a shared page, removing the need for a domain to
+ * know the real machine address of a page it is sharing. This makes
+ * it possible to share memory correctly with domains running in
+ * fully virtualised memory.
+ */
+
 /***********************************
  * GRANT TABLE REPRESENTATION
  */
 
 /* Some rough guidelines on accessing and updating grant-table entries
  * in a concurrency-safe manner. For more information, Linux contains a
- * reference implementation for guest OSes (arch/xen/kernel/grant_table.c).
- * 
+ * reference implementation for guest OSes (drivers/xen/grant_table.c, see
+ * http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=drivers/xen/grant-table.c;hb=HEAD
+ *
  * NB. WMB is a no-op on current-generation x86 processors. However, a
  *     compiler barrier will still be required.
- * 
+ *
  * Introducing a valid entry into the grant table:
  *  1. Write ent->domid.
  *  2. Write ent->frame:
@@ -49,7 +73,7 @@
  *                           frame, or zero if none.
  *  3. Write memory barrier (WMB).
  *  4. Write ent->flags, inc. valid type.
- * 
+ *
  * Invalidating an unused GTF_permit_access entry:
  *  1. flags = ent->flags.
  *  2. Observe that !(flags & (GTF_reading|GTF_writing)).
@@ -61,7 +85,7 @@
  *  This cannot be done directly. Request assistance from the domain controller
  *  which can set a timeout on the use of a grant entry and take necessary
  *  action. (NB. This is not yet implemented!).
- * 
+ *
  * Invalidating an unused GTF_accept_transfer entry:
  *  1. flags = ent->flags.
  *  2. Observe that !(flags & GTF_transfer_committed). [*]
@@ -79,7 +103,7 @@
  *
  * Changing a GTF_permit_access from writable to read-only:
  *  Use SMP-safe CMPXCHG to set GTF_readonly, while checking !GTF_writing.
- * 
+ *
  * Changing a GTF_permit_access from read-only to writable:
  *  Use SMP-safe bit-setting instruction.
  */
@@ -261,6 +285,33 @@ typedef uint16_t grant_status_t;
  * GRANT TABLE QUERIES AND USES
  */
 
+/* ` enum neg_errnoval
+ * ` HYPERVISOR_grant_table_op(enum grant_table_op cmd,
+ * `                           void *args,
+ * `                           unsigned int count)
+ * `
+ *
+ * @args points to an array of a per-command data structure. The array
+ * has @count members
+ */
+
+/* ` enum grant_table_op { // GNTTABOP_* => struct gnttab_* */
+#define GNTTABOP_map_grant_ref        0
+#define GNTTABOP_unmap_grant_ref      1
+#define GNTTABOP_setup_table          2
+#define GNTTABOP_dump_table           3
+#define GNTTABOP_transfer             4
+#define GNTTABOP_copy                 5
+#define GNTTABOP_query_size           6
+#define GNTTABOP_unmap_and_replace    7
+#if __XEN_INTERFACE_VERSION__ >= 0x0003020a
+#define GNTTABOP_set_version          8
+#define GNTTABOP_get_status_frames    9
+#define GNTTABOP_get_version          10
+#define GNTTABOP_swap_grant_ref	      11
+#endif /* __XEN_INTERFACE_VERSION__ */
+/* ` } */
+
 /*
  * Handle to track a mapping created via a grant reference.
  */
@@ -277,13 +328,12 @@ typedef uint32_t grant_handle_t;
  *  2. If GNTMAP_host_map is specified then a mapping will be added at
  *     either a host virtual address in the current address space, or at
  *     a PTE at the specified machine address.  The type of mapping to
- *     perform is selected through the GNTMAP_contains_pte flag, and the 
+ *     perform is selected through the GNTMAP_contains_pte flag, and the
  *     address is specified in <host_addr>.
  *  3. Mappings should only be destroyed via GNTTABOP_unmap_grant_ref. If a
  *     host mapping is destroyed by other means then it is *NOT* guaranteed
  *     to be accounted to the correct grant reference!
  */
-#define GNTTABOP_map_grant_ref        0
 struct gnttab_map_grant_ref {
     /* IN parameters. */
     uint64_t host_addr;
@@ -291,7 +341,7 @@ struct gnttab_map_grant_ref {
     grant_ref_t ref;
     domid_t  dom;
     /* OUT parameters. */
-    int16_t  status;              /* GNTST_* */
+    int16_t  status;              /* => enum grant_status */
     grant_handle_t handle;
     uint64_t dev_bus_addr;
 };
@@ -309,14 +359,13 @@ DEFINE_XEN_GUEST_HANDLE(gnttab_map_grant
  *  3. After executing a batch of unmaps, it is guaranteed that no stale
  *     mappings will remain in the device or host TLBs.
  */
-#define GNTTABOP_unmap_grant_ref      1
 struct gnttab_unmap_grant_ref {
     /* IN parameters. */
     uint64_t host_addr;
     uint64_t dev_bus_addr;
     grant_handle_t handle;
     /* OUT parameters. */
-    int16_t  status;              /* GNTST_* */
+    int16_t  status;              /* => enum grant_status */
 };
 typedef struct gnttab_unmap_grant_ref gnttab_unmap_grant_ref_t;
 DEFINE_XEN_GUEST_HANDLE(gnttab_unmap_grant_ref_t);
@@ -330,13 +379,12 @@ DEFINE_XEN_GUEST_HANDLE(gnttab_unmap_gra
  *  2. Only a sufficiently-privileged domain may specify <dom> != DOMID_SELF.
  *  3. Xen may not support more than a single grant-table page per domain.
  */
-#define GNTTABOP_setup_table          2
 struct gnttab_setup_table {
     /* IN parameters. */
     domid_t  dom;
     uint32_t nr_frames;
     /* OUT parameters. */
-    int16_t  status;              /* GNTST_* */
+    int16_t  status;              /* => enum grant_status */
     XEN_GUEST_HANDLE(ulong) frame_list;
 };
 typedef struct gnttab_setup_table gnttab_setup_table_t;
@@ -346,12 +394,11 @@ DEFINE_XEN_GUEST_HANDLE(gnttab_setup_tab
  * GNTTABOP_dump_table: Dump the contents of the grant table to the
  * xen console. Debugging use only.
  */
-#define GNTTABOP_dump_table           3
 struct gnttab_dump_table {
     /* IN parameters. */
     domid_t dom;
     /* OUT parameters. */
-    int16_t status;               /* GNTST_* */
+    int16_t status;               /* => enum grant_status */
 };
 typedef struct gnttab_dump_table gnttab_dump_table_t;
 DEFINE_XEN_GUEST_HANDLE(gnttab_dump_table_t);
@@ -360,11 +407,10 @@ DEFINE_XEN_GUEST_HANDLE(gnttab_dump_tabl
  * GNTTABOP_transfer_grant_ref: Transfer <frame> to a foreign domain. The
  * foreign domain has previously registered its interest in the transfer via
  * <domid, ref>.
- * 
+ *
  * Note that, even if the transfer fails, the specified page no longer belongs
  * to the calling domain *unless* the error is GNTST_bad_page.
  */
-#define GNTTABOP_transfer                4
 struct gnttab_transfer {
     /* IN parameters. */
     xen_pfn_t     mfn;
@@ -400,10 +446,9 @@ DEFINE_XEN_GUEST_HANDLE(gnttab_transfer_
 #define _GNTCOPY_dest_gref        (1)
 #define GNTCOPY_dest_gref         (1<<_GNTCOPY_dest_gref)
 #define _GNTCOPY_can_fail         (2)
-#define GNTCOPY_can_fail          (1<<_GNTCOPY_can_fail) 
+#define GNTCOPY_can_fail          (1<<_GNTCOPY_can_fail)
 
-#define GNTTABOP_copy                 5
-typedef struct gnttab_copy {
+struct gnttab_copy {
     /* IN parameters. */
     struct {
         union {
@@ -417,7 +462,8 @@ typedef struct gnttab_copy {
     uint16_t      flags;          /* GNTCOPY_* */
     /* OUT parameters. */
     int16_t       status;
-} gnttab_copy_t;
+};
+typedef struct gnttab_copy  gnttab_copy_t;
 DEFINE_XEN_GUEST_HANDLE(gnttab_copy_t);
 
 /*
@@ -427,14 +473,13 @@ DEFINE_XEN_GUEST_HANDLE(gnttab_copy_t);
  *  1. <dom> may be specified as DOMID_SELF.
  *  2. Only a sufficiently-privileged domain may specify <dom> != DOMID_SELF.
  */
-#define GNTTABOP_query_size           6
 struct gnttab_query_size {
     /* IN parameters. */
     domid_t  dom;
     /* OUT parameters. */
     uint32_t nr_frames;
     uint32_t max_nr_frames;
-    int16_t  status;              /* GNTST_* */
+    int16_t  status;              /* => enum grant_status */
 };
 typedef struct gnttab_query_size gnttab_query_size_t;
 DEFINE_XEN_GUEST_HANDLE(gnttab_query_size_t);
@@ -450,14 +495,13 @@ DEFINE_XEN_GUEST_HANDLE(gnttab_query_siz
  *  2. After executing a batch of unmaps, it is guaranteed that no stale
  *     mappings will remain in the device or host TLBs.
  */
-#define GNTTABOP_unmap_and_replace    7
 struct gnttab_unmap_and_replace {
     /* IN parameters. */
     uint64_t host_addr;
     uint64_t new_addr;
     grant_handle_t handle;
     /* OUT parameters. */
-    int16_t  status;              /* GNTST_* */
+    int16_t  status;              /* => enum grant_status */
 };
 typedef struct gnttab_unmap_and_replace gnttab_unmap_and_replace_t;
 DEFINE_XEN_GUEST_HANDLE(gnttab_unmap_and_replace_t);
@@ -470,7 +514,6 @@ DEFINE_XEN_GUEST_HANDLE(gnttab_unmap_and
  * are activated; otherwise, the domain will be stuck with version 1.
  * The only defined versions are 1 and 2.
  */
-#define GNTTABOP_set_version          8
 struct gnttab_set_version {
     /* IN/OUT parameters */
     uint32_t version;
@@ -491,13 +534,12 @@ DEFINE_XEN_GUEST_HANDLE(gnttab_set_versi
  *  1. <dom> may be specified as DOMID_SELF.
  *  2. Only a sufficiently-privileged domain may specify <dom> != DOMID_SELF.
  */
-#define GNTTABOP_get_status_frames     9
 struct gnttab_get_status_frames {
     /* IN parameters. */
     uint32_t nr_frames;
     domid_t  dom;
     /* OUT parameters. */
-    int16_t  status;              /* GNTST_* */
+    int16_t  status;              /* => enum grant_status */
     XEN_GUEST_HANDLE(uint64_t) frame_list;
 };
 typedef struct gnttab_get_status_frames gnttab_get_status_frames_t;
@@ -507,7 +549,6 @@ DEFINE_XEN_GUEST_HANDLE(gnttab_get_statu
  * GNTTABOP_get_version: Get the grant table version which is in
  * effect for domain <dom>.
  */
-#define GNTTABOP_get_version          10
 struct gnttab_get_version {
     /* IN parameters */
     domid_t dom;
@@ -518,16 +559,15 @@ struct gnttab_get_version {
 typedef struct gnttab_get_version gnttab_get_version_t;
 DEFINE_XEN_GUEST_HANDLE(gnttab_get_version_t);
 
-/* 
+/*
  * GNTTABOP_swap_grant_ref: Swap the contents of two grant entries.
  */
-#define GNTTABOP_swap_grant_ref	      11
 struct gnttab_swap_grant_ref {
     /* IN parameters */
     grant_ref_t ref_a;
     grant_ref_t ref_b;
     /* OUT parameters */
-    int16_t status;             /* GNTST_* */
+    int16_t status;             /* => enum grant_status */
 };
 typedef struct gnttab_swap_grant_ref gnttab_swap_grant_ref_t;
 DEFINE_XEN_GUEST_HANDLE(gnttab_swap_grant_ref_t);
@@ -575,6 +615,7 @@ DEFINE_XEN_GUEST_HANDLE(gnttab_swap_gran
 /*
  * Values for error status returns. All errors are -ve.
  */
+/* ` enum grant_status { */
 #define GNTST_okay             (0)  /* Normal return.                        */
 #define GNTST_general_error    (-1) /* General undefined error.              */
 #define GNTST_bad_domain       (-2) /* Unrecognsed domain id.                */
@@ -588,6 +629,7 @@ DEFINE_XEN_GUEST_HANDLE(gnttab_swap_gran
 #define GNTST_bad_copy_arg    (-10) /* copy arguments cross page boundary.   */
 #define GNTST_address_too_big (-11) /* transfer page address too large.      */
 #define GNTST_eagain          (-12) /* Operation not done; try again.        */
+/* ` } */
 
 #define GNTTABOP_error_msgs {                   \
     "okay",                                     \
diff -r f91e59ea9708 -r 480fbb0fc4b5 include/xen/interface/hvm/hvm_op.h
--- a/include/xen/interface/hvm/hvm_op.h	Wed Sep 26 11:36:23 2012 +0200
+++ b/include/xen/interface/hvm/hvm_op.h	Thu Oct 04 11:13:04 2012 +0200
@@ -217,10 +217,21 @@ struct xen_hvm_inject_trap {
     domid_t domid;
     /* VCPU */
     uint32_t vcpuid;
-    /* Trap number */
-    uint32_t trap;
-    /* Error code, or -1 to skip */
+    /* Vector number */
+    uint32_t vector;
+    /* Trap type (HVMOP_TRAP_*) */
+    uint32_t type;
+/* NB. This enumeration precisely matches hvm.h:X86_EVENTTYPE_* */
+# define HVMOP_TRAP_ext_int    0 /* external interrupt */
+# define HVMOP_TRAP_nmi        2 /* nmi */
+# define HVMOP_TRAP_hw_exc     3 /* hardware exception */
+# define HVMOP_TRAP_sw_int     4 /* software interrupt (CD nn) */
+# define HVMOP_TRAP_pri_sw_exc 5 /* ICEBP (F1) */
+# define HVMOP_TRAP_sw_exc     6 /* INT3 (CC), INTO (CE) */
+    /* Error code, or ~0u to skip */
     uint32_t error_code;
+    /* Intruction length */
+    uint32_t insn_len;
     /* CR2 for page faults */
     uint64_aligned_t cr2;
 };
diff -r f91e59ea9708 -r 480fbb0fc4b5 include/xen/interface/hvm/pvdrivers.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/xen/interface/hvm/pvdrivers.h	Thu Oct 04 11:13:04 2012 +0200
@@ -0,0 +1,47 @@
+/*
+ * pvdrivers.h: Register of PV drivers product numbers.
+ * Copyright (c) 2012, Citrix Systems Inc.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef _XEN_PUBLIC_PVDRIVERS_H_
+#define _XEN_PUBLIC_PVDRIVERS_H_
+
+/*
+ * This is the master registry of product numbers for
+ * PV drivers. 
+ * If you need a new product number allocating, please
+ * post to xen-devel@lists.xensource.com.  You should NOT use
+ * a product number without allocating one.
+ * If you maintain a separate versioning and distribution path
+ * for PV drivers you should have a separate product number so
+ * that your drivers can be separated from others.
+ *
+ * During development, you may use the product ID to
+ * indicate a driver which is yet to be released.
+ */
+
+#define PVDRIVERS_PRODUCT_LIST(EACH)                         \
+        EACH("xensource-windows", 0x0001) /* Citrix */       \
+        EACH("gplpv-windows",     0x0002) /* James Harper */ \
+        EACH("linux",             0x0003)                    \
+        EACH("experimental",      0xffff)
+
+#endif /* _XEN_PUBLIC_PVDRIVERS_H_ */
diff -r f91e59ea9708 -r 480fbb0fc4b5 include/xen/interface/physdev.h
--- a/include/xen/interface/physdev.h	Wed Sep 26 11:36:23 2012 +0200
+++ b/include/xen/interface/physdev.h	Thu Oct 04 11:13:04 2012 +0200
@@ -312,6 +312,24 @@ struct physdev_pci_device {
 typedef struct physdev_pci_device physdev_pci_device_t;
 DEFINE_XEN_GUEST_HANDLE(physdev_pci_device_t);
 
+#define PHYSDEVOP_DBGP_RESET_PREPARE    1
+#define PHYSDEVOP_DBGP_RESET_DONE       2
+
+#define PHYSDEVOP_DBGP_BUS_UNKNOWN      0
+#define PHYSDEVOP_DBGP_BUS_PCI          1
+
+#define PHYSDEVOP_dbgp_op               29
+struct physdev_dbgp_op {
+    /* IN */
+    uint8_t op;
+    uint8_t bus;
+    union {
+        struct physdev_pci_device pci;
+    } u;
+};
+typedef struct physdev_dbgp_op physdev_dbgp_op_t;
+DEFINE_XEN_GUEST_HANDLE(physdev_dbgp_op_t);
+
 /*
  * Notify that some PIRQ-bound event channels have been unmasked.
  * ** This command is obsolete since interface version 0x00030202 and is **
diff -r f91e59ea9708 -r 480fbb0fc4b5 include/xen/interface/platform.h
--- a/include/xen/interface/platform.h	Wed Sep 26 11:36:23 2012 +0200
+++ b/include/xen/interface/platform.h	Thu Oct 04 11:13:04 2012 +0200
@@ -218,6 +218,7 @@ DEFINE_XEN_GUEST_HANDLE(xenpf_efi_runtim
 #define  XEN_FW_EFI_VENDOR         2
 #define  XEN_FW_EFI_MEM_INFO       3
 #define  XEN_FW_EFI_RT_VERSION     4
+#define XEN_FW_KBD_SHIFT_FLAGS    5
 struct xenpf_firmware_info {
     /* IN variables. */
     uint32_t type;
@@ -266,6 +267,9 @@ struct xenpf_firmware_info {
                 uint32_t type;
             } mem;
         } efi_info; /* XEN_FW_EFI_INFO */
+
+        /* Int16, Fn02: Get keyboard shift flags. */
+        uint8_t kbd_shift_flags; /* XEN_FW_KBD_SHIFT_FLAGS */
     } u;
 };
 typedef struct xenpf_firmware_info xenpf_firmware_info_t;
@@ -504,6 +508,10 @@ struct xenpf_core_parking {
 typedef struct xenpf_core_parking xenpf_core_parking_t;
 DEFINE_XEN_GUEST_HANDLE(xenpf_core_parking_t);
 
+/*
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_platform_op(const struct xen_platform_op*);
+ */
 struct xen_platform_op {
     uint32_t cmd;
     uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
diff -r f91e59ea9708 -r 480fbb0fc4b5 include/xen/interface/sysctl.h
--- a/include/xen/interface/sysctl.h	Wed Sep 26 11:36:23 2012 +0200
+++ b/include/xen/interface/sysctl.h	Thu Oct 04 11:13:04 2012 +0200
@@ -484,6 +484,7 @@ typedef struct xen_sysctl_topologyinfo x
 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_topologyinfo_t);
 
 /* XEN_SYSCTL_numainfo */
+#define INVALID_NUMAINFO_ID (~0U)
 struct xen_sysctl_numainfo {
     /*
      * IN: maximum addressable entry in the caller-provided arrays.
diff -r f91e59ea9708 -r 480fbb0fc4b5 include/xen/interface/trace.h
--- a/include/xen/interface/trace.h	Wed Sep 26 11:36:23 2012 +0200
+++ b/include/xen/interface/trace.h	Thu Oct 04 11:13:04 2012 +0200
@@ -94,20 +94,51 @@
 #define TRC_MEM_POD_ZERO_RECLAIM    (TRC_MEM + 17)
 #define TRC_MEM_POD_SUPERPAGE_SPLINTER (TRC_MEM + 18)
 
+#define TRC_PV_ENTRY   0x00201000 /* Hypervisor entry points for PV guests. */
+#define TRC_PV_SUBCALL 0x00202000 /* Sub-call in a multicall hypercall */
 
-#define TRC_PV_HYPERCALL             (TRC_PV +  1)
-#define TRC_PV_TRAP                  (TRC_PV +  3)
-#define TRC_PV_PAGE_FAULT            (TRC_PV +  4)
-#define TRC_PV_FORCED_INVALID_OP     (TRC_PV +  5)
-#define TRC_PV_EMULATE_PRIVOP        (TRC_PV +  6)
-#define TRC_PV_EMULATE_4GB           (TRC_PV +  7)
-#define TRC_PV_MATH_STATE_RESTORE    (TRC_PV +  8)
-#define TRC_PV_PAGING_FIXUP          (TRC_PV +  9)
-#define TRC_PV_GDT_LDT_MAPPING_FAULT (TRC_PV + 10)
-#define TRC_PV_PTWR_EMULATION        (TRC_PV + 11)
-#define TRC_PV_PTWR_EMULATION_PAE    (TRC_PV + 12)
-  /* Indicates that addresses in trace record are 64 bits */
-#define TRC_64_FLAG               (0x100) 
+#define TRC_PV_HYPERCALL             (TRC_PV_ENTRY +  1)
+#define TRC_PV_TRAP                  (TRC_PV_ENTRY +  3)
+#define TRC_PV_PAGE_FAULT            (TRC_PV_ENTRY +  4)
+#define TRC_PV_FORCED_INVALID_OP     (TRC_PV_ENTRY +  5)
+#define TRC_PV_EMULATE_PRIVOP        (TRC_PV_ENTRY +  6)
+#define TRC_PV_EMULATE_4GB           (TRC_PV_ENTRY +  7)
+#define TRC_PV_MATH_STATE_RESTORE    (TRC_PV_ENTRY +  8)
+#define TRC_PV_PAGING_FIXUP          (TRC_PV_ENTRY +  9)
+#define TRC_PV_GDT_LDT_MAPPING_FAULT (TRC_PV_ENTRY + 10)
+#define TRC_PV_PTWR_EMULATION        (TRC_PV_ENTRY + 11)
+#define TRC_PV_PTWR_EMULATION_PAE    (TRC_PV_ENTRY + 12)
+#define TRC_PV_HYPERCALL_V2          (TRC_PV_ENTRY + 13)
+#define TRC_PV_HYPERCALL_SUBCALL     (TRC_PV_SUBCALL + 14)
+
+/*
+ * TRC_PV_HYPERCALL_V2 format
+ *
+ * Only some of the hypercall argument are recorded. Bit fields A0 to
+ * A5 in the first extra word are set if the argument is present and
+ * the arguments themselves are packed sequentially in the following
+ * words.
+ *
+ * The TRC_64_FLAG bit is not set for these events (even if there are
+ * 64-bit arguments in the record).
+ *
+ * Word
+ * 0    bit 31 30|29 28|27 26|25 24|23 22|21 20|19 ... 0
+ *          A5   |A4   |A3   |A2   |A1   |A0   |Hypercall op
+ * 1    First 32 bit (or low word of first 64 bit) arg in record
+ * 2    Second 32 bit (or high word of first 64 bit) arg in record
+ * ...
+ *
+ * A0-A5 bitfield values:
+ *
+ *   00b  Argument not present
+ *   01b  32-bit argument present
+ *   10b  64-bit argument present
+ *   11b  Reserved
+ */
+#define TRC_PV_HYPERCALL_V2_ARG_32(i) (0x1 << (20 + 2*(i)))
+#define TRC_PV_HYPERCALL_V2_ARG_64(i) (0x2 << (20 + 2*(i)))
+#define TRC_PV_HYPERCALL_V2_ARG_MASK  (0xfff00000)
 
 #define TRC_SHADOW_NOT_SHADOW                 (TRC_SHADOW +  1)
 #define TRC_SHADOW_FAST_PROPAGATE             (TRC_SHADOW +  2)
@@ -187,6 +218,14 @@
 #define TRC_HW_IRQ_UNMAPPED_VECTOR    (TRC_HW_IRQ + 0x7)
 #define TRC_HW_IRQ_HANDLED            (TRC_HW_IRQ + 0x8)
 
+/*
+ * Event Flags
+ *
+ * Some events (e.g, TRC_PV_TRAP and TRC_HVM_IOMEM_READ) have multiple
+ * record formats.  These event flags distinguish between the
+ * different formats.
+ */
+#define TRC_64_FLAG 0x100 /* Addresses are 64 bits (instead of 32 bits) */
 
 /* This structure represents a single trace buffer record. */
 struct t_rec {
diff -r f91e59ea9708 -r 480fbb0fc4b5 include/xen/interface/xsm/flask_op.h
--- a/include/xen/interface/xsm/flask_op.h	Wed Sep 26 11:36:23 2012 +0200
+++ b/include/xen/interface/xsm/flask_op.h	Thu Oct 04 11:13:04 2012 +0200
@@ -142,6 +142,12 @@ struct xen_flask_peersid {
     uint32_t sid;
 };
 
+struct xen_flask_relabel {
+    /* IN */
+    uint32_t domid;
+    uint32_t sid;
+};
+
 struct xen_flask_op {
     uint32_t cmd;
 #define FLASK_LOAD              1
@@ -167,6 +173,7 @@ struct xen_flask_op {
 #define FLASK_ADD_OCONTEXT      21
 #define FLASK_DEL_OCONTEXT      22
 #define FLASK_GET_PEER_SID      23
+#define FLASK_RELABEL_DOMAIN    24
     uint32_t interface_version; /* XEN_FLASK_INTERFACE_VERSION */
     union {
         struct xen_flask_load load;
@@ -185,6 +192,7 @@ struct xen_flask_op {
         /* FLASK_ADD_OCONTEXT, FLASK_DEL_OCONTEXT */
         struct xen_flask_ocontext ocontext;
         struct xen_flask_peersid peersid;
+        struct xen_flask_relabel relabel;
     } u;
 };
 typedef struct xen_flask_op xen_flask_op_t;


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

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

From xen-changelog-bounces@lists.xen.org Thu Oct 04 16:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 04 Oct 2012 16:11:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TJo13-0003SG-Qv; Thu, 04 Oct 2012 16:11:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo12-0003Ri-ND
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:13 +0000
Received: from [85.158.139.211:12932] by server-7.bemta-5.messagelabs.com id
	B7/B6-00431-F15BD605; Thu, 04 Oct 2012 16:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-206.messagelabs.com!1349367070!21083412!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21130 invoked from network); 4 Oct 2012 16:11:11 -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;
	4 Oct 2012 16:11:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo0z-0004ll-Uy
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo0z-0005Uu-Ns
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:09 +0000
Message-Id: <E1TJo0z-0005Uu-Ns@xenbits.xen.org>
Date: Thu, 04 Oct 2012 16:11:09 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] VT-d: split .ack and .disable
	DMA-MSI actors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1349339737 -7200
# Node ID 90fcc034c1a89b21631cdffb0248f28c7b3cfe50
# Parent  16e98ef904f97e1a824c1d67a2a78e928dca89cf
VT-d: split .ack and .disable DMA-MSI actors

Calling irq_complete_move() from .disable is wrong, breaking S3 resume.

Comparing with all other .ack actors, it was also missing a call to
move_{native,masked}_irq(). As the actor is masking its interrupt
anyway (albeit it's not immediately obvious why), the latter is the
better choice.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by Xiantao Zhang <xiantao.zhang@intel.com>
xen-unstable changeset: 25836:7d216f026f71
xen-unstable date: Mon Sep 10 07:45:30 UTC 2012
---


diff -r 16e98ef904f9 -r 90fcc034c1a8 xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Thu Oct 04 10:34:29 2012 +0200
+++ b/xen/drivers/passthrough/vtd/iommu.c	Thu Oct 04 10:35:37 2012 +0200
@@ -1017,9 +1017,6 @@ static void dma_msi_mask(unsigned int ir
 {
     unsigned long flags;
     struct iommu *iommu = irq_to_iommu[irq];
-    struct irq_desc *desc = irq_to_desc(irq);
-
-    irq_complete_move(&desc);
 
     /* mask it */
     spin_lock_irqsave(&iommu->register_lock, flags);
@@ -1033,6 +1030,15 @@ static unsigned int dma_msi_startup(unsi
     return 0;
 }
 
+static void dma_msi_ack(unsigned int irq)
+{
+    struct irq_desc *desc = irq_to_desc(irq);
+
+    irq_complete_move(&desc);
+    dma_msi_mask(irq);
+    move_masked_irq(irq);
+}
+
 static void dma_msi_end(unsigned int irq, u8 vector)
 {
     dma_msi_unmask(irq);
@@ -1097,7 +1103,7 @@ static hw_irq_controller dma_msi_type = 
     .shutdown = dma_msi_mask,
     .enable = dma_msi_unmask,
     .disable = dma_msi_mask,
-    .ack = dma_msi_mask,
+    .ack = dma_msi_ack,
     .end = dma_msi_end,
     .set_affinity = dma_msi_set_affinity,
 };

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

From xen-changelog-bounces@lists.xen.org Thu Oct 04 16:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 04 Oct 2012 16:11:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TJo13-0003SG-Qv; Thu, 04 Oct 2012 16:11:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo12-0003Ri-ND
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:13 +0000
Received: from [85.158.139.211:12932] by server-7.bemta-5.messagelabs.com id
	B7/B6-00431-F15BD605; Thu, 04 Oct 2012 16:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-206.messagelabs.com!1349367070!21083412!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21130 invoked from network); 4 Oct 2012 16:11:11 -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;
	4 Oct 2012 16:11:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo0z-0004ll-Uy
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo0z-0005Uu-Ns
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:09 +0000
Message-Id: <E1TJo0z-0005Uu-Ns@xenbits.xen.org>
Date: Thu, 04 Oct 2012 16:11:09 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] VT-d: split .ack and .disable
	DMA-MSI actors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1349339737 -7200
# Node ID 90fcc034c1a89b21631cdffb0248f28c7b3cfe50
# Parent  16e98ef904f97e1a824c1d67a2a78e928dca89cf
VT-d: split .ack and .disable DMA-MSI actors

Calling irq_complete_move() from .disable is wrong, breaking S3 resume.

Comparing with all other .ack actors, it was also missing a call to
move_{native,masked}_irq(). As the actor is masking its interrupt
anyway (albeit it's not immediately obvious why), the latter is the
better choice.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by Xiantao Zhang <xiantao.zhang@intel.com>
xen-unstable changeset: 25836:7d216f026f71
xen-unstable date: Mon Sep 10 07:45:30 UTC 2012
---


diff -r 16e98ef904f9 -r 90fcc034c1a8 xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Thu Oct 04 10:34:29 2012 +0200
+++ b/xen/drivers/passthrough/vtd/iommu.c	Thu Oct 04 10:35:37 2012 +0200
@@ -1017,9 +1017,6 @@ static void dma_msi_mask(unsigned int ir
 {
     unsigned long flags;
     struct iommu *iommu = irq_to_iommu[irq];
-    struct irq_desc *desc = irq_to_desc(irq);
-
-    irq_complete_move(&desc);
 
     /* mask it */
     spin_lock_irqsave(&iommu->register_lock, flags);
@@ -1033,6 +1030,15 @@ static unsigned int dma_msi_startup(unsi
     return 0;
 }
 
+static void dma_msi_ack(unsigned int irq)
+{
+    struct irq_desc *desc = irq_to_desc(irq);
+
+    irq_complete_move(&desc);
+    dma_msi_mask(irq);
+    move_masked_irq(irq);
+}
+
 static void dma_msi_end(unsigned int irq, u8 vector)
 {
     dma_msi_unmask(irq);
@@ -1097,7 +1103,7 @@ static hw_irq_controller dma_msi_type = 
     .shutdown = dma_msi_mask,
     .enable = dma_msi_unmask,
     .disable = dma_msi_mask,
-    .ack = dma_msi_mask,
+    .ack = dma_msi_ack,
     .end = dma_msi_end,
     .set_affinity = dma_msi_set_affinity,
 };

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

From xen-changelog-bounces@lists.xen.org Thu Oct 04 16:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 04 Oct 2012 16:11:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TJo15-0003Sr-W9; Thu, 04 Oct 2012 16:11:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo13-0003S6-QV
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:14 +0000
Received: from [85.158.143.99:5471] by server-3.bemta-4.messagelabs.com id
	40/6F-10986-125BD605; Thu, 04 Oct 2012 16:11:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1349367071!26447156!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23532 invoked from network); 4 Oct 2012 16:11:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2012 16:11:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo10-0004lr-Rl
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo10-0005VO-NI
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:10 +0000
Message-Id: <E1TJo10-0005VO-NI@xenbits.xen.org>
Date: Thu, 04 Oct 2012 16:11:10 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86: tighten checks in
	XEN_DOMCTL_memory_mapping handler
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1349339895 -7200
# Node ID addf106cc90fb8a82d87964c6e4ffd29863c2bc1
# Parent  ab6d1c5270024005541a2caccad0b518457e510f
x86: tighten checks in XEN_DOMCTL_memory_mapping handler

Properly checking the MFN implies knowing the physical address width
supported by the platform, so to obtain this consistently the
respective code gets moved out of the MTRR subdir.

Btw., the model specific workaround in that code is likely unnecessary
- I believe those CPU models don't support 64-bit mode. But I wasn't
able to formally verify this, so I preferred to retain that code for
now.

But domctl code here also was lacking other error checks (as was,
looking at it again from that angle) the XEN_DOMCTL_ioport_mapping one.
Besides adding the missing checks, printing is also added for the case
where revoking access permissions didn't work (as that may have
implications for the host operator, e.g. wanting to not pass through
affected devices to another guest until the one previously using them
did actually die).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25931:149805919569
xen-unstable date: Thu Sep 20 07:21:53 UTC 2012
---


diff -r ab6d1c527002 -r addf106cc90f xen/arch/x86/cpu/centaur.c
--- a/xen/arch/x86/cpu/centaur.c	Thu Oct 04 10:37:19 2012 +0200
+++ b/xen/arch/x86/cpu/centaur.c	Thu Oct 04 10:38:15 2012 +0200
@@ -56,6 +56,9 @@ static void __init init_c3(struct cpuinf
 	if (c->x86_model >=6 && c->x86_model <9)
 		set_bit(X86_FEATURE_3DNOW, c->x86_capability);
 
+	if (cpuid_eax(0x80000000) < 0x80000008)
+		paddr_bits = 32;
+
 	get_model_name(c);
 	display_cacheinfo(c);
 }
diff -r ab6d1c527002 -r addf106cc90f xen/arch/x86/cpu/common.c
--- a/xen/arch/x86/cpu/common.c	Thu Oct 04 10:37:19 2012 +0200
+++ b/xen/arch/x86/cpu/common.c	Thu Oct 04 10:38:15 2012 +0200
@@ -43,6 +43,8 @@ integer_param("cpuid_mask_ext_edx", opt_
 
 struct cpu_dev * cpu_devs[X86_VENDOR_NUM] = {};
 
+unsigned int paddr_bits __read_mostly = 36;
+
 /*
  * Default host IA32_CR_PAT value to cover all memory types.
  * BIOS usually sets it to 0x07040600070406.
@@ -319,6 +321,8 @@ void __cpuinit generic_identify(struct c
 			}
 			if ( xlvl >= 0x80000004 )
 				get_model_name(c); /* Default name */
+			if ( xlvl >= 0x80000008 )
+				paddr_bits = cpuid_eax(0x80000008) & 0xff;
 		}
 
 		/* Intel-defined flags: level 0x00000007 */
diff -r ab6d1c527002 -r addf106cc90f xen/arch/x86/cpu/cyrix.c
--- a/xen/arch/x86/cpu/cyrix.c	Thu Oct 04 10:37:19 2012 +0200
+++ b/xen/arch/x86/cpu/cyrix.c	Thu Oct 04 10:38:15 2012 +0200
@@ -303,7 +303,9 @@ static void __init init_cyrix(struct cpu
 	}
 	safe_strcpy(c->x86_model_id, Cx86_model[dir0_msn & 7]);
 	if (p) safe_strcat(c->x86_model_id, p);
-	return;
+
+	if (cpu_has_cyrix_arr)
+		paddr_bits = 32;
 }
 
 /*
diff -r ab6d1c527002 -r addf106cc90f xen/arch/x86/cpu/intel.c
--- a/xen/arch/x86/cpu/intel.c	Thu Oct 04 10:37:19 2012 +0200
+++ b/xen/arch/x86/cpu/intel.c	Thu Oct 04 10:38:15 2012 +0200
@@ -145,6 +145,11 @@ void __devinit early_intel_workaround(st
 			printk("revised cpuid_level = %d\n", c->cpuid_level);
 		}
 	}
+
+	/* CPUID workaround for Intel 0F33/0F34 CPU */
+	if (boot_cpu_data.x86 == 0xF && boot_cpu_data.x86_model == 3 &&
+	    (boot_cpu_data.x86_mask == 3 || boot_cpu_data.x86_mask == 4))
+		paddr_bits = 36;
 }
 
 /*
diff -r ab6d1c527002 -r addf106cc90f xen/arch/x86/cpu/mtrr/main.c
--- a/xen/arch/x86/cpu/mtrr/main.c	Thu Oct 04 10:37:19 2012 +0200
+++ b/xen/arch/x86/cpu/mtrr/main.c	Thu Oct 04 10:38:15 2012 +0200
@@ -600,8 +600,6 @@ struct mtrr_value {
 	unsigned long	lsize;
 };
 
-unsigned int paddr_bits __read_mostly = 36;
-
 /**
  * mtrr_bp_init - initialize mtrrs on the boot CPU
  *
@@ -615,48 +613,12 @@ void __init mtrr_bp_init(void)
 
 	if (cpu_has_mtrr) {
 		mtrr_if = &generic_mtrr_ops;
-		size_or_mask = 0xff000000;	/* 36 bits */
-		size_and_mask = 0x00f00000;
-
-		/* This is an AMD specific MSR, but we assume(hope?) that
-		   Intel will implement it to when they extend the address
-		   bus of the Xeon. */
-		if (cpuid_eax(0x80000000) >= 0x80000008) {
-			paddr_bits = cpuid_eax(0x80000008) & 0xff;
-			/* CPUID workaround for Intel 0F33/0F34 CPU */
-			if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
-			    boot_cpu_data.x86 == 0xF &&
-			    boot_cpu_data.x86_model == 0x3 &&
-			    (boot_cpu_data.x86_mask == 0x3 ||
-			     boot_cpu_data.x86_mask == 0x4))
-				paddr_bits = 36;
-
-			size_or_mask = ~((1ULL << (paddr_bits - PAGE_SHIFT)) - 1);
-			size_and_mask = ~size_or_mask & 0xfffff00000ULL;
-		} else if (boot_cpu_data.x86_vendor == X86_VENDOR_CENTAUR &&
-			   boot_cpu_data.x86 == 6) {
-			/* VIA C* family have Intel style MTRRs, but
-			   don't support PAE */
-			size_or_mask = 0xfff00000;	/* 32 bits */
-			size_and_mask = 0;
-		}
 	} else {
 #ifndef CONFIG_X86_64
 		switch (boot_cpu_data.x86_vendor) {
-		case X86_VENDOR_AMD:
-			if (cpu_has_k6_mtrr) {
-				/* Pre-Athlon (K6) AMD CPU MTRRs */
-				mtrr_if = mtrr_ops[X86_VENDOR_AMD];
-				size_or_mask = 0xfff00000;	/* 32 bits */
-				size_and_mask = 0;
-			}
-			break;
 		case X86_VENDOR_CYRIX:
-			if (cpu_has_cyrix_arr) {
+			if (cpu_has_cyrix_arr)
 				mtrr_if = mtrr_ops[X86_VENDOR_CYRIX];
-				size_or_mask = 0xfff00000;	/* 32 bits */
-				size_and_mask = 0;
-			}
 			break;
 		default:
 			break;
@@ -665,6 +627,8 @@ void __init mtrr_bp_init(void)
 	}
 
 	if (mtrr_if) {
+		size_or_mask = ~((1ULL << (paddr_bits - PAGE_SHIFT)) - 1);
+		size_and_mask = ~size_or_mask & 0xfffff00000ULL;
 		set_num_var_ranges();
 		init_table();
 		if (use_intel())
diff -r ab6d1c527002 -r addf106cc90f xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Thu Oct 04 10:37:19 2012 +0200
+++ b/xen/arch/x86/domctl.c	Thu Oct 04 10:38:15 2012 +0200
@@ -962,10 +962,12 @@ long arch_do_domctl(
         unsigned long gfn = domctl->u.memory_mapping.first_gfn;
         unsigned long mfn = domctl->u.memory_mapping.first_mfn;
         unsigned long nr_mfns = domctl->u.memory_mapping.nr_mfns;
-        int i;
+        unsigned long i;
 
         ret = -EINVAL;
-        if ( (mfn + nr_mfns - 1) < mfn ) /* wrap? */
+        if ( (mfn + nr_mfns - 1) < mfn || /* wrap? */
+             ((mfn | (mfn + nr_mfns - 1)) >> (paddr_bits - PAGE_SHIFT)) ||
+             (gfn + nr_mfns - 1) < gfn ) /* wrap? */
             break;
 
         ret = -EPERM;
@@ -985,18 +987,47 @@ long arch_do_domctl(
                 gfn, mfn, nr_mfns);
 
             ret = iomem_permit_access(d, mfn, mfn + nr_mfns - 1);
-            for ( i = 0; i < nr_mfns; i++ )
-                set_mmio_p2m_entry(p2m_get_hostp2m(d), gfn+i, _mfn(mfn+i));
+            if ( !ret && paging_mode_translate(d) )
+            {
+                struct p2m_domain *p2m = p2m_get_hostp2m(d);
+
+                for ( i = 0; !ret && i < nr_mfns; i++ )
+                    if ( !set_mmio_p2m_entry(p2m, gfn + i, _mfn(mfn + i)) )
+                        ret = -EIO;
+                if ( ret )
+                {
+                    printk(XENLOG_G_WARNING
+                           "memory_map:fail: dom%d gfn=%lx mfn=%lx\n",
+                           d->domain_id, gfn + i, mfn + i);
+                    while ( i-- )
+                        clear_mmio_p2m_entry(p2m, gfn + i);
+                    if ( iomem_deny_access(d, mfn, mfn + nr_mfns - 1) &&
+                         IS_PRIV(current->domain) )
+                        printk(XENLOG_ERR
+                               "memory_map: failed to deny dom%d access to [%lx,%lx]\n",
+                               d->domain_id, mfn, mfn + nr_mfns - 1);
+                }
+            }
         }
         else
         {
+            bool_t acc = 0;
+
             gdprintk(XENLOG_INFO,
                 "memory_map:remove: gfn=%lx mfn=%lx nr_mfns=%lx\n",
                  gfn, mfn, nr_mfns);
 
-            for ( i = 0; i < nr_mfns; i++ )
-                clear_mmio_p2m_entry(p2m_get_hostp2m(d), gfn+i);
+            if ( paging_mode_translate(d) )
+                for ( i = 0; i < nr_mfns; i++ )
+                    acc |= !clear_mmio_p2m_entry(p2m_get_hostp2m(d), gfn + i);
             ret = iomem_deny_access(d, mfn, mfn + nr_mfns - 1);
+            if ( !ret && acc )
+                ret = -EIO;
+            if ( ret && IS_PRIV(current->domain) )
+                printk(XENLOG_ERR
+                       "memory_map: error %ld %s dom%d access to [%lx,%lx]\n",
+                       ret, acc ? "removing" : "denying", d->domain_id,
+                       mfn, mfn + nr_mfns - 1);
         }
 
         rcu_unlock_domain(d);
@@ -1051,12 +1082,23 @@ long arch_do_domctl(
             if ( !found )
             {
                 g2m_ioport = xmalloc(struct g2m_ioport);
+                if ( !g2m_ioport )
+                    ret = -ENOMEM;
+            }
+            if ( !found && !ret )
+            {
                 g2m_ioport->gport = fgp;
                 g2m_ioport->mport = fmp;
                 g2m_ioport->np = np;
                 list_add_tail(&g2m_ioport->list, &hd->g2m_ioport_list);
             }
-            ret = ioports_permit_access(d, fmp, fmp + np - 1);
+            if ( !ret )
+                ret = ioports_permit_access(d, fmp, fmp + np - 1);
+            if ( ret && !found && g2m_ioport )
+            {
+                list_del(&g2m_ioport->list);
+                xfree(g2m_ioport);
+            }
         }
         else
         {
@@ -1071,6 +1113,10 @@ long arch_do_domctl(
                     break;
                 }
             ret = ioports_deny_access(d, fmp, fmp + np - 1);
+            if ( ret && IS_PRIV(current->domain) )
+                printk(XENLOG_ERR
+                       "ioport_map: error %ld denying dom%d access to [%x,%x]\n",
+                       ret, d->domain_id, fmp, fmp + np - 1);
         }
         rcu_unlock_domain(d);
     }

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

From xen-changelog-bounces@lists.xen.org Thu Oct 04 16:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 04 Oct 2012 16:11:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TJo15-0003Sr-W9; Thu, 04 Oct 2012 16:11:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo13-0003S6-QV
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:14 +0000
Received: from [85.158.143.99:5471] by server-3.bemta-4.messagelabs.com id
	40/6F-10986-125BD605; Thu, 04 Oct 2012 16:11:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1349367071!26447156!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23532 invoked from network); 4 Oct 2012 16:11:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2012 16:11:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo10-0004lr-Rl
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo10-0005VO-NI
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:10 +0000
Message-Id: <E1TJo10-0005VO-NI@xenbits.xen.org>
Date: Thu, 04 Oct 2012 16:11:10 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86: tighten checks in
	XEN_DOMCTL_memory_mapping handler
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1349339895 -7200
# Node ID addf106cc90fb8a82d87964c6e4ffd29863c2bc1
# Parent  ab6d1c5270024005541a2caccad0b518457e510f
x86: tighten checks in XEN_DOMCTL_memory_mapping handler

Properly checking the MFN implies knowing the physical address width
supported by the platform, so to obtain this consistently the
respective code gets moved out of the MTRR subdir.

Btw., the model specific workaround in that code is likely unnecessary
- I believe those CPU models don't support 64-bit mode. But I wasn't
able to formally verify this, so I preferred to retain that code for
now.

But domctl code here also was lacking other error checks (as was,
looking at it again from that angle) the XEN_DOMCTL_ioport_mapping one.
Besides adding the missing checks, printing is also added for the case
where revoking access permissions didn't work (as that may have
implications for the host operator, e.g. wanting to not pass through
affected devices to another guest until the one previously using them
did actually die).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25931:149805919569
xen-unstable date: Thu Sep 20 07:21:53 UTC 2012
---


diff -r ab6d1c527002 -r addf106cc90f xen/arch/x86/cpu/centaur.c
--- a/xen/arch/x86/cpu/centaur.c	Thu Oct 04 10:37:19 2012 +0200
+++ b/xen/arch/x86/cpu/centaur.c	Thu Oct 04 10:38:15 2012 +0200
@@ -56,6 +56,9 @@ static void __init init_c3(struct cpuinf
 	if (c->x86_model >=6 && c->x86_model <9)
 		set_bit(X86_FEATURE_3DNOW, c->x86_capability);
 
+	if (cpuid_eax(0x80000000) < 0x80000008)
+		paddr_bits = 32;
+
 	get_model_name(c);
 	display_cacheinfo(c);
 }
diff -r ab6d1c527002 -r addf106cc90f xen/arch/x86/cpu/common.c
--- a/xen/arch/x86/cpu/common.c	Thu Oct 04 10:37:19 2012 +0200
+++ b/xen/arch/x86/cpu/common.c	Thu Oct 04 10:38:15 2012 +0200
@@ -43,6 +43,8 @@ integer_param("cpuid_mask_ext_edx", opt_
 
 struct cpu_dev * cpu_devs[X86_VENDOR_NUM] = {};
 
+unsigned int paddr_bits __read_mostly = 36;
+
 /*
  * Default host IA32_CR_PAT value to cover all memory types.
  * BIOS usually sets it to 0x07040600070406.
@@ -319,6 +321,8 @@ void __cpuinit generic_identify(struct c
 			}
 			if ( xlvl >= 0x80000004 )
 				get_model_name(c); /* Default name */
+			if ( xlvl >= 0x80000008 )
+				paddr_bits = cpuid_eax(0x80000008) & 0xff;
 		}
 
 		/* Intel-defined flags: level 0x00000007 */
diff -r ab6d1c527002 -r addf106cc90f xen/arch/x86/cpu/cyrix.c
--- a/xen/arch/x86/cpu/cyrix.c	Thu Oct 04 10:37:19 2012 +0200
+++ b/xen/arch/x86/cpu/cyrix.c	Thu Oct 04 10:38:15 2012 +0200
@@ -303,7 +303,9 @@ static void __init init_cyrix(struct cpu
 	}
 	safe_strcpy(c->x86_model_id, Cx86_model[dir0_msn & 7]);
 	if (p) safe_strcat(c->x86_model_id, p);
-	return;
+
+	if (cpu_has_cyrix_arr)
+		paddr_bits = 32;
 }
 
 /*
diff -r ab6d1c527002 -r addf106cc90f xen/arch/x86/cpu/intel.c
--- a/xen/arch/x86/cpu/intel.c	Thu Oct 04 10:37:19 2012 +0200
+++ b/xen/arch/x86/cpu/intel.c	Thu Oct 04 10:38:15 2012 +0200
@@ -145,6 +145,11 @@ void __devinit early_intel_workaround(st
 			printk("revised cpuid_level = %d\n", c->cpuid_level);
 		}
 	}
+
+	/* CPUID workaround for Intel 0F33/0F34 CPU */
+	if (boot_cpu_data.x86 == 0xF && boot_cpu_data.x86_model == 3 &&
+	    (boot_cpu_data.x86_mask == 3 || boot_cpu_data.x86_mask == 4))
+		paddr_bits = 36;
 }
 
 /*
diff -r ab6d1c527002 -r addf106cc90f xen/arch/x86/cpu/mtrr/main.c
--- a/xen/arch/x86/cpu/mtrr/main.c	Thu Oct 04 10:37:19 2012 +0200
+++ b/xen/arch/x86/cpu/mtrr/main.c	Thu Oct 04 10:38:15 2012 +0200
@@ -600,8 +600,6 @@ struct mtrr_value {
 	unsigned long	lsize;
 };
 
-unsigned int paddr_bits __read_mostly = 36;
-
 /**
  * mtrr_bp_init - initialize mtrrs on the boot CPU
  *
@@ -615,48 +613,12 @@ void __init mtrr_bp_init(void)
 
 	if (cpu_has_mtrr) {
 		mtrr_if = &generic_mtrr_ops;
-		size_or_mask = 0xff000000;	/* 36 bits */
-		size_and_mask = 0x00f00000;
-
-		/* This is an AMD specific MSR, but we assume(hope?) that
-		   Intel will implement it to when they extend the address
-		   bus of the Xeon. */
-		if (cpuid_eax(0x80000000) >= 0x80000008) {
-			paddr_bits = cpuid_eax(0x80000008) & 0xff;
-			/* CPUID workaround for Intel 0F33/0F34 CPU */
-			if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
-			    boot_cpu_data.x86 == 0xF &&
-			    boot_cpu_data.x86_model == 0x3 &&
-			    (boot_cpu_data.x86_mask == 0x3 ||
-			     boot_cpu_data.x86_mask == 0x4))
-				paddr_bits = 36;
-
-			size_or_mask = ~((1ULL << (paddr_bits - PAGE_SHIFT)) - 1);
-			size_and_mask = ~size_or_mask & 0xfffff00000ULL;
-		} else if (boot_cpu_data.x86_vendor == X86_VENDOR_CENTAUR &&
-			   boot_cpu_data.x86 == 6) {
-			/* VIA C* family have Intel style MTRRs, but
-			   don't support PAE */
-			size_or_mask = 0xfff00000;	/* 32 bits */
-			size_and_mask = 0;
-		}
 	} else {
 #ifndef CONFIG_X86_64
 		switch (boot_cpu_data.x86_vendor) {
-		case X86_VENDOR_AMD:
-			if (cpu_has_k6_mtrr) {
-				/* Pre-Athlon (K6) AMD CPU MTRRs */
-				mtrr_if = mtrr_ops[X86_VENDOR_AMD];
-				size_or_mask = 0xfff00000;	/* 32 bits */
-				size_and_mask = 0;
-			}
-			break;
 		case X86_VENDOR_CYRIX:
-			if (cpu_has_cyrix_arr) {
+			if (cpu_has_cyrix_arr)
 				mtrr_if = mtrr_ops[X86_VENDOR_CYRIX];
-				size_or_mask = 0xfff00000;	/* 32 bits */
-				size_and_mask = 0;
-			}
 			break;
 		default:
 			break;
@@ -665,6 +627,8 @@ void __init mtrr_bp_init(void)
 	}
 
 	if (mtrr_if) {
+		size_or_mask = ~((1ULL << (paddr_bits - PAGE_SHIFT)) - 1);
+		size_and_mask = ~size_or_mask & 0xfffff00000ULL;
 		set_num_var_ranges();
 		init_table();
 		if (use_intel())
diff -r ab6d1c527002 -r addf106cc90f xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Thu Oct 04 10:37:19 2012 +0200
+++ b/xen/arch/x86/domctl.c	Thu Oct 04 10:38:15 2012 +0200
@@ -962,10 +962,12 @@ long arch_do_domctl(
         unsigned long gfn = domctl->u.memory_mapping.first_gfn;
         unsigned long mfn = domctl->u.memory_mapping.first_mfn;
         unsigned long nr_mfns = domctl->u.memory_mapping.nr_mfns;
-        int i;
+        unsigned long i;
 
         ret = -EINVAL;
-        if ( (mfn + nr_mfns - 1) < mfn ) /* wrap? */
+        if ( (mfn + nr_mfns - 1) < mfn || /* wrap? */
+             ((mfn | (mfn + nr_mfns - 1)) >> (paddr_bits - PAGE_SHIFT)) ||
+             (gfn + nr_mfns - 1) < gfn ) /* wrap? */
             break;
 
         ret = -EPERM;
@@ -985,18 +987,47 @@ long arch_do_domctl(
                 gfn, mfn, nr_mfns);
 
             ret = iomem_permit_access(d, mfn, mfn + nr_mfns - 1);
-            for ( i = 0; i < nr_mfns; i++ )
-                set_mmio_p2m_entry(p2m_get_hostp2m(d), gfn+i, _mfn(mfn+i));
+            if ( !ret && paging_mode_translate(d) )
+            {
+                struct p2m_domain *p2m = p2m_get_hostp2m(d);
+
+                for ( i = 0; !ret && i < nr_mfns; i++ )
+                    if ( !set_mmio_p2m_entry(p2m, gfn + i, _mfn(mfn + i)) )
+                        ret = -EIO;
+                if ( ret )
+                {
+                    printk(XENLOG_G_WARNING
+                           "memory_map:fail: dom%d gfn=%lx mfn=%lx\n",
+                           d->domain_id, gfn + i, mfn + i);
+                    while ( i-- )
+                        clear_mmio_p2m_entry(p2m, gfn + i);
+                    if ( iomem_deny_access(d, mfn, mfn + nr_mfns - 1) &&
+                         IS_PRIV(current->domain) )
+                        printk(XENLOG_ERR
+                               "memory_map: failed to deny dom%d access to [%lx,%lx]\n",
+                               d->domain_id, mfn, mfn + nr_mfns - 1);
+                }
+            }
         }
         else
         {
+            bool_t acc = 0;
+
             gdprintk(XENLOG_INFO,
                 "memory_map:remove: gfn=%lx mfn=%lx nr_mfns=%lx\n",
                  gfn, mfn, nr_mfns);
 
-            for ( i = 0; i < nr_mfns; i++ )
-                clear_mmio_p2m_entry(p2m_get_hostp2m(d), gfn+i);
+            if ( paging_mode_translate(d) )
+                for ( i = 0; i < nr_mfns; i++ )
+                    acc |= !clear_mmio_p2m_entry(p2m_get_hostp2m(d), gfn + i);
             ret = iomem_deny_access(d, mfn, mfn + nr_mfns - 1);
+            if ( !ret && acc )
+                ret = -EIO;
+            if ( ret && IS_PRIV(current->domain) )
+                printk(XENLOG_ERR
+                       "memory_map: error %ld %s dom%d access to [%lx,%lx]\n",
+                       ret, acc ? "removing" : "denying", d->domain_id,
+                       mfn, mfn + nr_mfns - 1);
         }
 
         rcu_unlock_domain(d);
@@ -1051,12 +1082,23 @@ long arch_do_domctl(
             if ( !found )
             {
                 g2m_ioport = xmalloc(struct g2m_ioport);
+                if ( !g2m_ioport )
+                    ret = -ENOMEM;
+            }
+            if ( !found && !ret )
+            {
                 g2m_ioport->gport = fgp;
                 g2m_ioport->mport = fmp;
                 g2m_ioport->np = np;
                 list_add_tail(&g2m_ioport->list, &hd->g2m_ioport_list);
             }
-            ret = ioports_permit_access(d, fmp, fmp + np - 1);
+            if ( !ret )
+                ret = ioports_permit_access(d, fmp, fmp + np - 1);
+            if ( ret && !found && g2m_ioport )
+            {
+                list_del(&g2m_ioport->list);
+                xfree(g2m_ioport);
+            }
         }
         else
         {
@@ -1071,6 +1113,10 @@ long arch_do_domctl(
                     break;
                 }
             ret = ioports_deny_access(d, fmp, fmp + np - 1);
+            if ( ret && IS_PRIV(current->domain) )
+                printk(XENLOG_ERR
+                       "ioport_map: error %ld denying dom%d access to [%x,%x]\n",
+                       ret, d->domain_id, fmp, fmp + np - 1);
         }
         rcu_unlock_domain(d);
     }

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

From xen-changelog-bounces@lists.xen.org Thu Oct 04 16:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 04 Oct 2012 16:11:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TJo16-0003Sw-2X; Thu, 04 Oct 2012 16:11:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo13-0003S2-SC
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:14 +0000
Received: from [85.158.138.51:2881] by server-13.bemta-3.messagelabs.com id
	A7/9B-28885-125BD605; Thu, 04 Oct 2012 16:11:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1349367071!33062023!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30258 invoked from network); 4 Oct 2012 16:11:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2012 16:11:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo11-0004lu-90
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo11-0005Vd-7n
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:11 +0000
Message-Id: <E1TJo11-0005Vd-7n@xenbits.xen.org>
Date: Thu, 04 Oct 2012 16:11:10 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86: check remote MMIO remap
	permissions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1349340283 -7200
# Node ID a15596a619ed738c163c08d3ec275c8880890c52
# Parent  addf106cc90fb8a82d87964c6e4ffd29863c2bc1
x86: check remote MMIO remap permissions

When a domain is mapping pages from a different pg_owner domain, the
iomem_access checks are currently only applied to the pg_owner domain,
potentially allowing a domain with a more restrictive iomem_access
policy to have the pages mapped into its page tables. To catch this,
also check the owner of the page tables. The current domain does not
need to be checked because the ability to manipulate a domain's page
tables implies full access to the target domain, so checking that
domain's permission is sufficient.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 25952:8278d7d8fa48
xen-unstable date: Wed Sep 26 09:56:07 UTC 2012
---


diff -r addf106cc90f -r a15596a619ed xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Thu Oct 04 10:38:15 2012 +0200
+++ b/xen/arch/x86/mm.c	Thu Oct 04 10:44:43 2012 +0200
@@ -827,6 +827,16 @@ get_page_from_l1e(
             return 0;
         }
 
+        if ( pg_owner != l1e_owner &&
+             !iomem_access_permitted(l1e_owner, mfn, mfn) )
+        {
+            if ( mfn != (PADDR_MASK >> PAGE_SHIFT) ) /* INVALID_MFN? */
+                MEM_LOG("Dom%u attempted to map I/O space %08lx in dom%u to dom%u",
+                        curr->domain->domain_id, mfn, pg_owner->domain_id,
+                        l1e_owner->domain_id);
+            return 0;
+        }
+
         if ( !(l1f & _PAGE_RW) || IS_PRIV(pg_owner) ||
              !rangeset_contains_singleton(mmio_ro_ranges, mfn) )
             return 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 04 16:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 04 Oct 2012 16:11:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TJo16-0003Sw-2X; Thu, 04 Oct 2012 16:11:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo13-0003S2-SC
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:14 +0000
Received: from [85.158.138.51:2881] by server-13.bemta-3.messagelabs.com id
	A7/9B-28885-125BD605; Thu, 04 Oct 2012 16:11:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1349367071!33062023!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30258 invoked from network); 4 Oct 2012 16:11:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2012 16:11:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo11-0004lu-90
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo11-0005Vd-7n
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:11 +0000
Message-Id: <E1TJo11-0005Vd-7n@xenbits.xen.org>
Date: Thu, 04 Oct 2012 16:11:10 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86: check remote MMIO remap
	permissions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1349340283 -7200
# Node ID a15596a619ed738c163c08d3ec275c8880890c52
# Parent  addf106cc90fb8a82d87964c6e4ffd29863c2bc1
x86: check remote MMIO remap permissions

When a domain is mapping pages from a different pg_owner domain, the
iomem_access checks are currently only applied to the pg_owner domain,
potentially allowing a domain with a more restrictive iomem_access
policy to have the pages mapped into its page tables. To catch this,
also check the owner of the page tables. The current domain does not
need to be checked because the ability to manipulate a domain's page
tables implies full access to the target domain, so checking that
domain's permission is sufficient.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 25952:8278d7d8fa48
xen-unstable date: Wed Sep 26 09:56:07 UTC 2012
---


diff -r addf106cc90f -r a15596a619ed xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Thu Oct 04 10:38:15 2012 +0200
+++ b/xen/arch/x86/mm.c	Thu Oct 04 10:44:43 2012 +0200
@@ -827,6 +827,16 @@ get_page_from_l1e(
             return 0;
         }
 
+        if ( pg_owner != l1e_owner &&
+             !iomem_access_permitted(l1e_owner, mfn, mfn) )
+        {
+            if ( mfn != (PADDR_MASK >> PAGE_SHIFT) ) /* INVALID_MFN? */
+                MEM_LOG("Dom%u attempted to map I/O space %08lx in dom%u to dom%u",
+                        curr->domain->domain_id, mfn, pg_owner->domain_id,
+                        l1e_owner->domain_id);
+            return 0;
+        }
+
         if ( !(l1f & _PAGE_RW) || IS_PRIV(pg_owner) ||
              !rangeset_contains_singleton(mmio_ro_ranges, mfn) )
             return 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 04 16:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 04 Oct 2012 16:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TJo13-0003SB-Nv; Thu, 04 Oct 2012 16:11:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo12-0003Rd-0t
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:12 +0000
Received: from [85.158.137.99:64578] by server-3.bemta-3.messagelabs.com id
	44/B8-25962-F15BD605; Thu, 04 Oct 2012 16:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-217.messagelabs.com!1349367068!20320968!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24564 invoked from network); 4 Oct 2012 16:11:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2012 16:11:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo0y-0004lc-In
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo0y-0005Tf-60
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:08 +0000
Message-Id: <E1TJo0y-0005Tf-60@xenbits.xen.org>
Date: Thu, 04 Oct 2012 16:11:07 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] make domain_create() return a
	proper error code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

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

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

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25808:4746414def65
xen-unstable date: Mon Sep  3 07:40:38 UTC 2012
---


diff -r fb0561ba7d9e -r b26ca2d8d52b xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Tue Sep 25 12:29:29 2012 +0200
+++ b/xen/arch/x86/mm.c	Thu Oct 04 10:28:09 2012 +0200
@@ -91,7 +91,7 @@
 #include <xen/mm.h>
 #include <xen/domain.h>
 #include <xen/sched.h>
-#include <xen/errno.h>
+#include <xen/err.h>
 #include <xen/perfc.h>
 #include <xen/irq.h>
 #include <xen/softirq.h>
@@ -279,7 +279,7 @@ void __init arch_init_memory(void)
      * their domain field set to dom_xen.
      */
     dom_xen = domain_create(DOMID_XEN, DOMCRF_dummy, 0);
-    BUG_ON(dom_xen == NULL);
+    BUG_ON(IS_ERR(dom_xen));
 
     /*
      * Initialise our DOMID_IO domain.
@@ -287,14 +287,14 @@ void __init arch_init_memory(void)
      * array. Mappings occur at the priv of the caller.
      */
     dom_io = domain_create(DOMID_IO, DOMCRF_dummy, 0);
-    BUG_ON(dom_io == NULL);
+    BUG_ON(IS_ERR(dom_io));
     
     /*
-     * Initialise our DOMID_IO domain.
+     * Initialise our COW domain.
      * This domain owns sharable pages.
      */
     dom_cow = domain_create(DOMID_COW, DOMCRF_dummy, 0);
-    BUG_ON(dom_cow == NULL);
+    BUG_ON(IS_ERR(dom_cow));
 
     /* First 1MB of RAM is historically marked as I/O. */
     for ( i = 0; i < 0x100; i++ )
diff -r fb0561ba7d9e -r b26ca2d8d52b xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c	Tue Sep 25 12:29:29 2012 +0200
+++ b/xen/arch/x86/setup.c	Thu Oct 04 10:28:09 2012 +0200
@@ -1,6 +1,7 @@
 #include <xen/config.h>
 #include <xen/init.h>
 #include <xen/lib.h>
+#include <xen/err.h>
 #include <xen/sched.h>
 #include <xen/sched-if.h>
 #include <xen/domain.h>
@@ -1277,7 +1278,7 @@ void __init __start_xen(unsigned long mb
 
     /* Create initial domain 0. */
     dom0 = domain_create(0, DOMCRF_s3_integrity, DOM0_SSIDREF);
-    if ( (dom0 == NULL) || (alloc_dom0_vcpu0() == NULL) )
+    if ( IS_ERR(dom0) || (alloc_dom0_vcpu0() == NULL) )
         panic("Error creating domain 0\n");
 
     dom0->is_privileged = 1;
diff -r fb0561ba7d9e -r b26ca2d8d52b xen/common/cpupool.c
--- a/xen/common/cpupool.c	Tue Sep 25 12:29:29 2012 +0200
+++ b/xen/common/cpupool.c	Thu Oct 04 10:28:09 2012 +0200
@@ -355,14 +355,18 @@ out:
 int cpupool_add_domain(struct domain *d, int poolid)
 {
     struct cpupool *c;
-    int rc = 1;
+    int rc;
     int n_dom = 0;
 
     if ( poolid == CPUPOOLID_NONE )
         return 0;
     spin_lock(&cpupool_lock);
     c = cpupool_find_by_id(poolid);
-    if ( (c != NULL) && cpus_weight(c->cpu_valid) )
+    if ( c == NULL )
+        rc = -ESRCH;
+    else if ( !cpus_weight(c->cpu_valid) )
+        rc = -ENODEV;
+    else
     {
         c->n_dom++;
         n_dom = c->n_dom;
diff -r fb0561ba7d9e -r b26ca2d8d52b xen/common/domain.c
--- a/xen/common/domain.c	Tue Sep 25 12:29:29 2012 +0200
+++ b/xen/common/domain.c	Thu Oct 04 10:28:09 2012 +0200
@@ -9,7 +9,7 @@
 #include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/ctype.h>
-#include <xen/errno.h>
+#include <xen/err.h>
 #include <xen/sched.h>
 #include <xen/domain.h>
 #include <xen/mm.h>
@@ -217,17 +217,17 @@ struct domain *domain_create(
     struct domain *d, **pd;
     enum { INIT_xsm = 1u<<0, INIT_watchdog = 1u<<1, INIT_rangeset = 1u<<2,
            INIT_evtchn = 1u<<3, INIT_gnttab = 1u<<4, INIT_arch = 1u<<5 };
-    int init_status = 0;
+    int err, init_status = 0;
     int poolid = CPUPOOLID_NONE;
 
     if ( (d = alloc_domain_struct()) == NULL )
-        return NULL;
+        return ERR_PTR(-ENOMEM);
 
     d->domain_id = domid;
 
     lock_profile_register_struct(LOCKPROF_TYPE_PERDOM, d, domid, "Domain");
 
-    if ( xsm_alloc_security_domain(d) != 0 )
+    if ( (err = xsm_alloc_security_domain(d)) != 0 )
         goto fail;
     init_status |= INIT_xsm;
 
@@ -261,14 +261,14 @@ struct domain *domain_create(
     d->iomem_caps = rangeset_new(d, "I/O Memory", RANGESETF_prettyprint_hex);
     d->irq_caps   = rangeset_new(d, "Interrupts", 0);
     if ( (d->iomem_caps == NULL) || (d->irq_caps == NULL) )
-        goto fail;
+        goto nomem;
 
     if ( domcr_flags & DOMCRF_dummy )
         return d;
 
     if ( !is_idle_domain(d) )
     {
-        if ( xsm_domain_create(d, ssidref) != 0 )
+        if ( (err = xsm_domain_create(d, ssidref)) != 0 )
             goto fail;
 
         d->is_paused_by_controller = 1;
@@ -285,29 +285,29 @@ struct domain *domain_create(
         d->pirq_mask = xmalloc_array(
             unsigned long, BITS_TO_LONGS(d->nr_pirqs));
         if ( (d->pirq_to_evtchn == NULL) || (d->pirq_mask == NULL) )
-            goto fail;
+            goto nomem;
         memset(d->pirq_to_evtchn, 0, d->nr_pirqs * sizeof(*d->pirq_to_evtchn));
         bitmap_zero(d->pirq_mask, d->nr_pirqs);
 
-        if ( evtchn_init(d) != 0 )
+        if ( (err = evtchn_init(d)) != 0 )
             goto fail;
         init_status |= INIT_evtchn;
 
-        if ( grant_table_create(d) != 0 )
+        if ( (err = grant_table_create(d)) != 0 )
             goto fail;
         init_status |= INIT_gnttab;
 
         poolid = 0;
     }
 
-    if ( arch_domain_create(d, domcr_flags) != 0 )
+    if ( (err = arch_domain_create(d, domcr_flags)) != 0 )
         goto fail;
     init_status |= INIT_arch;
 
-    if ( cpupool_add_domain(d, poolid) != 0 )
+    if ( (err = cpupool_add_domain(d, poolid)) != 0 )
         goto fail;
 
-    if ( sched_init_domain(d) != 0 )
+    if ( (err = sched_init_domain(d)) != 0 )
         goto fail;
 
     if ( !is_idle_domain(d) )
@@ -326,6 +326,8 @@ struct domain *domain_create(
 
     return d;
 
+ nomem:
+    err = -ENOMEM;
  fail:
     d->is_dying = DOMDYING_dead;
     atomic_set(&d->refcnt, DOMAIN_DESTROYED);
@@ -347,7 +349,7 @@ struct domain *domain_create(
     xfree(d->pirq_mask);
     xfree(d->pirq_to_evtchn);
     free_domain_struct(d);
-    return NULL;
+    return ERR_PTR(err);
 }
 
 
diff -r fb0561ba7d9e -r b26ca2d8d52b xen/common/domctl.c
--- a/xen/common/domctl.c	Tue Sep 25 12:29:29 2012 +0200
+++ b/xen/common/domctl.c	Thu Oct 04 10:28:09 2012 +0200
@@ -9,6 +9,7 @@
 #include <xen/config.h>
 #include <xen/types.h>
 #include <xen/lib.h>
+#include <xen/err.h>
 #include <xen/mm.h>
 #include <xen/sched.h>
 #include <xen/sched-if.h>
@@ -435,10 +436,12 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
         if ( op->u.createdomain.flags & XEN_DOMCTL_CDF_oos_off )
             domcr_flags |= DOMCRF_oos_off;
 
-        ret = -ENOMEM;
         d = domain_create(dom, domcr_flags, op->u.createdomain.ssidref);
-        if ( d == NULL )
+        if ( IS_ERR(d) )
+        {
+            ret = PTR_ERR(d);
             break;
+        }
 
         ret = 0;
 
diff -r fb0561ba7d9e -r b26ca2d8d52b xen/common/schedule.c
--- a/xen/common/schedule.c	Tue Sep 25 12:29:29 2012 +0200
+++ b/xen/common/schedule.c	Thu Oct 04 10:28:09 2012 +0200
@@ -28,7 +28,7 @@
 #include <xen/softirq.h>
 #include <xen/trace.h>
 #include <xen/mm.h>
-#include <xen/errno.h>
+#include <xen/err.h>
 #include <xen/guest_access.h>
 #include <xen/multicall.h>
 #include <xen/cpu.h>
@@ -1357,7 +1357,7 @@ void __init scheduler_init(void)
         panic("scheduler returned error on init\n");
 
     idle_domain = domain_create(DOMID_IDLE, 0, 0);
-    BUG_ON(idle_domain == NULL);
+    BUG_ON(IS_ERR(idle_domain));
     idle_domain->vcpu = idle_vcpu;
     idle_domain->max_vcpus = NR_CPUS;
     if ( alloc_vcpu(idle_domain, 0, 0) == NULL )
diff -r fb0561ba7d9e -r b26ca2d8d52b xen/include/xen/err.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/include/xen/err.h	Thu Oct 04 10:28:09 2012 +0200
@@ -0,0 +1,57 @@
+#if !defined(__XEN_ERR_H__) && !defined(__ASSEMBLY__)
+#define __XEN_ERR_H__
+
+#include <xen/compiler.h>
+#include <xen/errno.h>
+
+/*
+ * Kernel pointers have redundant information, so we can use a
+ * scheme where we can return either an error code or a dentry
+ * pointer with the same return value.
+ *
+ * This could be a per-architecture thing, to allow different
+ * error and pointer decisions.
+ */
+#define MAX_ERRNO	4095
+
+#define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO)
+
+static inline void *__must_check ERR_PTR(long error)
+{
+	return (void *)error;
+}
+
+static inline long __must_check PTR_ERR(const void *ptr)
+{
+	return (long)ptr;
+}
+
+static inline long __must_check IS_ERR(const void *ptr)
+{
+	return IS_ERR_VALUE((unsigned long)ptr);
+}
+
+static inline long __must_check IS_ERR_OR_NULL(const void *ptr)
+{
+	return !ptr || IS_ERR_VALUE((unsigned long)ptr);
+}
+
+/**
+ * ERR_CAST - Explicitly cast an error-valued pointer to another pointer type
+ * @ptr: The pointer to cast.
+ *
+ * Explicitly cast an error-valued pointer to another pointer type in such a
+ * way as to make it clear that's what's going on.
+ */
+static inline void * __must_check ERR_CAST(const void *ptr)
+{
+	/* cast away the const */
+	return (void *)ptr;
+}
+
+static inline int __must_check PTR_RET(const void *ptr)
+{
+	return IS_ERR(ptr) ? PTR_ERR(ptr) : 0;
+}
+
+#endif /* __XEN_ERR_H__ */

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

From xen-changelog-bounces@lists.xen.org Thu Oct 04 16:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 04 Oct 2012 16:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TJo13-0003SB-Nv; Thu, 04 Oct 2012 16:11:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo12-0003Rd-0t
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:12 +0000
Received: from [85.158.137.99:64578] by server-3.bemta-3.messagelabs.com id
	44/B8-25962-F15BD605; Thu, 04 Oct 2012 16:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-217.messagelabs.com!1349367068!20320968!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24564 invoked from network); 4 Oct 2012 16:11:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2012 16:11:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo0y-0004lc-In
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo0y-0005Tf-60
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:08 +0000
Message-Id: <E1TJo0y-0005Tf-60@xenbits.xen.org>
Date: Thu, 04 Oct 2012 16:11:07 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] make domain_create() return a
	proper error code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

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

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

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25808:4746414def65
xen-unstable date: Mon Sep  3 07:40:38 UTC 2012
---


diff -r fb0561ba7d9e -r b26ca2d8d52b xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Tue Sep 25 12:29:29 2012 +0200
+++ b/xen/arch/x86/mm.c	Thu Oct 04 10:28:09 2012 +0200
@@ -91,7 +91,7 @@
 #include <xen/mm.h>
 #include <xen/domain.h>
 #include <xen/sched.h>
-#include <xen/errno.h>
+#include <xen/err.h>
 #include <xen/perfc.h>
 #include <xen/irq.h>
 #include <xen/softirq.h>
@@ -279,7 +279,7 @@ void __init arch_init_memory(void)
      * their domain field set to dom_xen.
      */
     dom_xen = domain_create(DOMID_XEN, DOMCRF_dummy, 0);
-    BUG_ON(dom_xen == NULL);
+    BUG_ON(IS_ERR(dom_xen));
 
     /*
      * Initialise our DOMID_IO domain.
@@ -287,14 +287,14 @@ void __init arch_init_memory(void)
      * array. Mappings occur at the priv of the caller.
      */
     dom_io = domain_create(DOMID_IO, DOMCRF_dummy, 0);
-    BUG_ON(dom_io == NULL);
+    BUG_ON(IS_ERR(dom_io));
     
     /*
-     * Initialise our DOMID_IO domain.
+     * Initialise our COW domain.
      * This domain owns sharable pages.
      */
     dom_cow = domain_create(DOMID_COW, DOMCRF_dummy, 0);
-    BUG_ON(dom_cow == NULL);
+    BUG_ON(IS_ERR(dom_cow));
 
     /* First 1MB of RAM is historically marked as I/O. */
     for ( i = 0; i < 0x100; i++ )
diff -r fb0561ba7d9e -r b26ca2d8d52b xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c	Tue Sep 25 12:29:29 2012 +0200
+++ b/xen/arch/x86/setup.c	Thu Oct 04 10:28:09 2012 +0200
@@ -1,6 +1,7 @@
 #include <xen/config.h>
 #include <xen/init.h>
 #include <xen/lib.h>
+#include <xen/err.h>
 #include <xen/sched.h>
 #include <xen/sched-if.h>
 #include <xen/domain.h>
@@ -1277,7 +1278,7 @@ void __init __start_xen(unsigned long mb
 
     /* Create initial domain 0. */
     dom0 = domain_create(0, DOMCRF_s3_integrity, DOM0_SSIDREF);
-    if ( (dom0 == NULL) || (alloc_dom0_vcpu0() == NULL) )
+    if ( IS_ERR(dom0) || (alloc_dom0_vcpu0() == NULL) )
         panic("Error creating domain 0\n");
 
     dom0->is_privileged = 1;
diff -r fb0561ba7d9e -r b26ca2d8d52b xen/common/cpupool.c
--- a/xen/common/cpupool.c	Tue Sep 25 12:29:29 2012 +0200
+++ b/xen/common/cpupool.c	Thu Oct 04 10:28:09 2012 +0200
@@ -355,14 +355,18 @@ out:
 int cpupool_add_domain(struct domain *d, int poolid)
 {
     struct cpupool *c;
-    int rc = 1;
+    int rc;
     int n_dom = 0;
 
     if ( poolid == CPUPOOLID_NONE )
         return 0;
     spin_lock(&cpupool_lock);
     c = cpupool_find_by_id(poolid);
-    if ( (c != NULL) && cpus_weight(c->cpu_valid) )
+    if ( c == NULL )
+        rc = -ESRCH;
+    else if ( !cpus_weight(c->cpu_valid) )
+        rc = -ENODEV;
+    else
     {
         c->n_dom++;
         n_dom = c->n_dom;
diff -r fb0561ba7d9e -r b26ca2d8d52b xen/common/domain.c
--- a/xen/common/domain.c	Tue Sep 25 12:29:29 2012 +0200
+++ b/xen/common/domain.c	Thu Oct 04 10:28:09 2012 +0200
@@ -9,7 +9,7 @@
 #include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/ctype.h>
-#include <xen/errno.h>
+#include <xen/err.h>
 #include <xen/sched.h>
 #include <xen/domain.h>
 #include <xen/mm.h>
@@ -217,17 +217,17 @@ struct domain *domain_create(
     struct domain *d, **pd;
     enum { INIT_xsm = 1u<<0, INIT_watchdog = 1u<<1, INIT_rangeset = 1u<<2,
            INIT_evtchn = 1u<<3, INIT_gnttab = 1u<<4, INIT_arch = 1u<<5 };
-    int init_status = 0;
+    int err, init_status = 0;
     int poolid = CPUPOOLID_NONE;
 
     if ( (d = alloc_domain_struct()) == NULL )
-        return NULL;
+        return ERR_PTR(-ENOMEM);
 
     d->domain_id = domid;
 
     lock_profile_register_struct(LOCKPROF_TYPE_PERDOM, d, domid, "Domain");
 
-    if ( xsm_alloc_security_domain(d) != 0 )
+    if ( (err = xsm_alloc_security_domain(d)) != 0 )
         goto fail;
     init_status |= INIT_xsm;
 
@@ -261,14 +261,14 @@ struct domain *domain_create(
     d->iomem_caps = rangeset_new(d, "I/O Memory", RANGESETF_prettyprint_hex);
     d->irq_caps   = rangeset_new(d, "Interrupts", 0);
     if ( (d->iomem_caps == NULL) || (d->irq_caps == NULL) )
-        goto fail;
+        goto nomem;
 
     if ( domcr_flags & DOMCRF_dummy )
         return d;
 
     if ( !is_idle_domain(d) )
     {
-        if ( xsm_domain_create(d, ssidref) != 0 )
+        if ( (err = xsm_domain_create(d, ssidref)) != 0 )
             goto fail;
 
         d->is_paused_by_controller = 1;
@@ -285,29 +285,29 @@ struct domain *domain_create(
         d->pirq_mask = xmalloc_array(
             unsigned long, BITS_TO_LONGS(d->nr_pirqs));
         if ( (d->pirq_to_evtchn == NULL) || (d->pirq_mask == NULL) )
-            goto fail;
+            goto nomem;
         memset(d->pirq_to_evtchn, 0, d->nr_pirqs * sizeof(*d->pirq_to_evtchn));
         bitmap_zero(d->pirq_mask, d->nr_pirqs);
 
-        if ( evtchn_init(d) != 0 )
+        if ( (err = evtchn_init(d)) != 0 )
             goto fail;
         init_status |= INIT_evtchn;
 
-        if ( grant_table_create(d) != 0 )
+        if ( (err = grant_table_create(d)) != 0 )
             goto fail;
         init_status |= INIT_gnttab;
 
         poolid = 0;
     }
 
-    if ( arch_domain_create(d, domcr_flags) != 0 )
+    if ( (err = arch_domain_create(d, domcr_flags)) != 0 )
         goto fail;
     init_status |= INIT_arch;
 
-    if ( cpupool_add_domain(d, poolid) != 0 )
+    if ( (err = cpupool_add_domain(d, poolid)) != 0 )
         goto fail;
 
-    if ( sched_init_domain(d) != 0 )
+    if ( (err = sched_init_domain(d)) != 0 )
         goto fail;
 
     if ( !is_idle_domain(d) )
@@ -326,6 +326,8 @@ struct domain *domain_create(
 
     return d;
 
+ nomem:
+    err = -ENOMEM;
  fail:
     d->is_dying = DOMDYING_dead;
     atomic_set(&d->refcnt, DOMAIN_DESTROYED);
@@ -347,7 +349,7 @@ struct domain *domain_create(
     xfree(d->pirq_mask);
     xfree(d->pirq_to_evtchn);
     free_domain_struct(d);
-    return NULL;
+    return ERR_PTR(err);
 }
 
 
diff -r fb0561ba7d9e -r b26ca2d8d52b xen/common/domctl.c
--- a/xen/common/domctl.c	Tue Sep 25 12:29:29 2012 +0200
+++ b/xen/common/domctl.c	Thu Oct 04 10:28:09 2012 +0200
@@ -9,6 +9,7 @@
 #include <xen/config.h>
 #include <xen/types.h>
 #include <xen/lib.h>
+#include <xen/err.h>
 #include <xen/mm.h>
 #include <xen/sched.h>
 #include <xen/sched-if.h>
@@ -435,10 +436,12 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
         if ( op->u.createdomain.flags & XEN_DOMCTL_CDF_oos_off )
             domcr_flags |= DOMCRF_oos_off;
 
-        ret = -ENOMEM;
         d = domain_create(dom, domcr_flags, op->u.createdomain.ssidref);
-        if ( d == NULL )
+        if ( IS_ERR(d) )
+        {
+            ret = PTR_ERR(d);
             break;
+        }
 
         ret = 0;
 
diff -r fb0561ba7d9e -r b26ca2d8d52b xen/common/schedule.c
--- a/xen/common/schedule.c	Tue Sep 25 12:29:29 2012 +0200
+++ b/xen/common/schedule.c	Thu Oct 04 10:28:09 2012 +0200
@@ -28,7 +28,7 @@
 #include <xen/softirq.h>
 #include <xen/trace.h>
 #include <xen/mm.h>
-#include <xen/errno.h>
+#include <xen/err.h>
 #include <xen/guest_access.h>
 #include <xen/multicall.h>
 #include <xen/cpu.h>
@@ -1357,7 +1357,7 @@ void __init scheduler_init(void)
         panic("scheduler returned error on init\n");
 
     idle_domain = domain_create(DOMID_IDLE, 0, 0);
-    BUG_ON(idle_domain == NULL);
+    BUG_ON(IS_ERR(idle_domain));
     idle_domain->vcpu = idle_vcpu;
     idle_domain->max_vcpus = NR_CPUS;
     if ( alloc_vcpu(idle_domain, 0, 0) == NULL )
diff -r fb0561ba7d9e -r b26ca2d8d52b xen/include/xen/err.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/include/xen/err.h	Thu Oct 04 10:28:09 2012 +0200
@@ -0,0 +1,57 @@
+#if !defined(__XEN_ERR_H__) && !defined(__ASSEMBLY__)
+#define __XEN_ERR_H__
+
+#include <xen/compiler.h>
+#include <xen/errno.h>
+
+/*
+ * Kernel pointers have redundant information, so we can use a
+ * scheme where we can return either an error code or a dentry
+ * pointer with the same return value.
+ *
+ * This could be a per-architecture thing, to allow different
+ * error and pointer decisions.
+ */
+#define MAX_ERRNO	4095
+
+#define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO)
+
+static inline void *__must_check ERR_PTR(long error)
+{
+	return (void *)error;
+}
+
+static inline long __must_check PTR_ERR(const void *ptr)
+{
+	return (long)ptr;
+}
+
+static inline long __must_check IS_ERR(const void *ptr)
+{
+	return IS_ERR_VALUE((unsigned long)ptr);
+}
+
+static inline long __must_check IS_ERR_OR_NULL(const void *ptr)
+{
+	return !ptr || IS_ERR_VALUE((unsigned long)ptr);
+}
+
+/**
+ * ERR_CAST - Explicitly cast an error-valued pointer to another pointer type
+ * @ptr: The pointer to cast.
+ *
+ * Explicitly cast an error-valued pointer to another pointer type in such a
+ * way as to make it clear that's what's going on.
+ */
+static inline void * __must_check ERR_CAST(const void *ptr)
+{
+	/* cast away the const */
+	return (void *)ptr;
+}
+
+static inline int __must_check PTR_RET(const void *ptr)
+{
+	return IS_ERR(ptr) ? PTR_ERR(ptr) : 0;
+}
+
+#endif /* __XEN_ERR_H__ */

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

From xen-changelog-bounces@lists.xen.org Thu Oct 04 16:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 04 Oct 2012 16:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TJo14-0003Sc-TQ; Thu, 04 Oct 2012 16:11:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo13-0003Rs-5v
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:13 +0000
Received: from [85.158.139.211:43237] by server-14.bemta-5.messagelabs.com id
	EC/87-31065-025BD605; Thu, 04 Oct 2012 16:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-206.messagelabs.com!1349367070!21053006!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7184 invoked from network); 4 Oct 2012 16:11:11 -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 2012 16:11:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo10-0004lo-Ch
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo10-0005V9-7S
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:10 +0000
Message-Id: <E1TJo10-0005V9-7S@xenbits.xen.org>
Date: Thu, 04 Oct 2012 16:11:09 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86: properly check
	XEN_DOMCTL_ioport_mapping arguments for invalid range
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1349339839 -7200
# Node ID ab6d1c5270024005541a2caccad0b518457e510f
# Parent  90fcc034c1a89b21631cdffb0248f28c7b3cfe50
x86: properly check XEN_DOMCTL_ioport_mapping arguments for invalid range

In particular, the case of "np" being a very large value wasn't handled
correctly. The range start checks also were off by one (except that in
practice, when "np" is properly range checked, this would still have
been caught by the range end checks).

Also, is a GFN wrap in XEN_DOMCTL_memory_mapping really okay?

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25927:3e3959413b2f
xen-unstable date: Wed Sep 19 07:27:55 UTC 2012
---


diff -r 90fcc034c1a8 -r ab6d1c527002 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Thu Oct 04 10:35:37 2012 +0200
+++ b/xen/arch/x86/domctl.c	Thu Oct 04 10:37:19 2012 +0200
@@ -1015,7 +1015,7 @@ long arch_do_domctl(
         int found = 0;
 
         ret = -EINVAL;
-        if ( (np == 0) || (fgp > MAX_IOPORTS) || (fmp > MAX_IOPORTS) ||
+        if ( ((fgp | fmp | (np - 1)) >= MAX_IOPORTS) ||
             ((fgp + np) > MAX_IOPORTS) || ((fmp + np) > MAX_IOPORTS) )
         {
             gdprintk(XENLOG_ERR,

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

From xen-changelog-bounces@lists.xen.org Thu Oct 04 16:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 04 Oct 2012 16:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TJo14-0003Sc-TQ; Thu, 04 Oct 2012 16:11:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo13-0003Rs-5v
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:13 +0000
Received: from [85.158.139.211:43237] by server-14.bemta-5.messagelabs.com id
	EC/87-31065-025BD605; Thu, 04 Oct 2012 16:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-206.messagelabs.com!1349367070!21053006!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7184 invoked from network); 4 Oct 2012 16:11:11 -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 2012 16:11:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo10-0004lo-Ch
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo10-0005V9-7S
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:10 +0000
Message-Id: <E1TJo10-0005V9-7S@xenbits.xen.org>
Date: Thu, 04 Oct 2012 16:11:09 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86: properly check
	XEN_DOMCTL_ioport_mapping arguments for invalid range
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1349339839 -7200
# Node ID ab6d1c5270024005541a2caccad0b518457e510f
# Parent  90fcc034c1a89b21631cdffb0248f28c7b3cfe50
x86: properly check XEN_DOMCTL_ioport_mapping arguments for invalid range

In particular, the case of "np" being a very large value wasn't handled
correctly. The range start checks also were off by one (except that in
practice, when "np" is properly range checked, this would still have
been caught by the range end checks).

Also, is a GFN wrap in XEN_DOMCTL_memory_mapping really okay?

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25927:3e3959413b2f
xen-unstable date: Wed Sep 19 07:27:55 UTC 2012
---


diff -r 90fcc034c1a8 -r ab6d1c527002 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Thu Oct 04 10:35:37 2012 +0200
+++ b/xen/arch/x86/domctl.c	Thu Oct 04 10:37:19 2012 +0200
@@ -1015,7 +1015,7 @@ long arch_do_domctl(
         int found = 0;
 
         ret = -EINVAL;
-        if ( (np == 0) || (fgp > MAX_IOPORTS) || (fmp > MAX_IOPORTS) ||
+        if ( ((fgp | fmp | (np - 1)) >= MAX_IOPORTS) ||
             ((fgp + np) > MAX_IOPORTS) || ((fmp + np) > MAX_IOPORTS) )
         {
             gdprintk(XENLOG_ERR,

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

From xen-changelog-bounces@lists.xen.org Thu Oct 04 16:11:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 04 Oct 2012 16: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 1TJo19-0003V7-Aq; Thu, 04 Oct 2012 16:11:19 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo17-0003Rm-Nf
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1349367069!8855950!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20437 invoked from network); 4 Oct 2012 16:11:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2012 16:11:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo0z-0004li-Jr
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo0z-0005U9-7i
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:09 +0000
Message-Id: <E1TJo0z-0005U9-7i@xenbits.xen.org>
Date: Thu, 04 Oct 2012 16:11:08 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] adjust a few RCU domain locking
	calls
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1349339669 -7200
# Node ID 16e98ef904f97e1a824c1d67a2a78e928dca89cf
# Parent  99818c48b1e2107aa8c095ce7696cc3016f80893
adjust a few RCU domain locking calls

x86's do_physdev_op() had a case where the locking was entirely
superfluous. Its physdev_map_pirq() further had a case where the lock
was being obtained too early, needlessly complicating early exit paths.

Grant table code had two open coded instances of
rcu_lock_target_domain_by_id(), and a third code section could be
consolidated by using the newly introduced helper function.

The memory hypercall code had two more instances of open coding
rcu_lock_target_domain_by_id(), but note that here this is not just
cleanup, but also fixes an error return path in memory_exchange() to
actually return an error.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25835:c70d70d85306
xen-unstable date: Fri Sep  7 15:58:12 UTC 2012
---


diff -r 99818c48b1e2 -r 16e98ef904f9 xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Thu Oct 04 10:31:45 2012 +0200
+++ b/xen/arch/x86/physdev.c	Thu Oct 04 10:34:29 2012 +0200
@@ -89,15 +89,11 @@ static int physdev_hvm_map_pirq(
 
 static int physdev_map_pirq(struct physdev_map_pirq *map)
 {
-    struct domain *d;
+    struct domain *d = current->domain;
     int pirq, irq, ret = 0;
     struct msi_info _msi;
     void *map_data = NULL;
 
-    ret = rcu_lock_target_domain_by_id(map->domid, &d);
-    if ( ret )
-        return ret;
-
     if ( map->domid == DOMID_SELF && is_hvm_domain(d) )
     {
         /*
@@ -105,14 +101,15 @@ static int physdev_map_pirq(struct physd
          * calls back into itself and deadlocks on hvm_domain.irq_lock.
          */
         if ( !is_hvm_pv_evtchn_domain(d) )
-        {
-            ret = -EINVAL;
-            goto free_domain;
-        }
-        ret = physdev_hvm_map_pirq(d, map);
-        goto free_domain;
+            return -EINVAL;
+
+        return physdev_hvm_map_pirq(d, map);
     }
 
+    ret = rcu_lock_target_domain_by_id(map->domid, &d);
+    if ( ret )
+        return ret;
+
     if ( !IS_PRIV_FOR(current->domain, d) )
     {
         ret = -EPERM;
@@ -585,10 +582,8 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
     }
     case PHYSDEVOP_get_free_pirq: {
         struct physdev_get_free_pirq out;
-        struct domain *d;
+        struct domain *d = v->domain;
 
-        d = rcu_lock_current_domain();
-        
         ret = -EFAULT;
         if ( copy_from_guest(&out, arg, 1) != 0 )
             break;
@@ -605,7 +600,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
             ret = copy_to_guest(arg, &out, 1) ? -EFAULT : 0;
         }
 
-        rcu_unlock_domain(d);
         break;
     }
     default:
diff -r 99818c48b1e2 -r 16e98ef904f9 xen/common/grant_table.c
--- a/xen/common/grant_table.c	Thu Oct 04 10:31:45 2012 +0200
+++ b/xen/common/grant_table.c	Thu Oct 04 10:34:29 2012 +0200
@@ -24,7 +24,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <xen/config.h>
+#include <xen/err.h>
 #include <xen/iocap.h>
 #include <xen/lib.h>
 #include <xen/sched.h>
@@ -172,6 +172,30 @@ static int __get_paged_frame(unsigned lo
     return rc;
 }
 
+static struct domain *gt_lock_target_domain_by_id(domid_t dom)
+{
+    struct domain *d;
+    int rc = GNTST_general_error;
+
+    switch ( rcu_lock_target_domain_by_id(dom, &d) )
+    {
+    case 0:
+        return d;
+
+    case -ESRCH:
+        gdprintk(XENLOG_INFO, "Bad domid %d.\n", dom);
+        rc = GNTST_bad_domain;
+        break;
+
+    case -EPERM:
+        rc = GNTST_permission_denied;
+        break;
+    }
+
+    ASSERT(rc < 0 && -rc <= MAX_ERRNO);
+    return ERR_PTR(rc);
+}
+
 static inline int
 __get_maptrack_handle(
     struct grant_table *t)
@@ -1216,7 +1240,6 @@ gnttab_setup_table(
     struct domain *d;
     int            i;
     unsigned long  gmfn;
-    domid_t        dom;
 
     if ( count != 1 )
         return -EINVAL;
@@ -1236,25 +1259,11 @@ gnttab_setup_table(
         goto out1;
     }
 
-    dom = op.dom;
-    if ( dom == DOMID_SELF )
+    d = gt_lock_target_domain_by_id(op.dom);
+    if ( IS_ERR(d) )
     {
-        d = rcu_lock_current_domain();
-    }
-    else
-    {
-        if ( unlikely((d = rcu_lock_domain_by_id(dom)) == NULL) )
-        {
-            gdprintk(XENLOG_INFO, "Bad domid %d.\n", dom);
-            op.status = GNTST_bad_domain;
-            goto out1;
-        }
-
-        if ( unlikely(!IS_PRIV_FOR(current->domain, d)) )
-        {
-            op.status = GNTST_permission_denied;
-            goto out2;
-        }
+        op.status = PTR_ERR(d);
+        goto out1;
     }
 
     if ( xsm_grant_setup(current->domain, d) )
@@ -1309,7 +1318,6 @@ gnttab_query_size(
 {
     struct gnttab_query_size op;
     struct domain *d;
-    domid_t        dom;
     int rc;
 
     if ( count != 1 )
@@ -1321,25 +1329,11 @@ gnttab_query_size(
         return -EFAULT;
     }
 
-    dom = op.dom;
-    if ( dom == DOMID_SELF )
+    d = gt_lock_target_domain_by_id(op.dom);
+    if ( IS_ERR(d) )
     {
-        d = rcu_lock_current_domain();
-    }
-    else
-    {
-        if ( unlikely((d = rcu_lock_domain_by_id(dom)) == NULL) )
-        {
-            gdprintk(XENLOG_INFO, "Bad domid %d.\n", dom);
-            op.status = GNTST_bad_domain;
-            goto query_out;
-        }
-
-        if ( unlikely(!IS_PRIV_FOR(current->domain, d)) )
-        {
-            op.status = GNTST_permission_denied;
-            goto query_out_unlock;
-        }
+        op.status = PTR_ERR(d);
+        goto query_out;
     }
 
     rc = xsm_grant_query_size(current->domain, d);
@@ -2179,7 +2173,6 @@ gnttab_get_status_frames(XEN_GUEST_HANDL
     struct grant_table *gt;
     uint64_t       gmfn;
     int i;
-    int rc;
 
     if ( count != 1 )
         return -EINVAL;
@@ -2191,15 +2184,10 @@ gnttab_get_status_frames(XEN_GUEST_HANDL
         return -EFAULT;
     }
 
-    rc = rcu_lock_target_domain_by_id(op.dom, &d);
-    if ( rc < 0 )
+    d = gt_lock_target_domain_by_id(op.dom);
+    if ( IS_ERR(d) )
     {
-        if ( rc == -ESRCH )
-            op.status = GNTST_bad_domain;
-        else if ( rc == -EPERM )
-            op.status = GNTST_permission_denied;
-        else
-            op.status = GNTST_general_error;
+        op.status = PTR_ERR(d);
         goto out1;
     }
 
diff -r 99818c48b1e2 -r 16e98ef904f9 xen/common/memory.c
--- a/xen/common/memory.c	Thu Oct 04 10:31:45 2012 +0200
+++ b/xen/common/memory.c	Thu Oct 04 10:34:29 2012 +0200
@@ -310,22 +310,9 @@ static long memory_exchange(XEN_GUEST_HA
         out_chunk_order = exch.in.extent_order - exch.out.extent_order;
     }
 
-    if ( likely(exch.in.domid == DOMID_SELF) )
-    {
-        d = rcu_lock_current_domain();
-    }
-    else
-    {
-        if ( (d = rcu_lock_domain_by_id(exch.in.domid)) == NULL )
-            goto fail_early;
-
-        if ( !IS_PRIV_FOR(current->domain, d) )
-        {
-            rcu_unlock_domain(d);
-            rc = -EPERM;
-            goto fail_early;
-        }
-    }
+    rc = rcu_lock_target_domain_by_id(exch.in.domid, &d);
+    if ( rc )
+        goto fail_early;
 
     memflags |= MEMF_bits(domain_clamp_alloc_bitsize(
         d,
@@ -556,20 +543,8 @@ long do_memory_op(unsigned long cmd, XEN
              && (reservation.mem_flags & XENMEMF_populate_on_demand) )
             args.memflags |= MEMF_populate_on_demand;
 
-        if ( likely(reservation.domid == DOMID_SELF) )
-        {
-            d = rcu_lock_current_domain();
-        }
-        else
-        {
-            if ( (d = rcu_lock_domain_by_id(reservation.domid)) == NULL )
-                return start_extent;
-            if ( !IS_PRIV_FOR(current->domain, d) )
-            {
-                rcu_unlock_domain(d);
-                return start_extent;
-            }
-        }
+        if ( unlikely(rcu_lock_target_domain_by_id(reservation.domid, &d)) )
+            return start_extent;
         args.domain = d;
 
         rc = xsm_memory_adjust_reservation(current->domain, d);

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

From xen-changelog-bounces@lists.xen.org Thu Oct 04 16:11:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 04 Oct 2012 16: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 1TJo19-0003V7-Aq; Thu, 04 Oct 2012 16:11:19 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo17-0003Rm-Nf
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1349367069!8855950!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20437 invoked from network); 4 Oct 2012 16:11:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2012 16:11:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo0z-0004li-Jr
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo0z-0005U9-7i
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:09 +0000
Message-Id: <E1TJo0z-0005U9-7i@xenbits.xen.org>
Date: Thu, 04 Oct 2012 16:11:08 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] adjust a few RCU domain locking
	calls
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1349339669 -7200
# Node ID 16e98ef904f97e1a824c1d67a2a78e928dca89cf
# Parent  99818c48b1e2107aa8c095ce7696cc3016f80893
adjust a few RCU domain locking calls

x86's do_physdev_op() had a case where the locking was entirely
superfluous. Its physdev_map_pirq() further had a case where the lock
was being obtained too early, needlessly complicating early exit paths.

Grant table code had two open coded instances of
rcu_lock_target_domain_by_id(), and a third code section could be
consolidated by using the newly introduced helper function.

The memory hypercall code had two more instances of open coding
rcu_lock_target_domain_by_id(), but note that here this is not just
cleanup, but also fixes an error return path in memory_exchange() to
actually return an error.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25835:c70d70d85306
xen-unstable date: Fri Sep  7 15:58:12 UTC 2012
---


diff -r 99818c48b1e2 -r 16e98ef904f9 xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Thu Oct 04 10:31:45 2012 +0200
+++ b/xen/arch/x86/physdev.c	Thu Oct 04 10:34:29 2012 +0200
@@ -89,15 +89,11 @@ static int physdev_hvm_map_pirq(
 
 static int physdev_map_pirq(struct physdev_map_pirq *map)
 {
-    struct domain *d;
+    struct domain *d = current->domain;
     int pirq, irq, ret = 0;
     struct msi_info _msi;
     void *map_data = NULL;
 
-    ret = rcu_lock_target_domain_by_id(map->domid, &d);
-    if ( ret )
-        return ret;
-
     if ( map->domid == DOMID_SELF && is_hvm_domain(d) )
     {
         /*
@@ -105,14 +101,15 @@ static int physdev_map_pirq(struct physd
          * calls back into itself and deadlocks on hvm_domain.irq_lock.
          */
         if ( !is_hvm_pv_evtchn_domain(d) )
-        {
-            ret = -EINVAL;
-            goto free_domain;
-        }
-        ret = physdev_hvm_map_pirq(d, map);
-        goto free_domain;
+            return -EINVAL;
+
+        return physdev_hvm_map_pirq(d, map);
     }
 
+    ret = rcu_lock_target_domain_by_id(map->domid, &d);
+    if ( ret )
+        return ret;
+
     if ( !IS_PRIV_FOR(current->domain, d) )
     {
         ret = -EPERM;
@@ -585,10 +582,8 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
     }
     case PHYSDEVOP_get_free_pirq: {
         struct physdev_get_free_pirq out;
-        struct domain *d;
+        struct domain *d = v->domain;
 
-        d = rcu_lock_current_domain();
-        
         ret = -EFAULT;
         if ( copy_from_guest(&out, arg, 1) != 0 )
             break;
@@ -605,7 +600,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
             ret = copy_to_guest(arg, &out, 1) ? -EFAULT : 0;
         }
 
-        rcu_unlock_domain(d);
         break;
     }
     default:
diff -r 99818c48b1e2 -r 16e98ef904f9 xen/common/grant_table.c
--- a/xen/common/grant_table.c	Thu Oct 04 10:31:45 2012 +0200
+++ b/xen/common/grant_table.c	Thu Oct 04 10:34:29 2012 +0200
@@ -24,7 +24,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <xen/config.h>
+#include <xen/err.h>
 #include <xen/iocap.h>
 #include <xen/lib.h>
 #include <xen/sched.h>
@@ -172,6 +172,30 @@ static int __get_paged_frame(unsigned lo
     return rc;
 }
 
+static struct domain *gt_lock_target_domain_by_id(domid_t dom)
+{
+    struct domain *d;
+    int rc = GNTST_general_error;
+
+    switch ( rcu_lock_target_domain_by_id(dom, &d) )
+    {
+    case 0:
+        return d;
+
+    case -ESRCH:
+        gdprintk(XENLOG_INFO, "Bad domid %d.\n", dom);
+        rc = GNTST_bad_domain;
+        break;
+
+    case -EPERM:
+        rc = GNTST_permission_denied;
+        break;
+    }
+
+    ASSERT(rc < 0 && -rc <= MAX_ERRNO);
+    return ERR_PTR(rc);
+}
+
 static inline int
 __get_maptrack_handle(
     struct grant_table *t)
@@ -1216,7 +1240,6 @@ gnttab_setup_table(
     struct domain *d;
     int            i;
     unsigned long  gmfn;
-    domid_t        dom;
 
     if ( count != 1 )
         return -EINVAL;
@@ -1236,25 +1259,11 @@ gnttab_setup_table(
         goto out1;
     }
 
-    dom = op.dom;
-    if ( dom == DOMID_SELF )
+    d = gt_lock_target_domain_by_id(op.dom);
+    if ( IS_ERR(d) )
     {
-        d = rcu_lock_current_domain();
-    }
-    else
-    {
-        if ( unlikely((d = rcu_lock_domain_by_id(dom)) == NULL) )
-        {
-            gdprintk(XENLOG_INFO, "Bad domid %d.\n", dom);
-            op.status = GNTST_bad_domain;
-            goto out1;
-        }
-
-        if ( unlikely(!IS_PRIV_FOR(current->domain, d)) )
-        {
-            op.status = GNTST_permission_denied;
-            goto out2;
-        }
+        op.status = PTR_ERR(d);
+        goto out1;
     }
 
     if ( xsm_grant_setup(current->domain, d) )
@@ -1309,7 +1318,6 @@ gnttab_query_size(
 {
     struct gnttab_query_size op;
     struct domain *d;
-    domid_t        dom;
     int rc;
 
     if ( count != 1 )
@@ -1321,25 +1329,11 @@ gnttab_query_size(
         return -EFAULT;
     }
 
-    dom = op.dom;
-    if ( dom == DOMID_SELF )
+    d = gt_lock_target_domain_by_id(op.dom);
+    if ( IS_ERR(d) )
     {
-        d = rcu_lock_current_domain();
-    }
-    else
-    {
-        if ( unlikely((d = rcu_lock_domain_by_id(dom)) == NULL) )
-        {
-            gdprintk(XENLOG_INFO, "Bad domid %d.\n", dom);
-            op.status = GNTST_bad_domain;
-            goto query_out;
-        }
-
-        if ( unlikely(!IS_PRIV_FOR(current->domain, d)) )
-        {
-            op.status = GNTST_permission_denied;
-            goto query_out_unlock;
-        }
+        op.status = PTR_ERR(d);
+        goto query_out;
     }
 
     rc = xsm_grant_query_size(current->domain, d);
@@ -2179,7 +2173,6 @@ gnttab_get_status_frames(XEN_GUEST_HANDL
     struct grant_table *gt;
     uint64_t       gmfn;
     int i;
-    int rc;
 
     if ( count != 1 )
         return -EINVAL;
@@ -2191,15 +2184,10 @@ gnttab_get_status_frames(XEN_GUEST_HANDL
         return -EFAULT;
     }
 
-    rc = rcu_lock_target_domain_by_id(op.dom, &d);
-    if ( rc < 0 )
+    d = gt_lock_target_domain_by_id(op.dom);
+    if ( IS_ERR(d) )
     {
-        if ( rc == -ESRCH )
-            op.status = GNTST_bad_domain;
-        else if ( rc == -EPERM )
-            op.status = GNTST_permission_denied;
-        else
-            op.status = GNTST_general_error;
+        op.status = PTR_ERR(d);
         goto out1;
     }
 
diff -r 99818c48b1e2 -r 16e98ef904f9 xen/common/memory.c
--- a/xen/common/memory.c	Thu Oct 04 10:31:45 2012 +0200
+++ b/xen/common/memory.c	Thu Oct 04 10:34:29 2012 +0200
@@ -310,22 +310,9 @@ static long memory_exchange(XEN_GUEST_HA
         out_chunk_order = exch.in.extent_order - exch.out.extent_order;
     }
 
-    if ( likely(exch.in.domid == DOMID_SELF) )
-    {
-        d = rcu_lock_current_domain();
-    }
-    else
-    {
-        if ( (d = rcu_lock_domain_by_id(exch.in.domid)) == NULL )
-            goto fail_early;
-
-        if ( !IS_PRIV_FOR(current->domain, d) )
-        {
-            rcu_unlock_domain(d);
-            rc = -EPERM;
-            goto fail_early;
-        }
-    }
+    rc = rcu_lock_target_domain_by_id(exch.in.domid, &d);
+    if ( rc )
+        goto fail_early;
 
     memflags |= MEMF_bits(domain_clamp_alloc_bitsize(
         d,
@@ -556,20 +543,8 @@ long do_memory_op(unsigned long cmd, XEN
              && (reservation.mem_flags & XENMEMF_populate_on_demand) )
             args.memflags |= MEMF_populate_on_demand;
 
-        if ( likely(reservation.domid == DOMID_SELF) )
-        {
-            d = rcu_lock_current_domain();
-        }
-        else
-        {
-            if ( (d = rcu_lock_domain_by_id(reservation.domid)) == NULL )
-                return start_extent;
-            if ( !IS_PRIV_FOR(current->domain, d) )
-            {
-                rcu_unlock_domain(d);
-                return start_extent;
-            }
-        }
+        if ( unlikely(rcu_lock_target_domain_by_id(reservation.domid, &d)) )
+            return start_extent;
         args.domain = d;
 
         rc = xsm_memory_adjust_reservation(current->domain, d);

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

From xen-changelog-bounces@lists.xen.org Thu Oct 04 16:11:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 04 Oct 2012 16: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 1TJo18-0003UX-7V; Thu, 04 Oct 2012 16:11:18 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo16-0003Rc-Pv
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-27.messagelabs.com!1349367069!4179765!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2105 invoked from network); 4 Oct 2012 16:11:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2012 16:11:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo0y-0004lf-WD
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo0y-0005Tu-Nc
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:08 +0000
Message-Id: <E1TJo0y-0005Tu-Nc@xenbits.xen.org>
Date: Thu, 04 Oct 2012 16:11:08 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/MSI: fix 2nd S3 resume with
	interrupt remapping enabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1349339505 -7200
# Node ID 99818c48b1e2107aa8c095ce7696cc3016f80893
# Parent  b26ca2d8d52ba2bc7e083bae96796d1a9ace9140
x86/MSI: fix 2nd S3 resume with interrupt remapping enabled

The first resume from S3 was corrupting internal data structures (in
that pci_restore_msi_state() updated the globally stored MSI message
from traditional to interrupt remapped format, which would then be
translated a second time during the second resume, breaking interrupt
delivery).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25834:0376c85caaf3
xen-unstable date: Fri Sep  7 15:57:10 UTC 2012
---


diff -r b26ca2d8d52b -r 99818c48b1e2 xen/arch/x86/msi.c
--- a/xen/arch/x86/msi.c	Thu Oct 04 10:28:09 2012 +0200
+++ b/xen/arch/x86/msi.c	Thu Oct 04 10:31:45 2012 +0200
@@ -223,7 +223,10 @@ static void write_msi_msg(struct msi_des
     entry->msg = *msg;
 
     if ( iommu_enabled )
+    {
+        ASSERT(msg != &entry->msg);
         iommu_update_ire_from_msi(entry, msg);
+    }
 
     switch ( entry->msi_attrib.type )
     {
@@ -954,6 +957,7 @@ int pci_restore_msi_state(struct pci_dev
     int irq;
     struct msi_desc *entry, *tmp;
     struct irq_desc *desc;
+    struct msi_msg msg;
 
     ASSERT(spin_is_locked(&pcidevs_lock));
 
@@ -982,7 +986,8 @@ int pci_restore_msi_state(struct pci_dev
         else if ( entry->msi_attrib.type == PCI_CAP_ID_MSIX )
             msix_set_enable(pdev, 0);
 
-        write_msi_msg(entry, &entry->msg);
+        msg = entry->msg;
+        write_msi_msg(entry, &msg);
 
         msi_set_mask_bit(irq, entry->msi_attrib.masked);
 

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

From xen-changelog-bounces@lists.xen.org Thu Oct 04 16:11:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 04 Oct 2012 16: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 1TJo18-0003UX-7V; Thu, 04 Oct 2012 16:11:18 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo16-0003Rc-Pv
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-27.messagelabs.com!1349367069!4179765!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2105 invoked from network); 4 Oct 2012 16:11:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2012 16:11:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo0y-0004lf-WD
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJo0y-0005Tu-Nc
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 16:11:08 +0000
Message-Id: <E1TJo0y-0005Tu-Nc@xenbits.xen.org>
Date: Thu, 04 Oct 2012 16:11:08 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/MSI: fix 2nd S3 resume with
	interrupt remapping enabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1349339505 -7200
# Node ID 99818c48b1e2107aa8c095ce7696cc3016f80893
# Parent  b26ca2d8d52ba2bc7e083bae96796d1a9ace9140
x86/MSI: fix 2nd S3 resume with interrupt remapping enabled

The first resume from S3 was corrupting internal data structures (in
that pci_restore_msi_state() updated the globally stored MSI message
from traditional to interrupt remapped format, which would then be
translated a second time during the second resume, breaking interrupt
delivery).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25834:0376c85caaf3
xen-unstable date: Fri Sep  7 15:57:10 UTC 2012
---


diff -r b26ca2d8d52b -r 99818c48b1e2 xen/arch/x86/msi.c
--- a/xen/arch/x86/msi.c	Thu Oct 04 10:28:09 2012 +0200
+++ b/xen/arch/x86/msi.c	Thu Oct 04 10:31:45 2012 +0200
@@ -223,7 +223,10 @@ static void write_msi_msg(struct msi_des
     entry->msg = *msg;
 
     if ( iommu_enabled )
+    {
+        ASSERT(msg != &entry->msg);
         iommu_update_ire_from_msi(entry, msg);
+    }
 
     switch ( entry->msi_attrib.type )
     {
@@ -954,6 +957,7 @@ int pci_restore_msi_state(struct pci_dev
     int irq;
     struct msi_desc *entry, *tmp;
     struct irq_desc *desc;
+    struct msi_msg msg;
 
     ASSERT(spin_is_locked(&pcidevs_lock));
 
@@ -982,7 +986,8 @@ int pci_restore_msi_state(struct pci_dev
         else if ( entry->msi_attrib.type == PCI_CAP_ID_MSIX )
             msix_set_enable(pdev, 0);
 
-        write_msi_msg(entry, &entry->msg);
+        msg = entry->msg;
+        write_msi_msg(entry, &msg);
 
         msi_set_mask_bit(irq, entry->msi_attrib.masked);
 

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

From xen-changelog-bounces@lists.xen.org Thu Oct 04 21:11:15 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 04 Oct 2012 21:11:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TJshL-0002UE-Lz; Thu, 04 Oct 2012 21:11:11 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJshK-0002U3-H5
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 21:11:10 +0000
Received: from [85.158.143.99:59156] by server-1.bemta-4.messagelabs.com id
	A3/48-05684-D6BFD605; Thu, 04 Oct 2012 21:11:09 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-216.messagelabs.com!1349385068!21674816!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19112 invoked from network); 4 Oct 2012 21:11:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2012 21:11:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJshI-0008IZ-7A
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 21:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJshH-0004pp-Ln
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 21:11:07 +0000
Message-Id: <E1TJshH-0004pp-Ln@xenbits.xen.org>
Date: Thu, 04 Oct 2012 21:11:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: get the MWAIT idle driver in
	sync with the ACPI one
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1349334186 -7200
# Node ID d0d7e20b998969234eb5dc41a56e91d7f7f1378a
# Parent  572821a5682bbad552fb597194752b882ca12fae
x86: get the MWAIT idle driver in sync with the ACPI one

.. with respect to behavior when there is no HPET broadcast support
(for using the PIT broadcast instead, it requires explicitly enabling
CPU idle management).

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


diff -r 572821a5682b -r d0d7e20b9989 xen/arch/x86/cpu/mwait-idle.c
--- a/xen/arch/x86/cpu/mwait-idle.c	Wed Oct 03 12:59:30 2012 +0100
+++ b/xen/arch/x86/cpu/mwait-idle.c	Thu Oct 04 09:03:06 2012 +0200
@@ -501,11 +501,14 @@ int __init mwait_idle_init(struct notifi
 		return -ENODEV;
 
 	err = mwait_idle_probe();
-	if (!err) {
-		if (!boot_cpu_has(X86_FEATURE_ARAT))
-			hpet_broadcast_init();
-		if (!lapic_timer_init())
+	if (!err && !boot_cpu_has(X86_FEATURE_ARAT)) {
+		hpet_broadcast_init();
+		if (xen_cpuidle < 0 && !hpet_broadcast_is_available())
+			err = -ENODEV;
+		else if(!lapic_timer_init())
 			err = -EINVAL;
+		if (err)
+			pr_debug(PREFIX "not used (%d)\n", err);
 	}
 	if (!err) {
 		nfb->notifier_call = mwait_idle_cpu_init;

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

From xen-changelog-bounces@lists.xen.org Thu Oct 04 21:11:15 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 04 Oct 2012 21:11:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TJshL-0002UE-Lz; Thu, 04 Oct 2012 21:11:11 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJshK-0002U3-H5
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 21:11:10 +0000
Received: from [85.158.143.99:59156] by server-1.bemta-4.messagelabs.com id
	A3/48-05684-D6BFD605; Thu, 04 Oct 2012 21:11:09 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-216.messagelabs.com!1349385068!21674816!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19112 invoked from network); 4 Oct 2012 21:11:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2012 21:11:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJshI-0008IZ-7A
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 21:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJshH-0004pp-Ln
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 21:11:07 +0000
Message-Id: <E1TJshH-0004pp-Ln@xenbits.xen.org>
Date: Thu, 04 Oct 2012 21:11:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: get the MWAIT idle driver in
	sync with the ACPI one
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1349334186 -7200
# Node ID d0d7e20b998969234eb5dc41a56e91d7f7f1378a
# Parent  572821a5682bbad552fb597194752b882ca12fae
x86: get the MWAIT idle driver in sync with the ACPI one

.. with respect to behavior when there is no HPET broadcast support
(for using the PIT broadcast instead, it requires explicitly enabling
CPU idle management).

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


diff -r 572821a5682b -r d0d7e20b9989 xen/arch/x86/cpu/mwait-idle.c
--- a/xen/arch/x86/cpu/mwait-idle.c	Wed Oct 03 12:59:30 2012 +0100
+++ b/xen/arch/x86/cpu/mwait-idle.c	Thu Oct 04 09:03:06 2012 +0200
@@ -501,11 +501,14 @@ int __init mwait_idle_init(struct notifi
 		return -ENODEV;
 
 	err = mwait_idle_probe();
-	if (!err) {
-		if (!boot_cpu_has(X86_FEATURE_ARAT))
-			hpet_broadcast_init();
-		if (!lapic_timer_init())
+	if (!err && !boot_cpu_has(X86_FEATURE_ARAT)) {
+		hpet_broadcast_init();
+		if (xen_cpuidle < 0 && !hpet_broadcast_is_available())
+			err = -ENODEV;
+		else if(!lapic_timer_init())
 			err = -EINVAL;
+		if (err)
+			pr_debug(PREFIX "not used (%d)\n", err);
 	}
 	if (!err) {
 		nfb->notifier_call = mwait_idle_cpu_init;

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

From xen-changelog-bounces@lists.xen.org Thu Oct 04 21:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 04 Oct 2012 21:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TJshN-0002UT-Oj; Thu, 04 Oct 2012 21:11:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJshN-0002UL-2M
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 21:11:13 +0000
Received: from [85.158.143.35:54257] by server-2.bemta-4.messagelabs.com id
	AE/D5-06610-07BFD605; Thu, 04 Oct 2012 21:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-21.messagelabs.com!1349385069!21089062!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15275 invoked from network); 4 Oct 2012 21:11: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;
	4 Oct 2012 21:11:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJshJ-0008If-5v
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 21:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJshI-0004qJ-V9
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 21:11:08 +0000
Message-Id: <E1TJshI-0004qJ-V9@xenbits.xen.org>
Date: Thu, 04 Oct 2012 21:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] VT-d: make remap_entry_to_msi_msg()
	return consistent 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

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1349335705 -7200
# Node ID 72d89cc43c72848be9bf49da9a87729ed8f48433
# Parent  761def707575b154fa29e29d7962048352165c0d
VT-d: make remap_entry_to_msi_msg() return consistent message

During debugging of another problem I found that in x2APIC mode, the
destination field of the low address value wasn't passed back
correctly. While this is benign in most cases (as the value isn't being
used anywhere), it can be confusing (and misguiding) when printing the
value read or when comparing it to the one previously passed into the
inverse function.

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


diff -r 761def707575 -r 72d89cc43c72 xen/drivers/passthrough/vtd/intremap.c
--- a/xen/drivers/passthrough/vtd/intremap.c	Thu Oct 04 09:05:24 2012 +0200
+++ b/xen/drivers/passthrough/vtd/intremap.c	Thu Oct 04 09:28:25 2012 +0200
@@ -521,8 +521,8 @@ static int remap_entry_to_msi_msg(
     if ( x2apic_enabled )
         msg->dest32 = iremap_entry->lo.dst;
     else
-        msg->address_lo |=
-            ((iremap_entry->lo.dst >> 8) & 0xff ) << MSI_ADDR_DEST_ID_SHIFT;
+        msg->dest32 = (iremap_entry->lo.dst >> 8) & 0xff;
+    msg->address_lo |= (msg->dest32 & 0xff) << MSI_ADDR_DEST_ID_SHIFT;
 
     msg->data =
         MSI_DATA_TRIGGER_EDGE |

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

From xen-changelog-bounces@lists.xen.org Thu Oct 04 21:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 04 Oct 2012 21:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TJshN-0002UT-Oj; Thu, 04 Oct 2012 21:11:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJshN-0002UL-2M
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 21:11:13 +0000
Received: from [85.158.143.35:54257] by server-2.bemta-4.messagelabs.com id
	AE/D5-06610-07BFD605; Thu, 04 Oct 2012 21:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-21.messagelabs.com!1349385069!21089062!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15275 invoked from network); 4 Oct 2012 21:11: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;
	4 Oct 2012 21:11:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJshJ-0008If-5v
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 21:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJshI-0004qJ-V9
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 21:11:08 +0000
Message-Id: <E1TJshI-0004qJ-V9@xenbits.xen.org>
Date: Thu, 04 Oct 2012 21:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] VT-d: make remap_entry_to_msi_msg()
	return consistent 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

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1349335705 -7200
# Node ID 72d89cc43c72848be9bf49da9a87729ed8f48433
# Parent  761def707575b154fa29e29d7962048352165c0d
VT-d: make remap_entry_to_msi_msg() return consistent message

During debugging of another problem I found that in x2APIC mode, the
destination field of the low address value wasn't passed back
correctly. While this is benign in most cases (as the value isn't being
used anywhere), it can be confusing (and misguiding) when printing the
value read or when comparing it to the one previously passed into the
inverse function.

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


diff -r 761def707575 -r 72d89cc43c72 xen/drivers/passthrough/vtd/intremap.c
--- a/xen/drivers/passthrough/vtd/intremap.c	Thu Oct 04 09:05:24 2012 +0200
+++ b/xen/drivers/passthrough/vtd/intremap.c	Thu Oct 04 09:28:25 2012 +0200
@@ -521,8 +521,8 @@ static int remap_entry_to_msi_msg(
     if ( x2apic_enabled )
         msg->dest32 = iremap_entry->lo.dst;
     else
-        msg->address_lo |=
-            ((iremap_entry->lo.dst >> 8) & 0xff ) << MSI_ADDR_DEST_ID_SHIFT;
+        msg->dest32 = (iremap_entry->lo.dst >> 8) & 0xff;
+    msg->address_lo |= (msg->dest32 & 0xff) << MSI_ADDR_DEST_ID_SHIFT;
 
     msg->data =
         MSI_DATA_TRIGGER_EDGE |

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

From xen-changelog-bounces@lists.xen.org Thu Oct 04 21:11:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 04 Oct 2012 21:11:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TJshR-0002V3-RR; Thu, 04 Oct 2012 21:11:17 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJshQ-0002UC-PW
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 21:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-27.messagelabs.com!1349385068!8798095!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29321 invoked from network); 4 Oct 2012 21:11:10 -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;
	4 Oct 2012 21:11:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJshI-0008Ic-I8
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 21:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJshI-0004q4-Db
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 21:11:08 +0000
Message-Id: <E1TJshI-0004q4-Db@xenbits.xen.org>
Date: Thu, 04 Oct 2012 21:11:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: consolidate frame state
	manipulation functions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1349334324 -7200
# Node ID 761def707575b154fa29e29d7962048352165c0d
# Parent  d0d7e20b998969234eb5dc41a56e91d7f7f1378a
x86: consolidate frame state manipulation functions

Rather than doing this in multiple places, have a single central
function (decode_register()) to be used by all other code.

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


diff -r d0d7e20b9989 -r 761def707575 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Thu Oct 04 09:03:06 2012 +0200
+++ b/xen/arch/x86/hvm/hvm.c	Thu Oct 04 09:05:24 2012 +0200
@@ -1585,7 +1585,7 @@ int hvm_mov_to_cr(unsigned int cr, unsig
     struct vcpu *curr = current;
     unsigned long val, *reg;
 
-    if ( (reg = get_x86_gpr(guest_cpu_user_regs(), gpr)) == NULL )
+    if ( (reg = decode_register(gpr, guest_cpu_user_regs(), 0)) == NULL )
     {
         gdprintk(XENLOG_ERR, "invalid gpr: %u\n", gpr);
         goto exit_and_crash;
@@ -1627,7 +1627,7 @@ int hvm_mov_from_cr(unsigned int cr, uns
     struct vcpu *curr = current;
     unsigned long val = 0, *reg;
 
-    if ( (reg = get_x86_gpr(guest_cpu_user_regs(), gpr)) == NULL )
+    if ( (reg = decode_register(gpr, guest_cpu_user_regs(), 0)) == NULL )
     {
         gdprintk(XENLOG_ERR, "invalid gpr: %u\n", gpr);
         goto exit_and_crash;
diff -r d0d7e20b9989 -r 761def707575 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Thu Oct 04 09:03:06 2012 +0200
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Thu Oct 04 09:05:24 2012 +0200
@@ -223,56 +223,18 @@ void __set_vvmcs(void *vvmcs, u32 vmcs_e
 static unsigned long reg_read(struct cpu_user_regs *regs,
                               enum vmx_regs_enc index)
 {
-    unsigned long value = 0;
+    unsigned long *pval = decode_register(index, regs, 0);
 
-    switch ( index ) {
-    CASE_GET_REG(RAX, eax);
-    CASE_GET_REG(RCX, ecx);
-    CASE_GET_REG(RDX, edx);
-    CASE_GET_REG(RBX, ebx);
-    CASE_GET_REG(RBP, ebp);
-    CASE_GET_REG(RSI, esi);
-    CASE_GET_REG(RDI, edi);
-    CASE_GET_REG(RSP, esp);
-    CASE_GET_REG(R8, r8);
-    CASE_GET_REG(R9, r9);
-    CASE_GET_REG(R10, r10);
-    CASE_GET_REG(R11, r11);
-    CASE_GET_REG(R12, r12);
-    CASE_GET_REG(R13, r13);
-    CASE_GET_REG(R14, r14);
-    CASE_GET_REG(R15, r15);
-    default:
-        break;
-    }
-
-    return value;
+    return *pval;
 }
 
 static void reg_write(struct cpu_user_regs *regs,
                       enum vmx_regs_enc index,
                       unsigned long value)
 {
-    switch ( index ) {
-    CASE_SET_REG(RAX, eax);
-    CASE_SET_REG(RCX, ecx);
-    CASE_SET_REG(RDX, edx);
-    CASE_SET_REG(RBX, ebx);
-    CASE_SET_REG(RBP, ebp);
-    CASE_SET_REG(RSI, esi);
-    CASE_SET_REG(RDI, edi);
-    CASE_SET_REG(RSP, esp);
-    CASE_SET_REG(R8, r8);
-    CASE_SET_REG(R9, r9);
-    CASE_SET_REG(R10, r10);
-    CASE_SET_REG(R11, r11);
-    CASE_SET_REG(R12, r12);
-    CASE_SET_REG(R13, r13);
-    CASE_SET_REG(R14, r14);
-    CASE_SET_REG(R15, r15);
-    default:
-        break;
-    }
+    unsigned long *pval = decode_register(index, regs, 0);
+
+    *pval = value;
 }
 
 static inline u32 __n2_exec_control(struct vcpu *v)
diff -r d0d7e20b9989 -r 761def707575 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c	Thu Oct 04 09:03:06 2012 +0200
+++ b/xen/arch/x86/traps.c	Thu Oct 04 09:05:24 2012 +0200
@@ -367,34 +367,6 @@ void vcpu_show_execution_state(struct vc
     vcpu_unpause(v);
 }
 
-unsigned long *get_x86_gpr(struct cpu_user_regs *regs, unsigned int modrm_reg)
-{
-    void *p;
-
-    switch ( modrm_reg )
-    {
-    case  0: p = &regs->eax; break;
-    case  1: p = &regs->ecx; break;
-    case  2: p = &regs->edx; break;
-    case  3: p = &regs->ebx; break;
-    case  4: p = &regs->esp; break;
-    case  5: p = &regs->ebp; break;
-    case  6: p = &regs->esi; break;
-    case  7: p = &regs->edi; break;
-    case  8: p = &regs->r8;  break;
-    case  9: p = &regs->r9;  break;
-    case 10: p = &regs->r10; break;
-    case 11: p = &regs->r11; break;
-    case 12: p = &regs->r12; break;
-    case 13: p = &regs->r13; break;
-    case 14: p = &regs->r14; break;
-    case 15: p = &regs->r15; break;
-    default: p = NULL; break;
-    }
-
-    return p;
-}
-
 static char *trapstr(int trapnr)
 {
     static char *strings[] = { 
diff -r d0d7e20b9989 -r 761def707575 xen/include/asm-x86/processor.h
--- a/xen/include/asm-x86/processor.h	Thu Oct 04 09:03:06 2012 +0200
+++ b/xen/include/asm-x86/processor.h	Thu Oct 04 09:05:24 2012 +0200
@@ -552,8 +552,6 @@ void microcode_set_module(unsigned int);
 int microcode_update(XEN_GUEST_HANDLE(const_void), unsigned long len);
 int microcode_resume_cpu(int cpu);
 
-unsigned long *get_x86_gpr(struct cpu_user_regs *regs, unsigned int modrm_reg);
-
 #endif /* !__ASSEMBLY__ */
 
 #endif /* __ASM_X86_PROCESSOR_H */

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

From xen-changelog-bounces@lists.xen.org Thu Oct 04 21:11:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 04 Oct 2012 21:11:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TJshR-0002V3-RR; Thu, 04 Oct 2012 21:11:17 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJshQ-0002UC-PW
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 21:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-27.messagelabs.com!1349385068!8798095!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29321 invoked from network); 4 Oct 2012 21:11:10 -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;
	4 Oct 2012 21:11:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJshI-0008Ic-I8
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 21:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJshI-0004q4-Db
	for xen-changelog@lists.xensource.com; Thu, 04 Oct 2012 21:11:08 +0000
Message-Id: <E1TJshI-0004q4-Db@xenbits.xen.org>
Date: Thu, 04 Oct 2012 21:11:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: consolidate frame state
	manipulation functions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1349334324 -7200
# Node ID 761def707575b154fa29e29d7962048352165c0d
# Parent  d0d7e20b998969234eb5dc41a56e91d7f7f1378a
x86: consolidate frame state manipulation functions

Rather than doing this in multiple places, have a single central
function (decode_register()) to be used by all other code.

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


diff -r d0d7e20b9989 -r 761def707575 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Thu Oct 04 09:03:06 2012 +0200
+++ b/xen/arch/x86/hvm/hvm.c	Thu Oct 04 09:05:24 2012 +0200
@@ -1585,7 +1585,7 @@ int hvm_mov_to_cr(unsigned int cr, unsig
     struct vcpu *curr = current;
     unsigned long val, *reg;
 
-    if ( (reg = get_x86_gpr(guest_cpu_user_regs(), gpr)) == NULL )
+    if ( (reg = decode_register(gpr, guest_cpu_user_regs(), 0)) == NULL )
     {
         gdprintk(XENLOG_ERR, "invalid gpr: %u\n", gpr);
         goto exit_and_crash;
@@ -1627,7 +1627,7 @@ int hvm_mov_from_cr(unsigned int cr, uns
     struct vcpu *curr = current;
     unsigned long val = 0, *reg;
 
-    if ( (reg = get_x86_gpr(guest_cpu_user_regs(), gpr)) == NULL )
+    if ( (reg = decode_register(gpr, guest_cpu_user_regs(), 0)) == NULL )
     {
         gdprintk(XENLOG_ERR, "invalid gpr: %u\n", gpr);
         goto exit_and_crash;
diff -r d0d7e20b9989 -r 761def707575 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Thu Oct 04 09:03:06 2012 +0200
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Thu Oct 04 09:05:24 2012 +0200
@@ -223,56 +223,18 @@ void __set_vvmcs(void *vvmcs, u32 vmcs_e
 static unsigned long reg_read(struct cpu_user_regs *regs,
                               enum vmx_regs_enc index)
 {
-    unsigned long value = 0;
+    unsigned long *pval = decode_register(index, regs, 0);
 
-    switch ( index ) {
-    CASE_GET_REG(RAX, eax);
-    CASE_GET_REG(RCX, ecx);
-    CASE_GET_REG(RDX, edx);
-    CASE_GET_REG(RBX, ebx);
-    CASE_GET_REG(RBP, ebp);
-    CASE_GET_REG(RSI, esi);
-    CASE_GET_REG(RDI, edi);
-    CASE_GET_REG(RSP, esp);
-    CASE_GET_REG(R8, r8);
-    CASE_GET_REG(R9, r9);
-    CASE_GET_REG(R10, r10);
-    CASE_GET_REG(R11, r11);
-    CASE_GET_REG(R12, r12);
-    CASE_GET_REG(R13, r13);
-    CASE_GET_REG(R14, r14);
-    CASE_GET_REG(R15, r15);
-    default:
-        break;
-    }
-
-    return value;
+    return *pval;
 }
 
 static void reg_write(struct cpu_user_regs *regs,
                       enum vmx_regs_enc index,
                       unsigned long value)
 {
-    switch ( index ) {
-    CASE_SET_REG(RAX, eax);
-    CASE_SET_REG(RCX, ecx);
-    CASE_SET_REG(RDX, edx);
-    CASE_SET_REG(RBX, ebx);
-    CASE_SET_REG(RBP, ebp);
-    CASE_SET_REG(RSI, esi);
-    CASE_SET_REG(RDI, edi);
-    CASE_SET_REG(RSP, esp);
-    CASE_SET_REG(R8, r8);
-    CASE_SET_REG(R9, r9);
-    CASE_SET_REG(R10, r10);
-    CASE_SET_REG(R11, r11);
-    CASE_SET_REG(R12, r12);
-    CASE_SET_REG(R13, r13);
-    CASE_SET_REG(R14, r14);
-    CASE_SET_REG(R15, r15);
-    default:
-        break;
-    }
+    unsigned long *pval = decode_register(index, regs, 0);
+
+    *pval = value;
 }
 
 static inline u32 __n2_exec_control(struct vcpu *v)
diff -r d0d7e20b9989 -r 761def707575 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c	Thu Oct 04 09:03:06 2012 +0200
+++ b/xen/arch/x86/traps.c	Thu Oct 04 09:05:24 2012 +0200
@@ -367,34 +367,6 @@ void vcpu_show_execution_state(struct vc
     vcpu_unpause(v);
 }
 
-unsigned long *get_x86_gpr(struct cpu_user_regs *regs, unsigned int modrm_reg)
-{
-    void *p;
-
-    switch ( modrm_reg )
-    {
-    case  0: p = &regs->eax; break;
-    case  1: p = &regs->ecx; break;
-    case  2: p = &regs->edx; break;
-    case  3: p = &regs->ebx; break;
-    case  4: p = &regs->esp; break;
-    case  5: p = &regs->ebp; break;
-    case  6: p = &regs->esi; break;
-    case  7: p = &regs->edi; break;
-    case  8: p = &regs->r8;  break;
-    case  9: p = &regs->r9;  break;
-    case 10: p = &regs->r10; break;
-    case 11: p = &regs->r11; break;
-    case 12: p = &regs->r12; break;
-    case 13: p = &regs->r13; break;
-    case 14: p = &regs->r14; break;
-    case 15: p = &regs->r15; break;
-    default: p = NULL; break;
-    }
-
-    return p;
-}
-
 static char *trapstr(int trapnr)
 {
     static char *strings[] = { 
diff -r d0d7e20b9989 -r 761def707575 xen/include/asm-x86/processor.h
--- a/xen/include/asm-x86/processor.h	Thu Oct 04 09:03:06 2012 +0200
+++ b/xen/include/asm-x86/processor.h	Thu Oct 04 09:05:24 2012 +0200
@@ -552,8 +552,6 @@ void microcode_set_module(unsigned int);
 int microcode_update(XEN_GUEST_HANDLE(const_void), unsigned long len);
 int microcode_resume_cpu(int cpu);
 
-unsigned long *get_x86_gpr(struct cpu_user_regs *regs, unsigned int modrm_reg);
-
 #endif /* !__ASSEMBLY__ */
 
 #endif /* __ASM_X86_PROCESSOR_H */

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

From xen-changelog-bounces@lists.xen.org Fri Oct 05 00:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Oct 2012 00:55:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TJwCF-00059O-25; Fri, 05 Oct 2012 00:55:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwCD-00058r-Pv
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:18 +0000
Received: from [85.158.139.83:47885] by server-8.bemta-5.messagelabs.com id
	17/62-20246-5FF2E605; Fri, 05 Oct 2012 00:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-182.messagelabs.com!1349398514!32951406!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27975 invoked from network); 5 Oct 2012 00:55:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2012 00:55:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwCA-0002bR-Cv
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwCA-0002FG-8R
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:14 +0000
Message-Id: <E1TJwCA-0002FG-8R@xenbits.xen.org>
Date: Fri, 05 Oct 2012 00:55:13 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86/HPET: don't disable interrupt
	delivery right after setting it up
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1349338484 -7200
# Node ID 051661b76ade63e9963b987e6917f6bc0a42f9c1
# Parent  b4bda6995bc16dfa40188b50c6d9a20392175cf7
x86/HPET: don't disable interrupt delivery right after setting it up

We shouldn't clear HPET_TN_FSB right after we (indirectly, via
request_irq()) enabled it for the channels we intend to use for
broadcasts.

This fixes a regression introduced by c/s 25103:0b0e42dc4f0a.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25961:6a5812129094
xen-unstable date: Fri Sep 28 07:22:14 UTC 2012
---


diff -r b4bda6995bc1 -r 051661b76ade xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c	Thu Oct 04 10:13:55 2012 +0200
+++ b/xen/arch/x86/hpet.c	Thu Oct 04 10:14:44 2012 +0200
@@ -533,7 +533,7 @@ void __init hpet_broadcast_init(void)
     {
         /* set HPET Tn as oneshot */
         cfg = hpet_read32(HPET_Tn_CFG(hpet_events[i].idx));
-        cfg &= ~(HPET_TN_LEVEL | HPET_TN_PERIODIC | HPET_TN_FSB);
+        cfg &= ~(HPET_TN_LEVEL | HPET_TN_PERIODIC);
         cfg |= HPET_TN_ENABLE | HPET_TN_32BIT;
         hpet_write32(cfg, HPET_Tn_CFG(hpet_events[i].idx));
 
@@ -590,7 +590,7 @@ void hpet_broadcast_resume(void)
 
         /* set HPET Tn as oneshot */
         cfg = hpet_read32(HPET_Tn_CFG(hpet_events[i].idx));
-        cfg &= ~(HPET_TN_LEVEL | HPET_TN_PERIODIC | HPET_TN_FSB);
+        cfg &= ~(HPET_TN_LEVEL | HPET_TN_PERIODIC);
         cfg |= HPET_TN_ENABLE | HPET_TN_32BIT;
         hpet_write32(cfg, HPET_Tn_CFG(hpet_events[i].idx));
 

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

From xen-changelog-bounces@lists.xen.org Fri Oct 05 00:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Oct 2012 00:55:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TJwCF-00059O-25; Fri, 05 Oct 2012 00:55:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwCD-00058r-Pv
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:18 +0000
Received: from [85.158.139.83:47885] by server-8.bemta-5.messagelabs.com id
	17/62-20246-5FF2E605; Fri, 05 Oct 2012 00:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-182.messagelabs.com!1349398514!32951406!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27975 invoked from network); 5 Oct 2012 00:55:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2012 00:55:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwCA-0002bR-Cv
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwCA-0002FG-8R
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:14 +0000
Message-Id: <E1TJwCA-0002FG-8R@xenbits.xen.org>
Date: Fri, 05 Oct 2012 00:55:13 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86/HPET: don't disable interrupt
	delivery right after setting it up
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1349338484 -7200
# Node ID 051661b76ade63e9963b987e6917f6bc0a42f9c1
# Parent  b4bda6995bc16dfa40188b50c6d9a20392175cf7
x86/HPET: don't disable interrupt delivery right after setting it up

We shouldn't clear HPET_TN_FSB right after we (indirectly, via
request_irq()) enabled it for the channels we intend to use for
broadcasts.

This fixes a regression introduced by c/s 25103:0b0e42dc4f0a.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25961:6a5812129094
xen-unstable date: Fri Sep 28 07:22:14 UTC 2012
---


diff -r b4bda6995bc1 -r 051661b76ade xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c	Thu Oct 04 10:13:55 2012 +0200
+++ b/xen/arch/x86/hpet.c	Thu Oct 04 10:14:44 2012 +0200
@@ -533,7 +533,7 @@ void __init hpet_broadcast_init(void)
     {
         /* set HPET Tn as oneshot */
         cfg = hpet_read32(HPET_Tn_CFG(hpet_events[i].idx));
-        cfg &= ~(HPET_TN_LEVEL | HPET_TN_PERIODIC | HPET_TN_FSB);
+        cfg &= ~(HPET_TN_LEVEL | HPET_TN_PERIODIC);
         cfg |= HPET_TN_ENABLE | HPET_TN_32BIT;
         hpet_write32(cfg, HPET_Tn_CFG(hpet_events[i].idx));
 
@@ -590,7 +590,7 @@ void hpet_broadcast_resume(void)
 
         /* set HPET Tn as oneshot */
         cfg = hpet_read32(HPET_Tn_CFG(hpet_events[i].idx));
-        cfg &= ~(HPET_TN_LEVEL | HPET_TN_PERIODIC | HPET_TN_FSB);
+        cfg &= ~(HPET_TN_LEVEL | HPET_TN_PERIODIC);
         cfg |= HPET_TN_ENABLE | HPET_TN_32BIT;
         hpet_write32(cfg, HPET_Tn_CFG(hpet_events[i].idx));
 

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

From xen-changelog-bounces@lists.xen.org Fri Oct 05 00:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Oct 2012 00:55:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TJwCD-000592-Ph; Fri, 05 Oct 2012 00:55:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwCC-00058k-Se
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:17 +0000
Received: from [85.158.137.99:35935] by server-14.bemta-3.messagelabs.com id
	8F/E2-19528-3FF2E605; Fri, 05 Oct 2012 00:55:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-217.messagelabs.com!1349398513!15542449!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18153 invoked from network); 5 Oct 2012 00:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2012 00:55:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwC9-0002bK-Gi
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwC9-0002Em-5u
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:13 +0000
Message-Id: <E1TJwC9-0002Em-5u@xenbits.xen.org>
Date: Fri, 05 Oct 2012 00:55:12 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86/S3: add cache flush on
	secondary CPUs before going to sleep
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ben Guthro <ben@guthro.net>
# Date 1349338363 -7200
# Node ID b0aed9cadf103ac44d82f46eacd8b056c604fbc0
# Parent  ffabc1ebd9131870e0dd66baa835ee49cfd4aaa9
x86/S3: add cache flush on secondary CPUs before going to sleep

Secondary CPUs, between doing their final memory writes (particularly
updating cpu_initialized) and getting a subsequent INIT, may not write
back all modified data. The INIT itself then causes those modifications
to be lost, so in the cpu_initialized case the CPU would find itself
already initialized, (intentionally) entering an infinite loop instead
of actually coming online.

Signed-off-by: Ben Guthro <ben@guthro.net>

Make acpi_dead_idle() call default_dead_idle() rather than duplicating
the logic there.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25940:c8d65d91a6f2
xen-unstable date: Tue Sep 25 06:38:14 UTC 2012
---


diff -r ffabc1ebd913 -r b0aed9cadf10 xen/arch/x86/acpi/cpu_idle.c
--- a/xen/arch/x86/acpi/cpu_idle.c	Thu Oct 04 10:11:11 2012 +0200
+++ b/xen/arch/x86/acpi/cpu_idle.c	Thu Oct 04 10:12:43 2012 +0200
@@ -647,6 +647,12 @@ static void acpi_dead_idle(void)
     }
 
 default_halt:
+    /*
+     * When going into S3, without flushing caches modified data may be
+     * held by the CPUs spinning here indefinitely, and get discarded by
+     * a subsequent INIT.
+     */
+    wbinvd();
     for ( ; ; )
         halt();
 }
diff -r ffabc1ebd913 -r b0aed9cadf10 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Thu Oct 04 10:11:11 2012 +0200
+++ b/xen/arch/x86/domain.c	Thu Oct 04 10:12:43 2012 +0200
@@ -86,6 +86,12 @@ static void default_idle(void)
 
 static void default_dead_idle(void)
 {
+    /*
+     * When going into S3, without flushing caches modified data may be
+     * held by the CPUs spinning here indefinitely, and get discarded by
+     * a subsequent INIT.
+     */
+    wbinvd();
     for ( ; ; )
         halt();
 }

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

From xen-changelog-bounces@lists.xen.org Fri Oct 05 00:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Oct 2012 00:55:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TJwCD-000592-Ph; Fri, 05 Oct 2012 00:55:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwCC-00058k-Se
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:17 +0000
Received: from [85.158.137.99:35935] by server-14.bemta-3.messagelabs.com id
	8F/E2-19528-3FF2E605; Fri, 05 Oct 2012 00:55:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-217.messagelabs.com!1349398513!15542449!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18153 invoked from network); 5 Oct 2012 00:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2012 00:55:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwC9-0002bK-Gi
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwC9-0002Em-5u
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:13 +0000
Message-Id: <E1TJwC9-0002Em-5u@xenbits.xen.org>
Date: Fri, 05 Oct 2012 00:55:12 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86/S3: add cache flush on
	secondary CPUs before going to sleep
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ben Guthro <ben@guthro.net>
# Date 1349338363 -7200
# Node ID b0aed9cadf103ac44d82f46eacd8b056c604fbc0
# Parent  ffabc1ebd9131870e0dd66baa835ee49cfd4aaa9
x86/S3: add cache flush on secondary CPUs before going to sleep

Secondary CPUs, between doing their final memory writes (particularly
updating cpu_initialized) and getting a subsequent INIT, may not write
back all modified data. The INIT itself then causes those modifications
to be lost, so in the cpu_initialized case the CPU would find itself
already initialized, (intentionally) entering an infinite loop instead
of actually coming online.

Signed-off-by: Ben Guthro <ben@guthro.net>

Make acpi_dead_idle() call default_dead_idle() rather than duplicating
the logic there.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25940:c8d65d91a6f2
xen-unstable date: Tue Sep 25 06:38:14 UTC 2012
---


diff -r ffabc1ebd913 -r b0aed9cadf10 xen/arch/x86/acpi/cpu_idle.c
--- a/xen/arch/x86/acpi/cpu_idle.c	Thu Oct 04 10:11:11 2012 +0200
+++ b/xen/arch/x86/acpi/cpu_idle.c	Thu Oct 04 10:12:43 2012 +0200
@@ -647,6 +647,12 @@ static void acpi_dead_idle(void)
     }
 
 default_halt:
+    /*
+     * When going into S3, without flushing caches modified data may be
+     * held by the CPUs spinning here indefinitely, and get discarded by
+     * a subsequent INIT.
+     */
+    wbinvd();
     for ( ; ; )
         halt();
 }
diff -r ffabc1ebd913 -r b0aed9cadf10 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Thu Oct 04 10:11:11 2012 +0200
+++ b/xen/arch/x86/domain.c	Thu Oct 04 10:12:43 2012 +0200
@@ -86,6 +86,12 @@ static void default_idle(void)
 
 static void default_dead_idle(void)
 {
+    /*
+     * When going into S3, without flushing caches modified data may be
+     * held by the CPUs spinning here indefinitely, and get discarded by
+     * a subsequent INIT.
+     */
+    wbinvd();
     for ( ; ; )
         halt();
 }

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

From xen-changelog-bounces@lists.xen.org Fri Oct 05 00:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Oct 2012 00:55:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TJwCG-00059c-4Q; Fri, 05 Oct 2012 00:55:20 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwCE-00059G-UH
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:19 +0000
Received: from [85.158.138.51:11150] by server-10.bemta-3.messagelabs.com id
	81/03-02525-5FF2E605; Fri, 05 Oct 2012 00:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-174.messagelabs.com!1349398515!25551405!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11417 invoked from network); 5 Oct 2012 00:55:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2012 00:55:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwCB-0002bX-EI
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwCB-0002Fk-A5
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:15 +0000
Message-Id: <E1TJwCB-0002Fk-A5@xenbits.xen.org>
Date: Fri, 05 Oct 2012 00:55:14 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86/ucode: fix Intel case of
	resume handling on boot CPU
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1349338580 -7200
# Node ID a69c8e5c4afcc5a116ec9d3953db425197dc028c
# Parent  648c99c230ff3fe75052973251a37ba9c68c6f84
x86/ucode: fix Intel case of resume handling on boot CPU

Checking the stored version doesn't tell us anything about the need to
apply the update (during resume, what is stored doesn't necessarily
match what is loaded).

Note that the check can be removed altogether because once switched to
use what was read from the CPU (uci->cpu_sig.rev, as used in the
subsequent pr_debug()), it would become redundant with the checks that
lead to microcode_update_match() returning the indication that an
update should be applied.

Note further that this was not an issue on APs since they start with
uci->mc.mc_intel being NULL.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Ben Guthro <ben@guthro.net>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25965:4496d56c68a0
xen-unstable date: Fri Sep 28 07:28:11 UTC 2012
---


diff -r 648c99c230ff -r a69c8e5c4afc xen/arch/x86/microcode_intel.c
--- a/xen/arch/x86/microcode_intel.c	Thu Oct 04 10:15:16 2012 +0200
+++ b/xen/arch/x86/microcode_intel.c	Thu Oct 04 10:16:20 2012 +0200
@@ -261,8 +261,6 @@ static int get_matching_microcode(const 
     }
     return 0;
  find:
-    if ( uci->mc.mc_intel && uci->mc.mc_intel->hdr.rev >= mc_header->rev )
-        return 0;
     pr_debug("microcode: CPU%d found a matching microcode update with"
              " version 0x%x (current=0x%x)\n",
              cpu, mc_header->rev, uci->cpu_sig.rev);

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

From xen-changelog-bounces@lists.xen.org Fri Oct 05 00:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Oct 2012 00:55:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TJwCG-00059c-4Q; Fri, 05 Oct 2012 00:55:20 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwCE-00059G-UH
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:19 +0000
Received: from [85.158.138.51:11150] by server-10.bemta-3.messagelabs.com id
	81/03-02525-5FF2E605; Fri, 05 Oct 2012 00:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-174.messagelabs.com!1349398515!25551405!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11417 invoked from network); 5 Oct 2012 00:55:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2012 00:55:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwCB-0002bX-EI
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwCB-0002Fk-A5
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:15 +0000
Message-Id: <E1TJwCB-0002Fk-A5@xenbits.xen.org>
Date: Fri, 05 Oct 2012 00:55:14 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86/ucode: fix Intel case of
	resume handling on boot CPU
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1349338580 -7200
# Node ID a69c8e5c4afcc5a116ec9d3953db425197dc028c
# Parent  648c99c230ff3fe75052973251a37ba9c68c6f84
x86/ucode: fix Intel case of resume handling on boot CPU

Checking the stored version doesn't tell us anything about the need to
apply the update (during resume, what is stored doesn't necessarily
match what is loaded).

Note that the check can be removed altogether because once switched to
use what was read from the CPU (uci->cpu_sig.rev, as used in the
subsequent pr_debug()), it would become redundant with the checks that
lead to microcode_update_match() returning the indication that an
update should be applied.

Note further that this was not an issue on APs since they start with
uci->mc.mc_intel being NULL.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Ben Guthro <ben@guthro.net>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25965:4496d56c68a0
xen-unstable date: Fri Sep 28 07:28:11 UTC 2012
---


diff -r 648c99c230ff -r a69c8e5c4afc xen/arch/x86/microcode_intel.c
--- a/xen/arch/x86/microcode_intel.c	Thu Oct 04 10:15:16 2012 +0200
+++ b/xen/arch/x86/microcode_intel.c	Thu Oct 04 10:16:20 2012 +0200
@@ -261,8 +261,6 @@ static int get_matching_microcode(const 
     }
     return 0;
  find:
-    if ( uci->mc.mc_intel && uci->mc.mc_intel->hdr.rev >= mc_header->rev )
-        return 0;
     pr_debug("microcode: CPU%d found a matching microcode update with"
              " version 0x%x (current=0x%x)\n",
              cpu, mc_header->rev, uci->cpu_sig.rev);

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

From xen-changelog-bounces@lists.xen.org Fri Oct 05 00:55:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Oct 2012 00: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 1TJwCD-000597-Sg; Fri, 05 Oct 2012 00:55:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwCD-00058m-8N
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:17 +0000
Received: from [85.158.143.35:24466] by server-1.bemta-4.messagelabs.com id
	18/F0-05684-4FF2E605; Fri, 05 Oct 2012 00:55:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1349398514!5131476!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14548 invoked from network); 5 Oct 2012 00:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2012 00:55:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwC9-0002bO-WC
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwC9-0002F1-Nv
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:13 +0000
Message-Id: <E1TJwC9-0002F1-Nv@xenbits.xen.org>
Date: Fri, 05 Oct 2012 00:55:13 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86: check remote MMIO remap
	permissions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1349338435 -7200
# Node ID b4bda6995bc16dfa40188b50c6d9a20392175cf7
# Parent  b0aed9cadf103ac44d82f46eacd8b056c604fbc0
x86: check remote MMIO remap permissions

When a domain is mapping pages from a different pg_owner domain, the
iomem_access checks are currently only applied to the pg_owner domain,
potentially allowing a domain with a more restrictive iomem_access
policy to have the pages mapped into its page tables. To catch this,
also check the owner of the page tables. The current domain does not
need to be checked because the ability to manipulate a domain's page
tables implies full access to the target domain, so checking that
domain's permission is sufficient.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 25952:8278d7d8fa48
xen-unstable date: Wed Sep 26 09:56:07 UTC 2012
---


diff -r b0aed9cadf10 -r b4bda6995bc1 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Thu Oct 04 10:12:43 2012 +0200
+++ b/xen/arch/x86/mm.c	Thu Oct 04 10:13:55 2012 +0200
@@ -866,6 +866,19 @@ get_page_from_l1e(
             return -EINVAL;
         }
 
+        if ( pg_owner != l1e_owner &&
+             !iomem_access_permitted(l1e_owner, mfn, mfn) )
+        {
+            if ( mfn != (PADDR_MASK >> PAGE_SHIFT) ) /* INVALID_MFN? */
+            {
+                MEM_LOG("Dom%u attempted to map I/O space %08lx in dom%u to dom%u",
+                        curr->domain->domain_id, mfn, pg_owner->domain_id,
+                        l1e_owner->domain_id);
+                return -EPERM;
+            }
+            return -EINVAL;
+        }
+
         if ( !(l1f & _PAGE_RW) ||
              !rangeset_contains_singleton(mmio_ro_ranges, mfn) )
             return 0;

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

From xen-changelog-bounces@lists.xen.org Fri Oct 05 00:55:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Oct 2012 00: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 1TJwCD-000597-Sg; Fri, 05 Oct 2012 00:55:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwCD-00058m-8N
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:17 +0000
Received: from [85.158.143.35:24466] by server-1.bemta-4.messagelabs.com id
	18/F0-05684-4FF2E605; Fri, 05 Oct 2012 00:55:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1349398514!5131476!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14548 invoked from network); 5 Oct 2012 00:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2012 00:55:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwC9-0002bO-WC
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwC9-0002F1-Nv
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:13 +0000
Message-Id: <E1TJwC9-0002F1-Nv@xenbits.xen.org>
Date: Fri, 05 Oct 2012 00:55:13 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86: check remote MMIO remap
	permissions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1349338435 -7200
# Node ID b4bda6995bc16dfa40188b50c6d9a20392175cf7
# Parent  b0aed9cadf103ac44d82f46eacd8b056c604fbc0
x86: check remote MMIO remap permissions

When a domain is mapping pages from a different pg_owner domain, the
iomem_access checks are currently only applied to the pg_owner domain,
potentially allowing a domain with a more restrictive iomem_access
policy to have the pages mapped into its page tables. To catch this,
also check the owner of the page tables. The current domain does not
need to be checked because the ability to manipulate a domain's page
tables implies full access to the target domain, so checking that
domain's permission is sufficient.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 25952:8278d7d8fa48
xen-unstable date: Wed Sep 26 09:56:07 UTC 2012
---


diff -r b0aed9cadf10 -r b4bda6995bc1 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Thu Oct 04 10:12:43 2012 +0200
+++ b/xen/arch/x86/mm.c	Thu Oct 04 10:13:55 2012 +0200
@@ -866,6 +866,19 @@ get_page_from_l1e(
             return -EINVAL;
         }
 
+        if ( pg_owner != l1e_owner &&
+             !iomem_access_permitted(l1e_owner, mfn, mfn) )
+        {
+            if ( mfn != (PADDR_MASK >> PAGE_SHIFT) ) /* INVALID_MFN? */
+            {
+                MEM_LOG("Dom%u attempted to map I/O space %08lx in dom%u to dom%u",
+                        curr->domain->domain_id, mfn, pg_owner->domain_id,
+                        l1e_owner->domain_id);
+                return -EPERM;
+            }
+            return -EINVAL;
+        }
+
         if ( !(l1f & _PAGE_RW) ||
              !rangeset_contains_singleton(mmio_ro_ranges, mfn) )
             return 0;

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

From xen-changelog-bounces@lists.xen.org Fri Oct 05 00:55:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Oct 2012 00:55:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TJwCK-0005AU-8Q; Fri, 05 Oct 2012 00:55:24 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwCJ-000591-6D
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-27.messagelabs.com!1349398515!11546598!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10591 invoked from network); 5 Oct 2012 00:55:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2012 00:55:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwCB-0002bU-0a
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwCA-0002FV-PT
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:14 +0000
Message-Id: <E1TJwCA-0002FV-PT@xenbits.xen.org>
Date: Fri, 05 Oct 2012 00:55:14 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86/IRQ: fix valid-old-vector
	checks in __assign_irq_vector()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1349338516 -7200
# Node ID 648c99c230ff3fe75052973251a37ba9c68c6f84
# Parent  051661b76ade63e9963b987e6917f6bc0a42f9c1
x86/IRQ: fix valid-old-vector checks in __assign_irq_vector()

There are two greater-than-zero checks for the old vector retrieved,
which don't work when a negative value got stashed into the respective
arch_irq_desc field. The effect of this was that for interrupts that
are intended to get their affinity adjusted the first time before the
first interrupt occurs, the affinity change would fail, because the
original vector assignment would have caused the move_in_progress flag
to get set (which causes subsequent re-assignments to fail until it
gets cleared, which only happens from the ->ack() actor, i.e. when an
interrupt actually occurred).

This addresses a problem introduced in c/s 23816:7f357e1ef60a (by
changing IRQ_VECTOR_UNASSIGNED from 0 to -1).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25962:41f523f1b5e5
xen-unstable date: Fri Sep 28 07:23:34 UTC 2012
---


diff -r 051661b76ade -r 648c99c230ff xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c	Thu Oct 04 10:14:44 2012 +0200
+++ b/xen/arch/x86/irq.c	Thu Oct 04 10:15:16 2012 +0200
@@ -430,8 +430,7 @@ static int __assign_irq_vector(
      * 0x80, because int 0x80 is hm, kind of importantish. ;)
      */
     static int current_vector = FIRST_DYNAMIC_VECTOR, current_offset = 0;
-    unsigned int old_vector;
-    int cpu, err;
+    int cpu, err, old_vector;
     cpumask_t tmp_mask;
     vmask_t *irq_used_vectors = NULL;
 

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

From xen-changelog-bounces@lists.xen.org Fri Oct 05 00:55:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Oct 2012 00:55:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TJwCK-0005AU-8Q; Fri, 05 Oct 2012 00:55:24 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwCJ-000591-6D
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-27.messagelabs.com!1349398515!11546598!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10591 invoked from network); 5 Oct 2012 00:55:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2012 00:55:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwCB-0002bU-0a
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwCA-0002FV-PT
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:14 +0000
Message-Id: <E1TJwCA-0002FV-PT@xenbits.xen.org>
Date: Fri, 05 Oct 2012 00:55:14 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86/IRQ: fix valid-old-vector
	checks in __assign_irq_vector()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1349338516 -7200
# Node ID 648c99c230ff3fe75052973251a37ba9c68c6f84
# Parent  051661b76ade63e9963b987e6917f6bc0a42f9c1
x86/IRQ: fix valid-old-vector checks in __assign_irq_vector()

There are two greater-than-zero checks for the old vector retrieved,
which don't work when a negative value got stashed into the respective
arch_irq_desc field. The effect of this was that for interrupts that
are intended to get their affinity adjusted the first time before the
first interrupt occurs, the affinity change would fail, because the
original vector assignment would have caused the move_in_progress flag
to get set (which causes subsequent re-assignments to fail until it
gets cleared, which only happens from the ->ack() actor, i.e. when an
interrupt actually occurred).

This addresses a problem introduced in c/s 23816:7f357e1ef60a (by
changing IRQ_VECTOR_UNASSIGNED from 0 to -1).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25962:41f523f1b5e5
xen-unstable date: Fri Sep 28 07:23:34 UTC 2012
---


diff -r 051661b76ade -r 648c99c230ff xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c	Thu Oct 04 10:14:44 2012 +0200
+++ b/xen/arch/x86/irq.c	Thu Oct 04 10:15:16 2012 +0200
@@ -430,8 +430,7 @@ static int __assign_irq_vector(
      * 0x80, because int 0x80 is hm, kind of importantish. ;)
      */
     static int current_vector = FIRST_DYNAMIC_VECTOR, current_offset = 0;
-    unsigned int old_vector;
-    int cpu, err;
+    int cpu, err, old_vector;
     cpumask_t tmp_mask;
     vmask_t *irq_used_vectors = NULL;
 

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

From xen-changelog-bounces@lists.xen.org Fri Oct 05 00:55:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Oct 2012 00: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 1TJwCE-00059J-Vn; Fri, 05 Oct 2012 00:55:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwCD-00058l-9j
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:17 +0000
Received: from [85.158.138.51:2997] by server-7.bemta-3.messagelabs.com id
	19/56-15765-4FF2E605; Fri, 05 Oct 2012 00:55:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-174.messagelabs.com!1349398513!25230356!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22860 invoked from network); 5 Oct 2012 00:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2012 00:55:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwC9-0002bI-1s
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwC8-0002EX-I2
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:12 +0000
Message-Id: <E1TJwC8-0002EX-I2@xenbits.xen.org>
Date: Fri, 05 Oct 2012 00:55:12 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86: tighten checks in
	XEN_DOMCTL_memory_mapping handler
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1349338271 -7200
# Node ID ffabc1ebd9131870e0dd66baa835ee49cfd4aaa9
# Parent  63823a6785fcc79ebc09ab847e282e8982fcdd82
x86: tighten checks in XEN_DOMCTL_memory_mapping handler

Properly checking the MFN implies knowing the physical address width
supported by the platform, so to obtain this consistently the
respective code gets moved out of the MTRR subdir.

Btw., the model specific workaround in that code is likely unnecessary
- I believe those CPU models don't support 64-bit mode. But I wasn't
able to formally verify this, so I preferred to retain that code for
now.

But domctl code here also was lacking other error checks (as was,
looking at it again from that angle) the XEN_DOMCTL_ioport_mapping one.
Besides adding the missing checks, printing is also added for the case
where revoking access permissions didn't work (as that may have
implications for the host operator, e.g. wanting to not pass through
affected devices to another guest until the one previously using them
did actually die).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25931:149805919569
xen-unstable date: Thu Sep 20 07:21:53 UTC 2012
---


diff -r 63823a6785fc -r ffabc1ebd913 xen/arch/x86/cpu/centaur.c
--- a/xen/arch/x86/cpu/centaur.c	Thu Oct 04 10:10:23 2012 +0200
+++ b/xen/arch/x86/cpu/centaur.c	Thu Oct 04 10:11:11 2012 +0200
@@ -56,6 +56,9 @@ static void __init init_c3(struct cpuinf
 	if (c->x86_model >=6 && c->x86_model <9)
 		set_bit(X86_FEATURE_3DNOW, c->x86_capability);
 
+	if (cpuid_eax(0x80000000) < 0x80000008)
+		paddr_bits = 32;
+
 	get_model_name(c);
 	display_cacheinfo(c);
 }
diff -r 63823a6785fc -r ffabc1ebd913 xen/arch/x86/cpu/common.c
--- a/xen/arch/x86/cpu/common.c	Thu Oct 04 10:10:23 2012 +0200
+++ b/xen/arch/x86/cpu/common.c	Thu Oct 04 10:11:11 2012 +0200
@@ -36,6 +36,8 @@ integer_param("cpuid_mask_ext_edx", opt_
 
 struct cpu_dev * cpu_devs[X86_VENDOR_NUM] = {};
 
+unsigned int paddr_bits __read_mostly = 36;
+
 /*
  * Default host IA32_CR_PAT value to cover all memory types.
  * BIOS usually sets it to 0x07040600070406.
@@ -265,6 +267,8 @@ static void __cpuinit generic_identify(s
 		}
 		if ( xlvl >= 0x80000004 )
 			get_model_name(c); /* Default name */
+		if ( xlvl >= 0x80000008 )
+			paddr_bits = cpuid_eax(0x80000008) & 0xff;
 	}
 
 	/* Intel-defined flags: level 0x00000007 */
diff -r 63823a6785fc -r ffabc1ebd913 xen/arch/x86/cpu/cyrix.c
--- a/xen/arch/x86/cpu/cyrix.c	Thu Oct 04 10:10:23 2012 +0200
+++ b/xen/arch/x86/cpu/cyrix.c	Thu Oct 04 10:11:11 2012 +0200
@@ -255,7 +255,9 @@ static void __init init_cyrix(struct cpu
 	}
 	safe_strcpy(c->x86_model_id, Cx86_model[dir0_msn & 7]);
 	if (p) safe_strcat(c->x86_model_id, p);
-	return;
+
+	if (cpu_has_cyrix_arr)
+		paddr_bits = 32;
 }
 
 /*
diff -r 63823a6785fc -r ffabc1ebd913 xen/arch/x86/cpu/intel.c
--- a/xen/arch/x86/cpu/intel.c	Thu Oct 04 10:10:23 2012 +0200
+++ b/xen/arch/x86/cpu/intel.c	Thu Oct 04 10:11:11 2012 +0200
@@ -144,6 +144,11 @@ void __devinit early_intel_workaround(st
 				       c->cpuid_level);
 		}
 	}
+
+	/* CPUID workaround for Intel 0F33/0F34 CPU */
+	if (boot_cpu_data.x86 == 0xF && boot_cpu_data.x86_model == 3 &&
+	    (boot_cpu_data.x86_mask == 3 || boot_cpu_data.x86_mask == 4))
+		paddr_bits = 36;
 }
 
 /*
diff -r 63823a6785fc -r ffabc1ebd913 xen/arch/x86/cpu/mtrr/main.c
--- a/xen/arch/x86/cpu/mtrr/main.c	Thu Oct 04 10:10:23 2012 +0200
+++ b/xen/arch/x86/cpu/mtrr/main.c	Thu Oct 04 10:11:11 2012 +0200
@@ -587,8 +587,6 @@ struct mtrr_value {
 	unsigned long	lsize;
 };
 
-unsigned int paddr_bits __read_mostly = 36;
-
 /**
  * mtrr_bp_init - initialize mtrrs on the boot CPU
  *
@@ -602,48 +600,12 @@ void __init mtrr_bp_init(void)
 
 	if (cpu_has_mtrr) {
 		mtrr_if = &generic_mtrr_ops;
-		size_or_mask = 0xff000000;	/* 36 bits */
-		size_and_mask = 0x00f00000;
-
-		/* This is an AMD specific MSR, but we assume(hope?) that
-		   Intel will implement it to when they extend the address
-		   bus of the Xeon. */
-		if (cpuid_eax(0x80000000) >= 0x80000008) {
-			paddr_bits = cpuid_eax(0x80000008) & 0xff;
-			/* CPUID workaround for Intel 0F33/0F34 CPU */
-			if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
-			    boot_cpu_data.x86 == 0xF &&
-			    boot_cpu_data.x86_model == 0x3 &&
-			    (boot_cpu_data.x86_mask == 0x3 ||
-			     boot_cpu_data.x86_mask == 0x4))
-				paddr_bits = 36;
-
-			size_or_mask = ~((1ULL << (paddr_bits - PAGE_SHIFT)) - 1);
-			size_and_mask = ~size_or_mask & 0xfffff00000ULL;
-		} else if (boot_cpu_data.x86_vendor == X86_VENDOR_CENTAUR &&
-			   boot_cpu_data.x86 == 6) {
-			/* VIA C* family have Intel style MTRRs, but
-			   don't support PAE */
-			size_or_mask = 0xfff00000;	/* 32 bits */
-			size_and_mask = 0;
-		}
 	} else {
 #ifndef CONFIG_X86_64
 		switch (boot_cpu_data.x86_vendor) {
-		case X86_VENDOR_AMD:
-			if (cpu_has_k6_mtrr) {
-				/* Pre-Athlon (K6) AMD CPU MTRRs */
-				mtrr_if = mtrr_ops[X86_VENDOR_AMD];
-				size_or_mask = 0xfff00000;	/* 32 bits */
-				size_and_mask = 0;
-			}
-			break;
 		case X86_VENDOR_CYRIX:
-			if (cpu_has_cyrix_arr) {
+			if (cpu_has_cyrix_arr)
 				mtrr_if = mtrr_ops[X86_VENDOR_CYRIX];
-				size_or_mask = 0xfff00000;	/* 32 bits */
-				size_and_mask = 0;
-			}
 			break;
 		default:
 			break;
@@ -652,6 +614,8 @@ void __init mtrr_bp_init(void)
 	}
 
 	if (mtrr_if) {
+		size_or_mask = ~((1ULL << (paddr_bits - PAGE_SHIFT)) - 1);
+		size_and_mask = ~size_or_mask & 0xfffff00000ULL;
 		set_num_var_ranges();
 		init_table();
 		if (use_intel())
diff -r 63823a6785fc -r ffabc1ebd913 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Thu Oct 04 10:10:23 2012 +0200
+++ b/xen/arch/x86/domctl.c	Thu Oct 04 10:11:11 2012 +0200
@@ -829,10 +829,12 @@ long arch_do_domctl(
         unsigned long mfn = domctl->u.memory_mapping.first_mfn;
         unsigned long nr_mfns = domctl->u.memory_mapping.nr_mfns;
         int add = domctl->u.memory_mapping.add_mapping;
-        int i;
+        unsigned long i;
 
         ret = -EINVAL;
-        if ( (mfn + nr_mfns - 1) < mfn ) /* wrap? */
+        if ( (mfn + nr_mfns - 1) < mfn || /* wrap? */
+             ((mfn | (mfn + nr_mfns - 1)) >> (paddr_bits - PAGE_SHIFT)) ||
+             (gfn + nr_mfns - 1) < gfn ) /* wrap? */
             break;
 
         ret = -EPERM;
@@ -857,8 +859,25 @@ long arch_do_domctl(
                    d->domain_id, gfn, mfn, nr_mfns);
 
             ret = iomem_permit_access(d, mfn, mfn + nr_mfns - 1);
-            for ( i = 0; i < nr_mfns; i++ )
-                set_mmio_p2m_entry(d, gfn+i, _mfn(mfn+i));
+            if ( !ret && paging_mode_translate(d) )
+            {
+                for ( i = 0; !ret && i < nr_mfns; i++ )
+                    if ( !set_mmio_p2m_entry(d, gfn + i, _mfn(mfn + i)) )
+                        ret = -EIO;
+                if ( ret )
+                {
+                    printk(XENLOG_G_WARNING
+                           "memory_map:fail: dom%d gfn=%lx mfn=%lx\n",
+                           d->domain_id, gfn + i, mfn + i);
+                    while ( i-- )
+                        clear_mmio_p2m_entry(d, gfn + i);
+                    if ( iomem_deny_access(d, mfn, mfn + nr_mfns - 1) &&
+                         IS_PRIV(current->domain) )
+                        printk(XENLOG_ERR
+                               "memory_map: failed to deny dom%d access to [%lx,%lx]\n",
+                               d->domain_id, mfn, mfn + nr_mfns - 1);
+                }
+            }
         }
         else
         {
@@ -866,9 +885,17 @@ long arch_do_domctl(
                    "memory_map:remove: dom%d gfn=%lx mfn=%lx nr=%lx\n",
                    d->domain_id, gfn, mfn, nr_mfns);
 
-            for ( i = 0; i < nr_mfns; i++ )
-                clear_mmio_p2m_entry(d, gfn+i);
+            if ( paging_mode_translate(d) )
+                for ( i = 0; i < nr_mfns; i++ )
+                    add |= !clear_mmio_p2m_entry(d, gfn + i);
             ret = iomem_deny_access(d, mfn, mfn + nr_mfns - 1);
+            if ( !ret && add )
+                ret = -EIO;
+            if ( ret && IS_PRIV(current->domain) )
+                printk(XENLOG_ERR
+                       "memory_map: error %ld %s dom%d access to [%lx,%lx]\n",
+                       ret, add ? "removing" : "denying", d->domain_id,
+                       mfn, mfn + nr_mfns - 1);
         }
 
         rcu_unlock_domain(d);
@@ -930,12 +957,23 @@ long arch_do_domctl(
             if ( !found )
             {
                 g2m_ioport = xmalloc(struct g2m_ioport);
+                if ( !g2m_ioport )
+                    ret = -ENOMEM;
+            }
+            if ( !found && !ret )
+            {
                 g2m_ioport->gport = fgp;
                 g2m_ioport->mport = fmp;
                 g2m_ioport->np = np;
                 list_add_tail(&g2m_ioport->list, &hd->g2m_ioport_list);
             }
-            ret = ioports_permit_access(d, fmp, fmp + np - 1);
+            if ( !ret )
+                ret = ioports_permit_access(d, fmp, fmp + np - 1);
+            if ( ret && !found && g2m_ioport )
+            {
+                list_del(&g2m_ioport->list);
+                xfree(g2m_ioport);
+            }
         }
         else
         {
@@ -950,6 +988,10 @@ long arch_do_domctl(
                     break;
                 }
             ret = ioports_deny_access(d, fmp, fmp + np - 1);
+            if ( ret && IS_PRIV(current->domain) )
+                printk(XENLOG_ERR
+                       "ioport_map: error %ld denying dom%d access to [%x,%x]\n",
+                       ret, d->domain_id, fmp, fmp + np - 1);
         }
         rcu_unlock_domain(d);
     }

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

From xen-changelog-bounces@lists.xen.org Fri Oct 05 00:55:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Oct 2012 00: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 1TJwCE-00059J-Vn; Fri, 05 Oct 2012 00:55:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwCD-00058l-9j
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:17 +0000
Received: from [85.158.138.51:2997] by server-7.bemta-3.messagelabs.com id
	19/56-15765-4FF2E605; Fri, 05 Oct 2012 00:55:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-174.messagelabs.com!1349398513!25230356!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22860 invoked from network); 5 Oct 2012 00:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2012 00:55:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwC9-0002bI-1s
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwC8-0002EX-I2
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:12 +0000
Message-Id: <E1TJwC8-0002EX-I2@xenbits.xen.org>
Date: Fri, 05 Oct 2012 00:55:12 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86: tighten checks in
	XEN_DOMCTL_memory_mapping handler
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1349338271 -7200
# Node ID ffabc1ebd9131870e0dd66baa835ee49cfd4aaa9
# Parent  63823a6785fcc79ebc09ab847e282e8982fcdd82
x86: tighten checks in XEN_DOMCTL_memory_mapping handler

Properly checking the MFN implies knowing the physical address width
supported by the platform, so to obtain this consistently the
respective code gets moved out of the MTRR subdir.

Btw., the model specific workaround in that code is likely unnecessary
- I believe those CPU models don't support 64-bit mode. But I wasn't
able to formally verify this, so I preferred to retain that code for
now.

But domctl code here also was lacking other error checks (as was,
looking at it again from that angle) the XEN_DOMCTL_ioport_mapping one.
Besides adding the missing checks, printing is also added for the case
where revoking access permissions didn't work (as that may have
implications for the host operator, e.g. wanting to not pass through
affected devices to another guest until the one previously using them
did actually die).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25931:149805919569
xen-unstable date: Thu Sep 20 07:21:53 UTC 2012
---


diff -r 63823a6785fc -r ffabc1ebd913 xen/arch/x86/cpu/centaur.c
--- a/xen/arch/x86/cpu/centaur.c	Thu Oct 04 10:10:23 2012 +0200
+++ b/xen/arch/x86/cpu/centaur.c	Thu Oct 04 10:11:11 2012 +0200
@@ -56,6 +56,9 @@ static void __init init_c3(struct cpuinf
 	if (c->x86_model >=6 && c->x86_model <9)
 		set_bit(X86_FEATURE_3DNOW, c->x86_capability);
 
+	if (cpuid_eax(0x80000000) < 0x80000008)
+		paddr_bits = 32;
+
 	get_model_name(c);
 	display_cacheinfo(c);
 }
diff -r 63823a6785fc -r ffabc1ebd913 xen/arch/x86/cpu/common.c
--- a/xen/arch/x86/cpu/common.c	Thu Oct 04 10:10:23 2012 +0200
+++ b/xen/arch/x86/cpu/common.c	Thu Oct 04 10:11:11 2012 +0200
@@ -36,6 +36,8 @@ integer_param("cpuid_mask_ext_edx", opt_
 
 struct cpu_dev * cpu_devs[X86_VENDOR_NUM] = {};
 
+unsigned int paddr_bits __read_mostly = 36;
+
 /*
  * Default host IA32_CR_PAT value to cover all memory types.
  * BIOS usually sets it to 0x07040600070406.
@@ -265,6 +267,8 @@ static void __cpuinit generic_identify(s
 		}
 		if ( xlvl >= 0x80000004 )
 			get_model_name(c); /* Default name */
+		if ( xlvl >= 0x80000008 )
+			paddr_bits = cpuid_eax(0x80000008) & 0xff;
 	}
 
 	/* Intel-defined flags: level 0x00000007 */
diff -r 63823a6785fc -r ffabc1ebd913 xen/arch/x86/cpu/cyrix.c
--- a/xen/arch/x86/cpu/cyrix.c	Thu Oct 04 10:10:23 2012 +0200
+++ b/xen/arch/x86/cpu/cyrix.c	Thu Oct 04 10:11:11 2012 +0200
@@ -255,7 +255,9 @@ static void __init init_cyrix(struct cpu
 	}
 	safe_strcpy(c->x86_model_id, Cx86_model[dir0_msn & 7]);
 	if (p) safe_strcat(c->x86_model_id, p);
-	return;
+
+	if (cpu_has_cyrix_arr)
+		paddr_bits = 32;
 }
 
 /*
diff -r 63823a6785fc -r ffabc1ebd913 xen/arch/x86/cpu/intel.c
--- a/xen/arch/x86/cpu/intel.c	Thu Oct 04 10:10:23 2012 +0200
+++ b/xen/arch/x86/cpu/intel.c	Thu Oct 04 10:11:11 2012 +0200
@@ -144,6 +144,11 @@ void __devinit early_intel_workaround(st
 				       c->cpuid_level);
 		}
 	}
+
+	/* CPUID workaround for Intel 0F33/0F34 CPU */
+	if (boot_cpu_data.x86 == 0xF && boot_cpu_data.x86_model == 3 &&
+	    (boot_cpu_data.x86_mask == 3 || boot_cpu_data.x86_mask == 4))
+		paddr_bits = 36;
 }
 
 /*
diff -r 63823a6785fc -r ffabc1ebd913 xen/arch/x86/cpu/mtrr/main.c
--- a/xen/arch/x86/cpu/mtrr/main.c	Thu Oct 04 10:10:23 2012 +0200
+++ b/xen/arch/x86/cpu/mtrr/main.c	Thu Oct 04 10:11:11 2012 +0200
@@ -587,8 +587,6 @@ struct mtrr_value {
 	unsigned long	lsize;
 };
 
-unsigned int paddr_bits __read_mostly = 36;
-
 /**
  * mtrr_bp_init - initialize mtrrs on the boot CPU
  *
@@ -602,48 +600,12 @@ void __init mtrr_bp_init(void)
 
 	if (cpu_has_mtrr) {
 		mtrr_if = &generic_mtrr_ops;
-		size_or_mask = 0xff000000;	/* 36 bits */
-		size_and_mask = 0x00f00000;
-
-		/* This is an AMD specific MSR, but we assume(hope?) that
-		   Intel will implement it to when they extend the address
-		   bus of the Xeon. */
-		if (cpuid_eax(0x80000000) >= 0x80000008) {
-			paddr_bits = cpuid_eax(0x80000008) & 0xff;
-			/* CPUID workaround for Intel 0F33/0F34 CPU */
-			if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
-			    boot_cpu_data.x86 == 0xF &&
-			    boot_cpu_data.x86_model == 0x3 &&
-			    (boot_cpu_data.x86_mask == 0x3 ||
-			     boot_cpu_data.x86_mask == 0x4))
-				paddr_bits = 36;
-
-			size_or_mask = ~((1ULL << (paddr_bits - PAGE_SHIFT)) - 1);
-			size_and_mask = ~size_or_mask & 0xfffff00000ULL;
-		} else if (boot_cpu_data.x86_vendor == X86_VENDOR_CENTAUR &&
-			   boot_cpu_data.x86 == 6) {
-			/* VIA C* family have Intel style MTRRs, but
-			   don't support PAE */
-			size_or_mask = 0xfff00000;	/* 32 bits */
-			size_and_mask = 0;
-		}
 	} else {
 #ifndef CONFIG_X86_64
 		switch (boot_cpu_data.x86_vendor) {
-		case X86_VENDOR_AMD:
-			if (cpu_has_k6_mtrr) {
-				/* Pre-Athlon (K6) AMD CPU MTRRs */
-				mtrr_if = mtrr_ops[X86_VENDOR_AMD];
-				size_or_mask = 0xfff00000;	/* 32 bits */
-				size_and_mask = 0;
-			}
-			break;
 		case X86_VENDOR_CYRIX:
-			if (cpu_has_cyrix_arr) {
+			if (cpu_has_cyrix_arr)
 				mtrr_if = mtrr_ops[X86_VENDOR_CYRIX];
-				size_or_mask = 0xfff00000;	/* 32 bits */
-				size_and_mask = 0;
-			}
 			break;
 		default:
 			break;
@@ -652,6 +614,8 @@ void __init mtrr_bp_init(void)
 	}
 
 	if (mtrr_if) {
+		size_or_mask = ~((1ULL << (paddr_bits - PAGE_SHIFT)) - 1);
+		size_and_mask = ~size_or_mask & 0xfffff00000ULL;
 		set_num_var_ranges();
 		init_table();
 		if (use_intel())
diff -r 63823a6785fc -r ffabc1ebd913 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Thu Oct 04 10:10:23 2012 +0200
+++ b/xen/arch/x86/domctl.c	Thu Oct 04 10:11:11 2012 +0200
@@ -829,10 +829,12 @@ long arch_do_domctl(
         unsigned long mfn = domctl->u.memory_mapping.first_mfn;
         unsigned long nr_mfns = domctl->u.memory_mapping.nr_mfns;
         int add = domctl->u.memory_mapping.add_mapping;
-        int i;
+        unsigned long i;
 
         ret = -EINVAL;
-        if ( (mfn + nr_mfns - 1) < mfn ) /* wrap? */
+        if ( (mfn + nr_mfns - 1) < mfn || /* wrap? */
+             ((mfn | (mfn + nr_mfns - 1)) >> (paddr_bits - PAGE_SHIFT)) ||
+             (gfn + nr_mfns - 1) < gfn ) /* wrap? */
             break;
 
         ret = -EPERM;
@@ -857,8 +859,25 @@ long arch_do_domctl(
                    d->domain_id, gfn, mfn, nr_mfns);
 
             ret = iomem_permit_access(d, mfn, mfn + nr_mfns - 1);
-            for ( i = 0; i < nr_mfns; i++ )
-                set_mmio_p2m_entry(d, gfn+i, _mfn(mfn+i));
+            if ( !ret && paging_mode_translate(d) )
+            {
+                for ( i = 0; !ret && i < nr_mfns; i++ )
+                    if ( !set_mmio_p2m_entry(d, gfn + i, _mfn(mfn + i)) )
+                        ret = -EIO;
+                if ( ret )
+                {
+                    printk(XENLOG_G_WARNING
+                           "memory_map:fail: dom%d gfn=%lx mfn=%lx\n",
+                           d->domain_id, gfn + i, mfn + i);
+                    while ( i-- )
+                        clear_mmio_p2m_entry(d, gfn + i);
+                    if ( iomem_deny_access(d, mfn, mfn + nr_mfns - 1) &&
+                         IS_PRIV(current->domain) )
+                        printk(XENLOG_ERR
+                               "memory_map: failed to deny dom%d access to [%lx,%lx]\n",
+                               d->domain_id, mfn, mfn + nr_mfns - 1);
+                }
+            }
         }
         else
         {
@@ -866,9 +885,17 @@ long arch_do_domctl(
                    "memory_map:remove: dom%d gfn=%lx mfn=%lx nr=%lx\n",
                    d->domain_id, gfn, mfn, nr_mfns);
 
-            for ( i = 0; i < nr_mfns; i++ )
-                clear_mmio_p2m_entry(d, gfn+i);
+            if ( paging_mode_translate(d) )
+                for ( i = 0; i < nr_mfns; i++ )
+                    add |= !clear_mmio_p2m_entry(d, gfn + i);
             ret = iomem_deny_access(d, mfn, mfn + nr_mfns - 1);
+            if ( !ret && add )
+                ret = -EIO;
+            if ( ret && IS_PRIV(current->domain) )
+                printk(XENLOG_ERR
+                       "memory_map: error %ld %s dom%d access to [%lx,%lx]\n",
+                       ret, add ? "removing" : "denying", d->domain_id,
+                       mfn, mfn + nr_mfns - 1);
         }
 
         rcu_unlock_domain(d);
@@ -930,12 +957,23 @@ long arch_do_domctl(
             if ( !found )
             {
                 g2m_ioport = xmalloc(struct g2m_ioport);
+                if ( !g2m_ioport )
+                    ret = -ENOMEM;
+            }
+            if ( !found && !ret )
+            {
                 g2m_ioport->gport = fgp;
                 g2m_ioport->mport = fmp;
                 g2m_ioport->np = np;
                 list_add_tail(&g2m_ioport->list, &hd->g2m_ioport_list);
             }
-            ret = ioports_permit_access(d, fmp, fmp + np - 1);
+            if ( !ret )
+                ret = ioports_permit_access(d, fmp, fmp + np - 1);
+            if ( ret && !found && g2m_ioport )
+            {
+                list_del(&g2m_ioport->list);
+                xfree(g2m_ioport);
+            }
         }
         else
         {
@@ -950,6 +988,10 @@ long arch_do_domctl(
                     break;
                 }
             ret = ioports_deny_access(d, fmp, fmp + np - 1);
+            if ( ret && IS_PRIV(current->domain) )
+                printk(XENLOG_ERR
+                       "ioport_map: error %ld denying dom%d access to [%x,%x]\n",
+                       ret, d->domain_id, fmp, fmp + np - 1);
         }
         rcu_unlock_domain(d);
     }

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

From xen-changelog-bounces@lists.xen.org Fri Oct 05 00:55:33 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Oct 2012 00:55:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TJwCQ-0005Cb-Ee; Fri, 05 Oct 2012 00:55:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwCO-0005CB-Hf
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:28 +0000
Received: from [85.158.143.99:11949] by server-2.bemta-4.messagelabs.com id
	65/2F-06610-FFF2E605; Fri, 05 Oct 2012 00:55:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-216.messagelabs.com!1349398513!32912802!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22779 invoked from network); 5 Oct 2012 00:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2012 00:55:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwC8-0002bF-E1
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwC7-0002EI-RZ
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:11 +0000
Message-Id: <E1TJwC7-0002EI-RZ@xenbits.xen.org>
Date: Fri, 05 Oct 2012 00:55:11 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86: properly check
	XEN_DOMCTL_ioport_mapping arguments for invalid range
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1349338223 -7200
# Node ID 63823a6785fcc79ebc09ab847e282e8982fcdd82
# Parent  ca3e8190a72c23c228a752887434cb7ae0fc7332
x86: properly check XEN_DOMCTL_ioport_mapping arguments for invalid range

In particular, the case of "np" being a very large value wasn't handled
correctly. The range start checks also were off by one (except that in
practice, when "np" is properly range checked, this would still have
been caught by the range end checks).

Also, is a GFN wrap in XEN_DOMCTL_memory_mapping really okay?

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25927:3e3959413b2f
xen-unstable date: Wed Sep 19 07:27:55 UTC 2012
---


diff -r ca3e8190a72c -r 63823a6785fc xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Tue Oct 02 16:02:10 2012 +0100
+++ b/xen/arch/x86/domctl.c	Thu Oct 04 10:10:23 2012 +0200
@@ -888,7 +888,7 @@ long arch_do_domctl(
         int found = 0;
 
         ret = -EINVAL;
-        if ( (np == 0) || (fgp > MAX_IOPORTS) || (fmp > MAX_IOPORTS) ||
+        if ( ((fgp | fmp | (np - 1)) >= MAX_IOPORTS) ||
             ((fgp + np) > MAX_IOPORTS) || ((fmp + np) > MAX_IOPORTS) )
         {
             printk(XENLOG_G_ERR

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

From xen-changelog-bounces@lists.xen.org Fri Oct 05 00:55:33 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Oct 2012 00:55:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TJwCQ-0005Cb-Ee; Fri, 05 Oct 2012 00:55:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwCO-0005CB-Hf
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:28 +0000
Received: from [85.158.143.99:11949] by server-2.bemta-4.messagelabs.com id
	65/2F-06610-FFF2E605; Fri, 05 Oct 2012 00:55:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-216.messagelabs.com!1349398513!32912802!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22779 invoked from network); 5 Oct 2012 00:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2012 00:55:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwC8-0002bF-E1
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJwC7-0002EI-RZ
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 00:55:11 +0000
Message-Id: <E1TJwC7-0002EI-RZ@xenbits.xen.org>
Date: Fri, 05 Oct 2012 00:55:11 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86: properly check
	XEN_DOMCTL_ioport_mapping arguments for invalid range
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1349338223 -7200
# Node ID 63823a6785fcc79ebc09ab847e282e8982fcdd82
# Parent  ca3e8190a72c23c228a752887434cb7ae0fc7332
x86: properly check XEN_DOMCTL_ioport_mapping arguments for invalid range

In particular, the case of "np" being a very large value wasn't handled
correctly. The range start checks also were off by one (except that in
practice, when "np" is properly range checked, this would still have
been caught by the range end checks).

Also, is a GFN wrap in XEN_DOMCTL_memory_mapping really okay?

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 25927:3e3959413b2f
xen-unstable date: Wed Sep 19 07:27:55 UTC 2012
---


diff -r ca3e8190a72c -r 63823a6785fc xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Tue Oct 02 16:02:10 2012 +0100
+++ b/xen/arch/x86/domctl.c	Thu Oct 04 10:10:23 2012 +0200
@@ -888,7 +888,7 @@ long arch_do_domctl(
         int found = 0;
 
         ret = -EINVAL;
-        if ( (np == 0) || (fgp > MAX_IOPORTS) || (fmp > MAX_IOPORTS) ||
+        if ( ((fgp | fmp | (np - 1)) >= MAX_IOPORTS) ||
             ((fgp + np) > MAX_IOPORTS) || ((fmp + np) > MAX_IOPORTS) )
         {
             printk(XENLOG_G_ERR

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

From xen-changelog-bounces@lists.xen.org Fri Oct 05 02:55:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Oct 2012 02: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 1TJy4H-00030B-Sr; Fri, 05 Oct 2012 02:55:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJy4G-0002zw-Q5
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 02:55:13 +0000
Received: from [85.158.137.99:4800] by server-11.bemta-3.messagelabs.com id
	D6/49-21460-01C4E605; Fri, 05 Oct 2012 02:55:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-217.messagelabs.com!1349405710!15548828!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25080 invoked from network); 5 Oct 2012 02:55:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2012 02:55:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJy4D-0004Mp-OJ
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 02:55:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJy4D-0005O7-9g
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 02:55:09 +0000
Message-Id: <E1TJy4D-0005O7-9g@xenbits.xen.org>
Date: Fri, 05 Oct 2012 02:55:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/nested-svm: Update the paging
	mode on VMRUN and VMEXIT emulation.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1349356850 -3600
# Node ID a9c84069c2489e2c432a5068adc7cf8d51ae3366
# Parent  72d89cc43c72848be9bf49da9a87729ed8f48433
x86/nested-svm: Update the paging mode on VMRUN and VMEXIT emulation.

This allows Xen to walk the l1 hypervisor's shadow pagetable
correctly.  Not needed for hap-on-hap guests because they are handled
at lookup time.  Problem found with 64bit Win7 and 32bit XPMode where Win7
switches forth and back between long mode and PAE legacy pagetables.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
[Adjusted to update in all cases where the l1 vmm uses shadows]
Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 72d89cc43c72 -r a9c84069c248 xen/arch/x86/hvm/svm/nestedsvm.c
--- a/xen/arch/x86/hvm/svm/nestedsvm.c	Thu Oct 04 09:28:25 2012 +0200
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c	Thu Oct 04 14:20:50 2012 +0100
@@ -741,6 +741,10 @@ nsvm_vcpu_vmrun(struct vcpu *v, struct c
         return 1;
     }
 
+    /* If l1 guest uses shadow paging, update the paging mode. */
+    if (!nestedhvm_paging_mode_hap(v))
+        paging_update_paging_modes(v);
+
     nv->nv_vmswitch_in_progress = 0;
     return 0;
 }
@@ -1408,6 +1412,10 @@ nestedsvm_vcpu_vmexit(struct vcpu *v, st
      */
     rc = nhvm_vcpu_vmexit(v, regs, exitcode);
 
+    /* If l1 guest uses shadow paging, update the paging mode. */
+    if (!nestedhvm_paging_mode_hap(v))
+        paging_update_paging_modes(v);
+
     nv->nv_vmswitch_in_progress = 0;
 
     if (rc)

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

From xen-changelog-bounces@lists.xen.org Fri Oct 05 02:55:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Oct 2012 02: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 1TJy4H-00030B-Sr; Fri, 05 Oct 2012 02:55:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJy4G-0002zw-Q5
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 02:55:13 +0000
Received: from [85.158.137.99:4800] by server-11.bemta-3.messagelabs.com id
	D6/49-21460-01C4E605; Fri, 05 Oct 2012 02:55:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-217.messagelabs.com!1349405710!15548828!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25080 invoked from network); 5 Oct 2012 02:55:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2012 02:55:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJy4D-0004Mp-OJ
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 02:55:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJy4D-0005O7-9g
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 02:55:09 +0000
Message-Id: <E1TJy4D-0005O7-9g@xenbits.xen.org>
Date: Fri, 05 Oct 2012 02:55:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/nested-svm: Update the paging
	mode on VMRUN and VMEXIT emulation.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1349356850 -3600
# Node ID a9c84069c2489e2c432a5068adc7cf8d51ae3366
# Parent  72d89cc43c72848be9bf49da9a87729ed8f48433
x86/nested-svm: Update the paging mode on VMRUN and VMEXIT emulation.

This allows Xen to walk the l1 hypervisor's shadow pagetable
correctly.  Not needed for hap-on-hap guests because they are handled
at lookup time.  Problem found with 64bit Win7 and 32bit XPMode where Win7
switches forth and back between long mode and PAE legacy pagetables.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
[Adjusted to update in all cases where the l1 vmm uses shadows]
Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 72d89cc43c72 -r a9c84069c248 xen/arch/x86/hvm/svm/nestedsvm.c
--- a/xen/arch/x86/hvm/svm/nestedsvm.c	Thu Oct 04 09:28:25 2012 +0200
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c	Thu Oct 04 14:20:50 2012 +0100
@@ -741,6 +741,10 @@ nsvm_vcpu_vmrun(struct vcpu *v, struct c
         return 1;
     }
 
+    /* If l1 guest uses shadow paging, update the paging mode. */
+    if (!nestedhvm_paging_mode_hap(v))
+        paging_update_paging_modes(v);
+
     nv->nv_vmswitch_in_progress = 0;
     return 0;
 }
@@ -1408,6 +1412,10 @@ nestedsvm_vcpu_vmexit(struct vcpu *v, st
      */
     rc = nhvm_vcpu_vmexit(v, regs, exitcode);
 
+    /* If l1 guest uses shadow paging, update the paging mode. */
+    if (!nestedhvm_paging_mode_hap(v))
+        paging_update_paging_modes(v);
+
     nv->nv_vmswitch_in_progress = 0;
 
     if (rc)

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

From xen-changelog-bounces@lists.xen.org Fri Oct 05 02:55:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Oct 2012 02:55:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TJy4K-00030b-VU; Fri, 05 Oct 2012 02:55:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJy4K-00030P-4o
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 02:55:16 +0000
Received: from [85.158.143.35:29937] by server-3.bemta-4.messagelabs.com id
	81/47-10986-31C4E605; Fri, 05 Oct 2012 02:55:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-21.messagelabs.com!1349405710!10083800!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17329 invoked from network); 5 Oct 2012 02:55:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2012 02:55:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJy4E-0004Mv-Ho
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 02:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJy4D-0005OM-Vt
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 02:55:10 +0000
Message-Id: <E1TJy4D-0005OM-Vt@xenbits.xen.org>
Date: Fri, 05 Oct 2012 02:55:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] fix inclusion style in
	public/domctl.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

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1349363485 -7200
# Node ID 032de7030d2035efa4bb69dba9289fef89d134a1
# Parent  a9c84069c2489e2c432a5068adc7cf8d51ae3366
fix inclusion style in public/domctl.h

Public headers should include one another only via self-relative
include directives (violated by 25955:07d0d5b3a005).

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


diff -r a9c84069c248 -r 032de7030d20 xen/include/public/domctl.h
--- a/xen/include/public/domctl.h	Thu Oct 04 14:20:50 2012 +0100
+++ b/xen/include/public/domctl.h	Thu Oct 04 17:11:25 2012 +0200
@@ -32,9 +32,9 @@
 #error "domctl operations are intended for use by node control tools only"
 #endif
 
-#include <xen/hvm/save.h>
 #include "xen.h"
 #include "grant_table.h"
+#include "hvm/save.h"
 
 #define XEN_DOMCTL_INTERFACE_VERSION 0x00000008
 

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

From xen-changelog-bounces@lists.xen.org Fri Oct 05 02:55:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Oct 2012 02:55:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TJy4K-00030b-VU; Fri, 05 Oct 2012 02:55:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJy4K-00030P-4o
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 02:55:16 +0000
Received: from [85.158.143.35:29937] by server-3.bemta-4.messagelabs.com id
	81/47-10986-31C4E605; Fri, 05 Oct 2012 02:55:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-21.messagelabs.com!1349405710!10083800!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17329 invoked from network); 5 Oct 2012 02:55:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2012 02:55:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJy4E-0004Mv-Ho
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 02:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TJy4D-0005OM-Vt
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 02:55:10 +0000
Message-Id: <E1TJy4D-0005OM-Vt@xenbits.xen.org>
Date: Fri, 05 Oct 2012 02:55:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] fix inclusion style in
	public/domctl.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

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1349363485 -7200
# Node ID 032de7030d2035efa4bb69dba9289fef89d134a1
# Parent  a9c84069c2489e2c432a5068adc7cf8d51ae3366
fix inclusion style in public/domctl.h

Public headers should include one another only via self-relative
include directives (violated by 25955:07d0d5b3a005).

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


diff -r a9c84069c248 -r 032de7030d20 xen/include/public/domctl.h
--- a/xen/include/public/domctl.h	Thu Oct 04 14:20:50 2012 +0100
+++ b/xen/include/public/domctl.h	Thu Oct 04 17:11:25 2012 +0200
@@ -32,9 +32,9 @@
 #error "domctl operations are intended for use by node control tools only"
 #endif
 
-#include <xen/hvm/save.h>
 #include "xen.h"
 #include "grant_table.h"
+#include "hvm/save.h"
 
 #define XEN_DOMCTL_INTERFACE_VERSION 0x00000008
 

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

From xen-changelog-bounces@lists.xen.org Fri Oct 05 21:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Oct 2012 21:44:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TKFgu-0000W3-9E; Fri, 05 Oct 2012 21:44:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgs-0000V8-Dn
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:14 +0000
Received: from [85.158.143.35:9675] by server-1.bemta-4.messagelabs.com id
	19/55-05684-DA45F605; Fri, 05 Oct 2012 21:44:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-21.messagelabs.com!1349473450!12572184!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11084 invoked from network); 5 Oct 2012 21:44:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2012 21:44:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgn-0001CE-VC
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgn-0000ui-Nl
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:09 +0000
Message-Id: <E1TKFgn-0000ui-Nl@xenbits.xen.org>
Date: Fri, 05 Oct 2012 21:44:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: make devid a type so it is
	initialized properly
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Matthew Fioravante <matthew.fioravante@jhuapl.edu>
# Date 1349444067 -3600
# Node ID 8a073eb1e849d98fb920bc10eb9f926fc9358d6a
# Parent  513ee3b3cdf3dc3a14746ac957ed60e49f2e10cc
libxl: make devid a type so it is initialized properly

Previously device ids in libxl were treated as integers meaning they
were being initialized to 0, which is a valid device id. This patch
makes devid its own type in libxl and initializes it to -1, an invalid
value.

This fixes a bug where if you try to do a xl DEV-attach multiple
time it will continuously try to reattach device 0 instead of
generating a new device id.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 513ee3b3cdf3 -r 8a073eb1e849 tools/libxl/gentest.py
--- a/tools/libxl/gentest.py	Fri Oct 05 14:32:02 2012 +0200
+++ b/tools/libxl/gentest.py	Fri Oct 05 14:34:27 2012 +0100
@@ -60,7 +60,7 @@ def gen_rand_init(ty, v, indent = "    "
                                         passby=idl.PASS_BY_REFERENCE))
     elif ty.typename in ["libxl_uuid", "libxl_mac", "libxl_hwcap"]:
         s += "rand_bytes((uint8_t *)%s, sizeof(*%s));\n" % (v,v)
-    elif ty.typename in ["libxl_domid"] or isinstance(ty, idl.Number):
+    elif ty.typename in ["libxl_domid", "libxl_devid"] or isinstance(ty, idl.Number):
         s += "%s = rand() %% (sizeof(%s)*8);\n" % \
              (ty.pass_arg(v, parent is None),
               ty.pass_arg(v, parent is None))
diff -r 513ee3b3cdf3 -r 8a073eb1e849 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Fri Oct 05 14:32:02 2012 +0200
+++ b/tools/libxl/libxl.h	Fri Oct 05 14:34:27 2012 +0100
@@ -307,6 +307,7 @@ void libxl_cpuid_dispose(libxl_cpuid_pol
 #define LIBXL_PCI_FUNC_ALL (~0U)
 
 typedef uint32_t libxl_domid;
+typedef int libxl_devid;
 
 /*
  * Formatting Enumerations.
diff -r 513ee3b3cdf3 -r 8a073eb1e849 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Fri Oct 05 14:32:02 2012 +0200
+++ b/tools/libxl/libxl_types.idl	Fri Oct 05 14:34:27 2012 +0100
@@ -8,6 +8,7 @@ namespace("libxl_")
 libxl_defbool = Builtin("defbool", passby=PASS_BY_REFERENCE)
 
 libxl_domid = Builtin("domid", json_fn = "yajl_gen_integer", autogenerate_json = False)
+libxl_devid = Builtin("devid", json_fn = "yajl_gen_integer", autogenerate_json = False, signed = True, init_val="-1")
 libxl_uuid = Builtin("uuid", passby=PASS_BY_REFERENCE)
 libxl_mac = Builtin("mac", passby=PASS_BY_REFERENCE)
 libxl_bitmap = Builtin("bitmap", dispose_fn="libxl_bitmap_dispose", passby=PASS_BY_REFERENCE)
@@ -337,7 +338,7 @@ libxl_domain_build_info = Struct("domain
 
 libxl_device_vfb = Struct("device_vfb", [
     ("backend_domid", libxl_domid),
-    ("devid",         integer),
+    ("devid",         libxl_devid),
     ("vnc",           libxl_vnc_info),
     ("sdl",           libxl_sdl_info),
     # set keyboard layout, default is en-us keyboard
@@ -346,7 +347,7 @@ libxl_device_vfb = Struct("device_vfb", 
 
 libxl_device_vkb = Struct("device_vkb", [
     ("backend_domid", libxl_domid),
-    ("devid", integer),
+    ("devid", libxl_devid),
     ])
 
 libxl_device_disk = Struct("device_disk", [
@@ -363,7 +364,7 @@ libxl_device_disk = Struct("device_disk"
 
 libxl_device_nic = Struct("device_nic", [
     ("backend_domid", libxl_domid),
-    ("devid", integer),
+    ("devid", libxl_devid),
     ("mtu", integer),
     ("model", string),
     ("mac", libxl_mac),
@@ -393,7 +394,7 @@ libxl_diskinfo = Struct("diskinfo", [
     ("backend_id", uint32),
     ("frontend", string),
     ("frontend_id", uint32),
-    ("devid", integer),
+    ("devid", libxl_devid),
     ("state", integer),
     ("evtch", integer),
     ("rref", integer),
@@ -404,7 +405,7 @@ libxl_nicinfo = Struct("nicinfo", [
     ("backend_id", uint32),
     ("frontend", string),
     ("frontend_id", uint32),
-    ("devid", integer),
+    ("devid", libxl_devid),
     ("state", integer),
     ("evtch", integer),
     ("rref_tx", integer),
diff -r 513ee3b3cdf3 -r 8a073eb1e849 tools/ocaml/libs/xl/genwrap.py
--- a/tools/ocaml/libs/xl/genwrap.py	Fri Oct 05 14:32:02 2012 +0200
+++ b/tools/ocaml/libs/xl/genwrap.py	Fri Oct 05 14:34:27 2012 +0100
@@ -10,6 +10,7 @@ builtins = {
     "int":                  ("int",                    "%(c)s = Int_val(%(o)s)",            "Val_int(%(c)s)"  ),
     "char *":               ("string",                 "%(c)s = dup_String_val(gc, %(o)s)", "caml_copy_string(%(c)s)"),
     "libxl_domid":          ("domid",                  "%(c)s = Int_val(%(o)s)",            "Val_int(%(c)s)"  ),
+    "libxl_devid":          ("devid",                  "%(c)s = Int_val(%(o)s)",            "Val_int(%(c)s)"  ),
     "libxl_defbool":        ("bool option",            "%(c)s = Defbool_val(%(o)s)",        "Val_defbool(%(c)s)" ),
     "libxl_uuid":           ("int array",              "Uuid_val(gc, lg, &%(c)s, %(o)s)",   "Val_uuid(&%(c)s)"),
     "libxl_key_value_list": ("(string * string) list", None,                                None),
@@ -41,8 +42,8 @@ def stub_fn_name(ty, name):
     return "stub_xl_%s_%s" % (ty.rawname,name)
     
 def ocaml_type_of(ty):
-    if ty.rawname == "domid":
-        return "domid"
+    if ty.rawname in ["domid","devid"]:
+        return ty.rawname
     elif isinstance(ty,idl.UInt):
         if ty.width in [8, 16]:
             # handle as ints
diff -r 513ee3b3cdf3 -r 8a073eb1e849 tools/ocaml/libs/xl/xenlight.ml.in
--- a/tools/ocaml/libs/xl/xenlight.ml.in	Fri Oct 05 14:32:02 2012 +0200
+++ b/tools/ocaml/libs/xl/xenlight.ml.in	Fri Oct 05 14:34:27 2012 +0100
@@ -16,6 +16,7 @@
 exception Error of string
 
 type domid = int
+type devid = int
 
 (* @@LIBXL_TYPES@@ *)
 
diff -r 513ee3b3cdf3 -r 8a073eb1e849 tools/ocaml/libs/xl/xenlight.mli.in
--- a/tools/ocaml/libs/xl/xenlight.mli.in	Fri Oct 05 14:32:02 2012 +0200
+++ b/tools/ocaml/libs/xl/xenlight.mli.in	Fri Oct 05 14:34:27 2012 +0100
@@ -16,6 +16,7 @@
 exception Error of string
 
 type domid = int
+type devid = int
 
 (* @@LIBXL_TYPES@@ *)
 
diff -r 513ee3b3cdf3 -r 8a073eb1e849 tools/python/xen/lowlevel/xl/xl.c
--- a/tools/python/xen/lowlevel/xl/xl.c	Fri Oct 05 14:32:02 2012 +0200
+++ b/tools/python/xen/lowlevel/xl/xl.c	Fri Oct 05 14:34:27 2012 +0100
@@ -281,6 +281,11 @@ int attrib__libxl_domid_set(PyObject *v,
     return 0;
 }
 
+int attrib__libxl_devid_set(PyObject *v, libxl_devid *devid) {
+   *devid = PyInt_AsLong(v);
+   return 0;
+}
+
 int attrib__struct_in_addr_set(PyObject *v, struct in_addr *pptr)
 {
     PyErr_SetString(PyExc_NotImplementedError, "Setting in_addr");
@@ -342,6 +347,10 @@ PyObject *attrib__libxl_domid_get(libxl_
     return PyInt_FromLong(*domid);
 }
 
+PyObject *attrib__libxl_devid_get(libxl_devid *devid) {
+    return PyInt_FromLong(*devid);
+}
+
 PyObject *attrib__struct_in_addr_get(struct in_addr *pptr)
 {
     PyErr_SetString(PyExc_NotImplementedError, "Getting in_addr");

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

From xen-changelog-bounces@lists.xen.org Fri Oct 05 21:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Oct 2012 21:44:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TKFgt-0000Va-3R; Fri, 05 Oct 2012 21:44:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgr-0000V7-Qi
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:14 +0000
Received: from [85.158.137.99:7556] by server-13.bemta-3.messagelabs.com id
	D4/52-28885-DA45F605; Fri, 05 Oct 2012 21:44:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-217.messagelabs.com!1349473451!19259436!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.4 required=7.0 tests=INFO_TLD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26540 invoked from network); 5 Oct 2012 21:44:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2012 21:44:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgo-0001CH-Ie
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgo-0000uy-86
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:10 +0000
Message-Id: <E1TKFgo-0000uy-86@xenbits.xen.org>
Date: Fri, 05 Oct 2012 21:44:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl/qemu-xen: use cache=writeback
	for IDE and SCSI
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1349444068 -3600
# Node ID 0807d1f7773d9ea5825485d7069381d48192b434
# Parent  8a073eb1e849d98fb920bc10eb9f926fc9358d6a
libxl/qemu-xen: use cache=writeback for IDE and SCSI

Change caching mode from writethrough to writeback for upstream QEMU.

After a lengthy discussion, we came up with the conclusion that
WRITEBACK is OK for IDE.
See: http://marc.info/?l=xen-devel&m=133311527009773

Given that the same reasons apply to SCSI as well, change to writeback
for SCSI too.

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


diff -r 8a073eb1e849 -r 0807d1f7773d tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Fri Oct 05 14:34:27 2012 +0100
+++ b/tools/libxl/libxl_dm.c	Fri Oct 05 14:34:28 2012 +0100
@@ -549,10 +549,10 @@ static char ** libxl__build_device_model
             if (disks[i].is_cdrom) {
                 if (disks[i].format == LIBXL_DISK_FORMAT_EMPTY)
                     drive = libxl__sprintf
-                        (gc, "if=ide,index=%d,media=cdrom", disk);
+                        (gc, "if=ide,index=%d,media=cdrom,cache=writeback", disk);
                 else
                     drive = libxl__sprintf
-                        (gc, "file=%s,if=ide,index=%d,media=cdrom,format=%s",
+                        (gc, "file=%s,if=ide,index=%d,media=cdrom,format=%s,cache=writeback",
                          disks[i].pdev_path, disk, format);
             } else {
                 if (disks[i].format == LIBXL_DISK_FORMAT_EMPTY) {
@@ -575,11 +575,11 @@ static char ** libxl__build_device_model
                  */
                 if (strncmp(disks[i].vdev, "sd", 2) == 0)
                     drive = libxl__sprintf
-                        (gc, "file=%s,if=scsi,bus=0,unit=%d,format=%s",
+                        (gc, "file=%s,if=scsi,bus=0,unit=%d,format=%s,cache=writeback",
                          disks[i].pdev_path, disk, format);
                 else if (disk < 4)
                     drive = libxl__sprintf
-                        (gc, "file=%s,if=ide,index=%d,media=disk,format=%s",
+                        (gc, "file=%s,if=ide,index=%d,media=disk,format=%s,cache=writeback",
                          disks[i].pdev_path, disk, format);
                 else
                     continue; /* Do not emulate this disk */

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

From xen-changelog-bounces@lists.xen.org Fri Oct 05 21:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Oct 2012 21:44:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TKFgt-0000Va-3R; Fri, 05 Oct 2012 21:44:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgr-0000V7-Qi
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:14 +0000
Received: from [85.158.137.99:7556] by server-13.bemta-3.messagelabs.com id
	D4/52-28885-DA45F605; Fri, 05 Oct 2012 21:44:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-217.messagelabs.com!1349473451!19259436!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.4 required=7.0 tests=INFO_TLD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26540 invoked from network); 5 Oct 2012 21:44:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2012 21:44:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgo-0001CH-Ie
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgo-0000uy-86
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:10 +0000
Message-Id: <E1TKFgo-0000uy-86@xenbits.xen.org>
Date: Fri, 05 Oct 2012 21:44:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl/qemu-xen: use cache=writeback
	for IDE and SCSI
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1349444068 -3600
# Node ID 0807d1f7773d9ea5825485d7069381d48192b434
# Parent  8a073eb1e849d98fb920bc10eb9f926fc9358d6a
libxl/qemu-xen: use cache=writeback for IDE and SCSI

Change caching mode from writethrough to writeback for upstream QEMU.

After a lengthy discussion, we came up with the conclusion that
WRITEBACK is OK for IDE.
See: http://marc.info/?l=xen-devel&m=133311527009773

Given that the same reasons apply to SCSI as well, change to writeback
for SCSI too.

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


diff -r 8a073eb1e849 -r 0807d1f7773d tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Fri Oct 05 14:34:27 2012 +0100
+++ b/tools/libxl/libxl_dm.c	Fri Oct 05 14:34:28 2012 +0100
@@ -549,10 +549,10 @@ static char ** libxl__build_device_model
             if (disks[i].is_cdrom) {
                 if (disks[i].format == LIBXL_DISK_FORMAT_EMPTY)
                     drive = libxl__sprintf
-                        (gc, "if=ide,index=%d,media=cdrom", disk);
+                        (gc, "if=ide,index=%d,media=cdrom,cache=writeback", disk);
                 else
                     drive = libxl__sprintf
-                        (gc, "file=%s,if=ide,index=%d,media=cdrom,format=%s",
+                        (gc, "file=%s,if=ide,index=%d,media=cdrom,format=%s,cache=writeback",
                          disks[i].pdev_path, disk, format);
             } else {
                 if (disks[i].format == LIBXL_DISK_FORMAT_EMPTY) {
@@ -575,11 +575,11 @@ static char ** libxl__build_device_model
                  */
                 if (strncmp(disks[i].vdev, "sd", 2) == 0)
                     drive = libxl__sprintf
-                        (gc, "file=%s,if=scsi,bus=0,unit=%d,format=%s",
+                        (gc, "file=%s,if=scsi,bus=0,unit=%d,format=%s,cache=writeback",
                          disks[i].pdev_path, disk, format);
                 else if (disk < 4)
                     drive = libxl__sprintf
-                        (gc, "file=%s,if=ide,index=%d,media=disk,format=%s",
+                        (gc, "file=%s,if=ide,index=%d,media=disk,format=%s,cache=writeback",
                          disks[i].pdev_path, disk, format);
                 else
                     continue; /* Do not emulate this disk */

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

From xen-changelog-bounces@lists.xen.org Fri Oct 05 21:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Oct 2012 21:44:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TKFgu-0000W3-9E; Fri, 05 Oct 2012 21:44:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgs-0000V8-Dn
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:14 +0000
Received: from [85.158.143.35:9675] by server-1.bemta-4.messagelabs.com id
	19/55-05684-DA45F605; Fri, 05 Oct 2012 21:44:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-21.messagelabs.com!1349473450!12572184!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11084 invoked from network); 5 Oct 2012 21:44:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2012 21:44:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgn-0001CE-VC
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgn-0000ui-Nl
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:09 +0000
Message-Id: <E1TKFgn-0000ui-Nl@xenbits.xen.org>
Date: Fri, 05 Oct 2012 21:44:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: make devid a type so it is
	initialized properly
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Matthew Fioravante <matthew.fioravante@jhuapl.edu>
# Date 1349444067 -3600
# Node ID 8a073eb1e849d98fb920bc10eb9f926fc9358d6a
# Parent  513ee3b3cdf3dc3a14746ac957ed60e49f2e10cc
libxl: make devid a type so it is initialized properly

Previously device ids in libxl were treated as integers meaning they
were being initialized to 0, which is a valid device id. This patch
makes devid its own type in libxl and initializes it to -1, an invalid
value.

This fixes a bug where if you try to do a xl DEV-attach multiple
time it will continuously try to reattach device 0 instead of
generating a new device id.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 513ee3b3cdf3 -r 8a073eb1e849 tools/libxl/gentest.py
--- a/tools/libxl/gentest.py	Fri Oct 05 14:32:02 2012 +0200
+++ b/tools/libxl/gentest.py	Fri Oct 05 14:34:27 2012 +0100
@@ -60,7 +60,7 @@ def gen_rand_init(ty, v, indent = "    "
                                         passby=idl.PASS_BY_REFERENCE))
     elif ty.typename in ["libxl_uuid", "libxl_mac", "libxl_hwcap"]:
         s += "rand_bytes((uint8_t *)%s, sizeof(*%s));\n" % (v,v)
-    elif ty.typename in ["libxl_domid"] or isinstance(ty, idl.Number):
+    elif ty.typename in ["libxl_domid", "libxl_devid"] or isinstance(ty, idl.Number):
         s += "%s = rand() %% (sizeof(%s)*8);\n" % \
              (ty.pass_arg(v, parent is None),
               ty.pass_arg(v, parent is None))
diff -r 513ee3b3cdf3 -r 8a073eb1e849 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Fri Oct 05 14:32:02 2012 +0200
+++ b/tools/libxl/libxl.h	Fri Oct 05 14:34:27 2012 +0100
@@ -307,6 +307,7 @@ void libxl_cpuid_dispose(libxl_cpuid_pol
 #define LIBXL_PCI_FUNC_ALL (~0U)
 
 typedef uint32_t libxl_domid;
+typedef int libxl_devid;
 
 /*
  * Formatting Enumerations.
diff -r 513ee3b3cdf3 -r 8a073eb1e849 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Fri Oct 05 14:32:02 2012 +0200
+++ b/tools/libxl/libxl_types.idl	Fri Oct 05 14:34:27 2012 +0100
@@ -8,6 +8,7 @@ namespace("libxl_")
 libxl_defbool = Builtin("defbool", passby=PASS_BY_REFERENCE)
 
 libxl_domid = Builtin("domid", json_fn = "yajl_gen_integer", autogenerate_json = False)
+libxl_devid = Builtin("devid", json_fn = "yajl_gen_integer", autogenerate_json = False, signed = True, init_val="-1")
 libxl_uuid = Builtin("uuid", passby=PASS_BY_REFERENCE)
 libxl_mac = Builtin("mac", passby=PASS_BY_REFERENCE)
 libxl_bitmap = Builtin("bitmap", dispose_fn="libxl_bitmap_dispose", passby=PASS_BY_REFERENCE)
@@ -337,7 +338,7 @@ libxl_domain_build_info = Struct("domain
 
 libxl_device_vfb = Struct("device_vfb", [
     ("backend_domid", libxl_domid),
-    ("devid",         integer),
+    ("devid",         libxl_devid),
     ("vnc",           libxl_vnc_info),
     ("sdl",           libxl_sdl_info),
     # set keyboard layout, default is en-us keyboard
@@ -346,7 +347,7 @@ libxl_device_vfb = Struct("device_vfb", 
 
 libxl_device_vkb = Struct("device_vkb", [
     ("backend_domid", libxl_domid),
-    ("devid", integer),
+    ("devid", libxl_devid),
     ])
 
 libxl_device_disk = Struct("device_disk", [
@@ -363,7 +364,7 @@ libxl_device_disk = Struct("device_disk"
 
 libxl_device_nic = Struct("device_nic", [
     ("backend_domid", libxl_domid),
-    ("devid", integer),
+    ("devid", libxl_devid),
     ("mtu", integer),
     ("model", string),
     ("mac", libxl_mac),
@@ -393,7 +394,7 @@ libxl_diskinfo = Struct("diskinfo", [
     ("backend_id", uint32),
     ("frontend", string),
     ("frontend_id", uint32),
-    ("devid", integer),
+    ("devid", libxl_devid),
     ("state", integer),
     ("evtch", integer),
     ("rref", integer),
@@ -404,7 +405,7 @@ libxl_nicinfo = Struct("nicinfo", [
     ("backend_id", uint32),
     ("frontend", string),
     ("frontend_id", uint32),
-    ("devid", integer),
+    ("devid", libxl_devid),
     ("state", integer),
     ("evtch", integer),
     ("rref_tx", integer),
diff -r 513ee3b3cdf3 -r 8a073eb1e849 tools/ocaml/libs/xl/genwrap.py
--- a/tools/ocaml/libs/xl/genwrap.py	Fri Oct 05 14:32:02 2012 +0200
+++ b/tools/ocaml/libs/xl/genwrap.py	Fri Oct 05 14:34:27 2012 +0100
@@ -10,6 +10,7 @@ builtins = {
     "int":                  ("int",                    "%(c)s = Int_val(%(o)s)",            "Val_int(%(c)s)"  ),
     "char *":               ("string",                 "%(c)s = dup_String_val(gc, %(o)s)", "caml_copy_string(%(c)s)"),
     "libxl_domid":          ("domid",                  "%(c)s = Int_val(%(o)s)",            "Val_int(%(c)s)"  ),
+    "libxl_devid":          ("devid",                  "%(c)s = Int_val(%(o)s)",            "Val_int(%(c)s)"  ),
     "libxl_defbool":        ("bool option",            "%(c)s = Defbool_val(%(o)s)",        "Val_defbool(%(c)s)" ),
     "libxl_uuid":           ("int array",              "Uuid_val(gc, lg, &%(c)s, %(o)s)",   "Val_uuid(&%(c)s)"),
     "libxl_key_value_list": ("(string * string) list", None,                                None),
@@ -41,8 +42,8 @@ def stub_fn_name(ty, name):
     return "stub_xl_%s_%s" % (ty.rawname,name)
     
 def ocaml_type_of(ty):
-    if ty.rawname == "domid":
-        return "domid"
+    if ty.rawname in ["domid","devid"]:
+        return ty.rawname
     elif isinstance(ty,idl.UInt):
         if ty.width in [8, 16]:
             # handle as ints
diff -r 513ee3b3cdf3 -r 8a073eb1e849 tools/ocaml/libs/xl/xenlight.ml.in
--- a/tools/ocaml/libs/xl/xenlight.ml.in	Fri Oct 05 14:32:02 2012 +0200
+++ b/tools/ocaml/libs/xl/xenlight.ml.in	Fri Oct 05 14:34:27 2012 +0100
@@ -16,6 +16,7 @@
 exception Error of string
 
 type domid = int
+type devid = int
 
 (* @@LIBXL_TYPES@@ *)
 
diff -r 513ee3b3cdf3 -r 8a073eb1e849 tools/ocaml/libs/xl/xenlight.mli.in
--- a/tools/ocaml/libs/xl/xenlight.mli.in	Fri Oct 05 14:32:02 2012 +0200
+++ b/tools/ocaml/libs/xl/xenlight.mli.in	Fri Oct 05 14:34:27 2012 +0100
@@ -16,6 +16,7 @@
 exception Error of string
 
 type domid = int
+type devid = int
 
 (* @@LIBXL_TYPES@@ *)
 
diff -r 513ee3b3cdf3 -r 8a073eb1e849 tools/python/xen/lowlevel/xl/xl.c
--- a/tools/python/xen/lowlevel/xl/xl.c	Fri Oct 05 14:32:02 2012 +0200
+++ b/tools/python/xen/lowlevel/xl/xl.c	Fri Oct 05 14:34:27 2012 +0100
@@ -281,6 +281,11 @@ int attrib__libxl_domid_set(PyObject *v,
     return 0;
 }
 
+int attrib__libxl_devid_set(PyObject *v, libxl_devid *devid) {
+   *devid = PyInt_AsLong(v);
+   return 0;
+}
+
 int attrib__struct_in_addr_set(PyObject *v, struct in_addr *pptr)
 {
     PyErr_SetString(PyExc_NotImplementedError, "Setting in_addr");
@@ -342,6 +347,10 @@ PyObject *attrib__libxl_domid_get(libxl_
     return PyInt_FromLong(*domid);
 }
 
+PyObject *attrib__libxl_devid_get(libxl_devid *devid) {
+    return PyInt_FromLong(*devid);
+}
+
 PyObject *attrib__struct_in_addr_get(struct in_addr *pptr)
 {
     PyErr_SetString(PyExc_NotImplementedError, "Getting in_addr");

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

From xen-changelog-bounces@lists.xen.org Fri Oct 05 21:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Oct 2012 21:44:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TKFgt-0000Vg-5u; Fri, 05 Oct 2012 21:44:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgr-0000V8-VD
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:14 +0000
Received: from [85.158.143.99:12974] by server-1.bemta-4.messagelabs.com id
	88/55-05684-DA45F605; Fri, 05 Oct 2012 21:44:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1349473451!23443198!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16677 invoked from network); 5 Oct 2012 21:44:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2012 21:44:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgo-0001CK-Sj
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgo-0000vD-Ob
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:10 +0000
Message-Id: <E1TKFgo-0000vD-Ob@xenbits.xen.org>
Date: Fri, 05 Oct 2012 21:44:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Move gc_is_real to
	libxl_internal.h.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Anthony PERARD <anthony.perard@citrix.com>
# Date 1349444069 -3600
# Node ID 2513dc3a68f617c3246bbd3da3c9bd5920d5ca21
# Parent  0807d1f7773d9ea5825485d7069381d48192b434
libxl: Move gc_is_real to libxl_internal.h.

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


diff -r 0807d1f7773d -r 2513dc3a68f6 tools/libxl/libxl_internal.c
--- a/tools/libxl/libxl_internal.c	Fri Oct 05 14:34:28 2012 +0100
+++ b/tools/libxl/libxl_internal.c	Fri Oct 05 14:34:29 2012 +0100
@@ -30,16 +30,11 @@ void libxl__alloc_failed(libxl_ctx *ctx,
 #undef L
 }
 
-static int gc_is_real(const libxl__gc *gc)
-{
-    return gc->alloc_maxsize >= 0;
-}
-
 void libxl__ptr_add(libxl__gc *gc, void *ptr)
 {
     int i;
 
-    if (!gc_is_real(gc))
+    if (!libxl__gc_is_real(gc))
         return;
 
     if (!ptr)
@@ -71,7 +66,7 @@ void libxl__free_all(libxl__gc *gc)
     void *ptr;
     int i;
 
-    assert(gc_is_real(gc));
+    assert(libxl__gc_is_real(gc));
 
     for (i = 0; i < gc->alloc_maxsize; i++) {
         ptr = gc->alloc_ptrs[i];
@@ -111,7 +106,7 @@ void *libxl__realloc(libxl__gc *gc, void
 
     if (ptr == NULL) {
         libxl__ptr_add(gc, new_ptr);
-    } else if (new_ptr != ptr && gc_is_real(gc)) {
+    } else if (new_ptr != ptr && libxl__gc_is_real(gc)) {
         for (i = 0; i < gc->alloc_maxsize; i++) {
             if (gc->alloc_ptrs[i] == ptr) {
                 gc->alloc_ptrs[i] = new_ptr;
diff -r 0807d1f7773d -r 2513dc3a68f6 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Fri Oct 05 14:34:28 2012 +0100
+++ b/tools/libxl/libxl_internal.h	Fri Oct 05 14:34:29 2012 +0100
@@ -446,6 +446,11 @@ static inline libxl_ctx *libxl__gc_owner
     return gc->owner;
 }
 
+static inline int libxl__gc_is_real(const libxl__gc *gc)
+{
+    return gc->alloc_maxsize >= 0;
+}
+
 /*
  * Memory allocation tracking/helpers
  *

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

From xen-changelog-bounces@lists.xen.org Fri Oct 05 21:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Oct 2012 21:44:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TKFgt-0000Vg-5u; Fri, 05 Oct 2012 21:44:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgr-0000V8-VD
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:14 +0000
Received: from [85.158.143.99:12974] by server-1.bemta-4.messagelabs.com id
	88/55-05684-DA45F605; Fri, 05 Oct 2012 21:44:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1349473451!23443198!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16677 invoked from network); 5 Oct 2012 21:44:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2012 21:44:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgo-0001CK-Sj
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgo-0000vD-Ob
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:10 +0000
Message-Id: <E1TKFgo-0000vD-Ob@xenbits.xen.org>
Date: Fri, 05 Oct 2012 21:44:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Move gc_is_real to
	libxl_internal.h.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Anthony PERARD <anthony.perard@citrix.com>
# Date 1349444069 -3600
# Node ID 2513dc3a68f617c3246bbd3da3c9bd5920d5ca21
# Parent  0807d1f7773d9ea5825485d7069381d48192b434
libxl: Move gc_is_real to libxl_internal.h.

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


diff -r 0807d1f7773d -r 2513dc3a68f6 tools/libxl/libxl_internal.c
--- a/tools/libxl/libxl_internal.c	Fri Oct 05 14:34:28 2012 +0100
+++ b/tools/libxl/libxl_internal.c	Fri Oct 05 14:34:29 2012 +0100
@@ -30,16 +30,11 @@ void libxl__alloc_failed(libxl_ctx *ctx,
 #undef L
 }
 
-static int gc_is_real(const libxl__gc *gc)
-{
-    return gc->alloc_maxsize >= 0;
-}
-
 void libxl__ptr_add(libxl__gc *gc, void *ptr)
 {
     int i;
 
-    if (!gc_is_real(gc))
+    if (!libxl__gc_is_real(gc))
         return;
 
     if (!ptr)
@@ -71,7 +66,7 @@ void libxl__free_all(libxl__gc *gc)
     void *ptr;
     int i;
 
-    assert(gc_is_real(gc));
+    assert(libxl__gc_is_real(gc));
 
     for (i = 0; i < gc->alloc_maxsize; i++) {
         ptr = gc->alloc_ptrs[i];
@@ -111,7 +106,7 @@ void *libxl__realloc(libxl__gc *gc, void
 
     if (ptr == NULL) {
         libxl__ptr_add(gc, new_ptr);
-    } else if (new_ptr != ptr && gc_is_real(gc)) {
+    } else if (new_ptr != ptr && libxl__gc_is_real(gc)) {
         for (i = 0; i < gc->alloc_maxsize; i++) {
             if (gc->alloc_ptrs[i] == ptr) {
                 gc->alloc_ptrs[i] = new_ptr;
diff -r 0807d1f7773d -r 2513dc3a68f6 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Fri Oct 05 14:34:28 2012 +0100
+++ b/tools/libxl/libxl_internal.h	Fri Oct 05 14:34:29 2012 +0100
@@ -446,6 +446,11 @@ static inline libxl_ctx *libxl__gc_owner
     return gc->owner;
 }
 
+static inline int libxl__gc_is_real(const libxl__gc *gc)
+{
+    return gc->alloc_maxsize >= 0;
+}
+
 /*
  * Memory allocation tracking/helpers
  *

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

From xen-changelog-bounces@lists.xen.org Fri Oct 05 21:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Oct 2012 21:44:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TKFgu-0000WI-HC; Fri, 05 Oct 2012 21:44:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgt-0000VZ-IN
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:15 +0000
Received: from [85.158.137.99:59333] by server-15.bemta-3.messagelabs.com id
	2B/0C-11584-EA45F605; Fri, 05 Oct 2012 21:44:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-217.messagelabs.com!1349473451!15106642!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22300 invoked from network); 5 Oct 2012 21:44:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2012 21:44:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgp-0001CN-Em
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgp-0000vS-AZ
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:11 +0000
Message-Id: <E1TKFgp-0000vS-AZ@xenbits.xen.org>
Date: Fri, 05 Oct 2012 21:44:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Have flexarray using the GC
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Anthony PERARD <anthony.perard@citrix.com>
# Date 1349444070 -3600
# Node ID 5c6b72b62bd7d9082e0e54ebce89e0c4a532a6a1
# Parent  2513dc3a68f617c3246bbd3da3c9bd5920d5ca21
libxl: Have flexarray using the GC

This patch makes the flexarray function libxl__gc aware.

It also updates every function that use a flexarray to pass the gc and removes
every memory allocation check and free.

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


diff -r 2513dc3a68f6 -r 5c6b72b62bd7 tools/libxl/flexarray.c
--- a/tools/libxl/flexarray.c	Fri Oct 05 14:34:29 2012 +0100
+++ b/tools/libxl/flexarray.c	Fri Oct 05 14:34:30 2012 +0100
@@ -16,36 +16,43 @@
 #include "libxl_internal.h"
 #include <stdarg.h>
 
-flexarray_t *flexarray_make(int size, int autogrow)
+/*
+ * It is safe to store gc in the struct because:
+ * - If it an actual gc, then the flexarray should not be used after the gc
+ *   have been freed.
+ * - If it is a NOGC, then this point to a structure embedded in libxl_ctx,
+ *   therefore will survive across several libxl calls.
+ */
+
+flexarray_t *flexarray_make(libxl__gc *gc, int size, int autogrow)
 {
-    flexarray_t *array = malloc(sizeof(struct flexarray));
-    if (array) {
-        array->size = size;
-        array->autogrow = autogrow;
-        array->count = 0;
-        array->data = calloc(size, sizeof(void *));
-    }
+    flexarray_t *array;
+
+    GCNEW(array);
+    array->size = size;
+    array->autogrow = autogrow;
+    array->count = 0;
+    array->gc = gc;
+    GCNEW_ARRAY(array->data, size);
+
     return array;
 }
 
 void flexarray_free(flexarray_t *array)
 {
+    assert(!libxl__gc_is_real(array->gc));
     free(array->data);
     free(array);
 }
 
-int flexarray_grow(flexarray_t *array, int extents)
+void flexarray_grow(flexarray_t *array, int extents)
 {
-    void **data;
     int newsize;
+    libxl__gc *gc = array->gc;
 
     newsize = array->size + extents;
-    data = realloc(array->data, sizeof(void *) * newsize);
-    if (!data)
-        return 1;
+    GCREALLOC_ARRAY(array->data, newsize);
     array->size += extents;
-    array->data = data;
-    return 0;
 }
 
 int flexarray_set(flexarray_t *array, unsigned int idx, void *ptr)
@@ -55,8 +62,7 @@ int flexarray_set(flexarray_t *array, un
         if (!array->autogrow)
             return 1;
         newsize = (array->size * 2 < idx) ? idx + 1 : array->size * 2;
-        if (flexarray_grow(array, newsize - array->size))
-            return 2;
+        flexarray_grow(array, newsize - array->size);
     }
     if ( idx + 1 > array->count )
         array->count = idx + 1;
@@ -104,7 +110,8 @@ void **flexarray_contents(flexarray_t *a
 {
     void **data;
     data = array->data;
-    free(array);
+    if (!libxl__gc_is_real(array->gc))
+        free(array);
     return data;
 }
 
diff -r 2513dc3a68f6 -r 5c6b72b62bd7 tools/libxl/flexarray.h
--- a/tools/libxl/flexarray.h	Fri Oct 05 14:34:29 2012 +0100
+++ b/tools/libxl/flexarray.h	Fri Oct 05 14:34:30 2012 +0100
@@ -16,16 +16,19 @@
 #ifndef FLEXARRAY_H
 #define FLEXARRAY_H
 
+struct libxl__gc;
+
 typedef struct flexarray {
     int size;
     int autogrow;
     unsigned int count;
     void **data; /* array of pointer */
+    struct libxl__gc *gc;
 } flexarray_t;
 
-_hidden flexarray_t *flexarray_make(int size, int autogrow);
+_hidden flexarray_t *flexarray_make(struct libxl__gc *gc, int size, int autogrow);
 _hidden void flexarray_free(flexarray_t *array);
-_hidden int flexarray_grow(flexarray_t *array, int extents);
+_hidden void flexarray_grow(flexarray_t *array, int extents);
 _hidden int flexarray_set(flexarray_t *array, unsigned int index, void *ptr);
 _hidden int flexarray_append(flexarray_t *array, void *ptr);
 _hidden int flexarray_append_pair(flexarray_t *array, void *ptr1, void *ptr2);
diff -r 2513dc3a68f6 -r 5c6b72b62bd7 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Fri Oct 05 14:34:29 2012 +0100
+++ b/tools/libxl/libxl.c	Fri Oct 05 14:34:30 2012 +0100
@@ -1820,27 +1820,15 @@ static void device_disk_add(libxl__egc *
         rc = libxl__device_disk_setdefault(gc, disk);
         if (rc) goto out;
 
-        if (front)
-            flexarray_free(front);
-        front = flexarray_make(16, 1);
-        if (!front) {
-            rc = ERROR_NOMEM;
-            goto out;
-        }
-        if (back)
-            flexarray_free(back);
-        back = flexarray_make(16, 1);
-        if (!back) {
-            rc = ERROR_NOMEM;
-            goto out_free;
-        }
+        front = flexarray_make(gc, 16, 1);
+        back = flexarray_make(gc, 16, 1);
 
         GCNEW(device);
         rc = libxl__device_from_disk(gc, domid, disk, device);
         if (rc != 0) {
             LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Invalid or unsupported"
                    " virtual disk identifier %s", disk->vdev);
-            goto out_free;
+            goto out;
         }
 
         switch (disk->backend) {
@@ -1878,7 +1866,7 @@ static void device_disk_add(libxl__egc *
                     LOG(ERROR, "failed to get blktap devpath for %p\n",
                         disk->pdev_path);
                     rc = ERROR_FAIL;
-                    goto out_free;
+                    goto out;
                 }
                 flexarray_append(back, "tapdisk-params");
                 flexarray_append(back, libxl__sprintf(gc, "%s:%s",
@@ -1900,7 +1888,7 @@ static void device_disk_add(libxl__egc *
             default:
                 LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "unrecognized disk backend type: %d\n", disk->backend);
                 rc = ERROR_INVAL;
-                goto out_free;
+                goto out;
         }
 
         flexarray_append(back, "frontend-id");
@@ -1937,7 +1925,7 @@ static void device_disk_add(libxl__egc *
 
         rc = libxl__xs_transaction_commit(gc, &t);
         if (!rc) break;
-        if (rc < 0) goto out_free;
+        if (rc < 0) goto out;
     }
 
     aodev->dev = device;
@@ -1946,9 +1934,6 @@ static void device_disk_add(libxl__egc *
 
     rc = 0;
 
-out_free:
-    flexarray_free(back);
-    flexarray_free(front);
 out:
     libxl__xs_transaction_abort(gc, &t);
     aodev->rc = rc;
@@ -2204,7 +2189,7 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u
     if (rc) goto out;
     path = libxl__device_backend_path(gc, &device);
 
-    insert = flexarray_make(4, 1);
+    insert = flexarray_make(gc, 4, 1);
 
     flexarray_append_pair(insert, "type",
                           libxl__device_disk_string_of_backend(disk->backend));
@@ -2230,8 +2215,6 @@ out:
         libxl_device_disk_dispose(&disks[i]);
     free(disks);
 
-    if (insert) flexarray_free(insert);
-
     if (rc) return AO_ABORT(rc);
     return AO_INPROGRESS;
 }
@@ -2567,21 +2550,13 @@ void libxl__device_nic_add(libxl__egc *e
     rc = libxl__device_nic_setdefault(gc, nic, domid);
     if (rc) goto out;
 
-    front = flexarray_make(16, 1);
-    if (!front) {
-        rc = ERROR_NOMEM;
-        goto out;
-    }
-    back = flexarray_make(16, 1);
-    if (!back) {
-        rc = ERROR_NOMEM;
-        goto out_free;
-    }
+    front = flexarray_make(gc, 16, 1);
+    back = flexarray_make(gc, 16, 1);
 
     if (nic->devid == -1) {
         if (!(dompath = libxl__xs_get_dompath(gc, domid))) {
             rc = ERROR_FAIL;
-            goto out_free;
+            goto out;
         }
         if (!(l = libxl__xs_directory(gc, XBT_NULL,
                                      libxl__sprintf(gc, "%s/device/vif", dompath), &nb))) {
@@ -2593,7 +2568,7 @@ void libxl__device_nic_add(libxl__egc *e
 
     GCNEW(device);
     rc = libxl__device_from_nic(gc, domid, nic, device);
-    if ( rc != 0 ) goto out_free;
+    if ( rc != 0 ) goto out;
 
     flexarray_append(back, "frontend-id");
     flexarray_append(back, libxl__sprintf(gc, "%d", domid));
@@ -2652,9 +2627,6 @@ void libxl__device_nic_add(libxl__egc *e
     libxl__wait_device_connection(egc, aodev);
 
     rc = 0;
-out_free:
-    flexarray_free(back);
-    flexarray_free(front);
 out:
     aodev->rc = rc;
     if (rc) aodev->callback(egc, aodev);
@@ -2851,16 +2823,8 @@ int libxl__device_console_add(libxl__gc 
         goto out;
     }
 
-    front = flexarray_make(16, 1);
-    if (!front) {
-        rc = ERROR_NOMEM;
-        goto out;
-    }
-    back = flexarray_make(16, 1);
-    if (!back) {
-        rc = ERROR_NOMEM;
-        goto out_free;
-    }
+    front = flexarray_make(gc, 16, 1);
+    back = flexarray_make(gc, 16, 1);
 
     device.backend_devid = console->devid;
     device.backend_domid = console->backend_domid;
@@ -2908,9 +2872,6 @@ int libxl__device_console_add(libxl__gc 
                              libxl__xs_kvs_of_flexarray(gc, back, back->count),
                              libxl__xs_kvs_of_flexarray(gc, front, front->count));
     rc = 0;
-out_free:
-    flexarray_free(back);
-    flexarray_free(front);
 out:
     return rc;
 }
@@ -2964,19 +2925,11 @@ int libxl__device_vkb_add(libxl__gc *gc,
     rc = libxl__device_vkb_setdefault(gc, vkb);
     if (rc) goto out;
 
-    front = flexarray_make(16, 1);
-    if (!front) {
-        rc = ERROR_NOMEM;
-        goto out;
-    }
-    back = flexarray_make(16, 1);
-    if (!back) {
-        rc = ERROR_NOMEM;
-        goto out_free;
-    }
+    front = flexarray_make(gc, 16, 1);
+    back = flexarray_make(gc, 16, 1);
 
     rc = libxl__device_from_vkb(gc, domid, vkb, &device);
-    if (rc != 0) goto out_free;
+    if (rc != 0) goto out;
 
     flexarray_append(back, "frontend-id");
     flexarray_append(back, libxl__sprintf(gc, "%d", domid));
@@ -2996,9 +2949,6 @@ int libxl__device_vkb_add(libxl__gc *gc,
                              libxl__xs_kvs_of_flexarray(gc, back, back->count),
                              libxl__xs_kvs_of_flexarray(gc, front, front->count));
     rc = 0;
-out_free:
-    flexarray_free(back);
-    flexarray_free(front);
 out:
     return rc;
 }
@@ -3063,19 +3013,11 @@ int libxl__device_vfb_add(libxl__gc *gc,
     rc = libxl__device_vfb_setdefault(gc, vfb);
     if (rc) goto out;
 
-    front = flexarray_make(16, 1);
-    if (!front) {
-        rc = ERROR_NOMEM;
-        goto out;
-    }
-    back = flexarray_make(16, 1);
-    if (!back) {
-        rc = ERROR_NOMEM;
-        goto out_free;
-    }
+    front = flexarray_make(gc, 16, 1);
+    back = flexarray_make(gc, 16, 1);
 
     rc = libxl__device_from_vfb(gc, domid, vfb, &device);
-    if (rc != 0) goto out_free;
+    if (rc != 0) goto out;
 
     flexarray_append_pair(back, "frontend-id", libxl__sprintf(gc, "%d", domid));
     flexarray_append_pair(back, "online", "1");
@@ -3108,9 +3050,6 @@ int libxl__device_vfb_add(libxl__gc *gc,
                              libxl__xs_kvs_of_flexarray(gc, back, back->count),
                              libxl__xs_kvs_of_flexarray(gc, front, front->count));
     rc = 0;
-out_free:
-    flexarray_free(front);
-    flexarray_free(back);
 out:
     return rc;
 }
diff -r 2513dc3a68f6 -r 5c6b72b62bd7 tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Fri Oct 05 14:34:29 2012 +0100
+++ b/tools/libxl/libxl_dm.c	Fri Oct 05 14:34:30 2012 +0100
@@ -109,10 +109,7 @@ static char ** libxl__build_device_model
     const char *keymap = dm_keymap(guest_config);
     int i;
     flexarray_t *dm_args;
-    dm_args = flexarray_make(16, 1);
-
-    if (!dm_args)
-        return NULL;
+    dm_args = flexarray_make(gc, 16, 1);
 
     flexarray_vappend(dm_args, dm,
                       "-d", libxl__sprintf(gc, "%d", domid), NULL);
@@ -340,9 +337,7 @@ static char ** libxl__build_device_model
     int i;
     uint64_t ram_size;
 
-    dm_args = flexarray_make(16, 1);
-    if (!dm_args)
-        return NULL;
+    dm_args = flexarray_make(gc, 16, 1);
 
     flexarray_vappend(dm_args, dm,
                       "-xen-domid",
@@ -837,7 +832,7 @@ void libxl__spawn_stub_dm(libxl__egc *eg
                          "setting target domain %d -> %d",
                          dm_domid, guest_domid);
         ret = ERROR_FAIL;
-        goto out_free;
+        goto out;
     }
     xs_set_target(ctx->xsh, dm_domid, guest_domid);
 
@@ -861,11 +856,8 @@ retry_transaction:
     libxl__add_disks(egc, ao, dm_domid, dm_config, &sdss->multidev);
     libxl__multidev_prepared(egc, &sdss->multidev, 0);
 
-    free(args);
     return;
 
-out_free:
-    free(args);
 out:
     assert(ret);
     spawn_stubdom_pvqemu_cb(egc, &sdss->pvqemu, ret);
@@ -1165,7 +1157,6 @@ retry_transaction:
 out_close:
     close(null);
     close(logfile_w);
-    free(args);
 out:
     if (rc)
         device_model_spawn_outcome(egc, dmss, rc);
diff -r 2513dc3a68f6 -r 5c6b72b62bd7 tools/libxl/libxl_json.c
--- a/tools/libxl/libxl_json.c	Fri Oct 05 14:34:29 2012 +0100
+++ b/tools/libxl/libxl_json.c	Fri Oct 05 14:34:30 2012 +0100
@@ -220,13 +220,7 @@ static libxl__json_object *json_object_a
     obj->type = type;
 
     if (type == JSON_MAP || type == JSON_ARRAY) {
-        flexarray_t *array = flexarray_make(1, 1);
-        if (array == NULL) {
-            LIBXL__LOG_ERRNO(libxl__gc_owner(gc), LIBXL__LOG_ERROR,
-                             "Failed to allocate a flexarray");
-            free(obj);
-            return NULL;
-        }
+        flexarray_t *array = flexarray_make(NOGC, 1, 1);
         if (type == JSON_MAP)
             obj->u.map = array;
         else
diff -r 2513dc3a68f6 -r 5c6b72b62bd7 tools/libxl/libxl_pci.c
--- a/tools/libxl/libxl_pci.c	Fri Oct 05 14:34:29 2012 +0100
+++ b/tools/libxl/libxl_pci.c	Fri Oct 05 14:34:30 2012 +0100
@@ -73,12 +73,8 @@ int libxl__create_pci_backend(libxl__gc 
     libxl__device device;
     int ret = ERROR_NOMEM, i;
 
-    front = flexarray_make(16, 1);
-    if (!front)
-        goto out;
-    back = flexarray_make(16, 1);
-    if (!back)
-        goto out;
+    front = flexarray_make(gc, 16, 1);
+    back = flexarray_make(gc, 16, 1);
 
     ret = 0;
 
@@ -108,11 +104,6 @@ int libxl__create_pci_backend(libxl__gc 
                               libxl__xs_kvs_of_flexarray(gc, back, back->count),
                               libxl__xs_kvs_of_flexarray(gc, front, front->count));
 
-out:
-    if (back)
-        flexarray_free(back);
-    if (front)
-        flexarray_free(front);
     return 0;
 }
 
@@ -138,9 +129,7 @@ static int libxl__device_pci_add_xenstor
             return ERROR_FAIL;
     }
 
-    back = flexarray_make(16, 1);
-    if (!back)
-        return ERROR_NOMEM;
+    back = flexarray_make(gc, 16, 1);
 
     LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "Adding new pci device to xenstore");
     num = atoi(num_devs);
@@ -157,7 +146,6 @@ retry_transaction:
         if (errno == EAGAIN)
             goto retry_transaction;
 
-    flexarray_free(back);
     return 0;
 }
 
diff -r 2513dc3a68f6 -r 5c6b72b62bd7 tools/libxl/libxl_qmp.c
--- a/tools/libxl/libxl_qmp.c	Fri Oct 05 14:34:29 2012 +0100
+++ b/tools/libxl/libxl_qmp.c	Fri Oct 05 14:34:30 2012 +0100
@@ -763,7 +763,7 @@ int libxl__qmp_pci_add(libxl__gc *gc, in
     if (!hostaddr)
         return -1;
 
-    parameters = flexarray_make(6, 1);
+    parameters = flexarray_make(gc, 6, 1);
     flexarray_append_pair(parameters, "driver", "xen-pci-passthrough");
     flexarray_append_pair(parameters, "id",
                           libxl__sprintf(gc, PCI_PT_QDEV_ID,
@@ -777,8 +777,6 @@ int libxl__qmp_pci_add(libxl__gc *gc, in
                                              PCI_FUNC(pcidev->vdevfn)));
     }
     args = libxl__xs_kvs_of_flexarray(gc, parameters, parameters->count);
-    if (!args)
-        return -1;
 
     rc = qmp_synchronous_send(qmp, "device_add", &args,
                               NULL, NULL, qmp->timeout);
@@ -787,7 +785,6 @@ int libxl__qmp_pci_add(libxl__gc *gc, in
                                   pci_add_callback, pcidev, qmp->timeout);
     }
 
-    flexarray_free(parameters);
     libxl__qmp_close(qmp);
     return rc;
 }
@@ -803,16 +800,13 @@ static int qmp_device_del(libxl__gc *gc,
     if (!qmp)
         return ERROR_FAIL;
 
-    parameters = flexarray_make(2, 1);
+    parameters = flexarray_make(gc, 2, 1);
     flexarray_append_pair(parameters, "id", id);
     args = libxl__xs_kvs_of_flexarray(gc, parameters, parameters->count);
-    if (!args)
-        return ERROR_NOMEM;
 
     rc = qmp_synchronous_send(qmp, "device_del", &args,
                               NULL, NULL, qmp->timeout);
 
-    flexarray_free(parameters);
     libxl__qmp_close(qmp);
     return rc;
 }
@@ -838,24 +832,13 @@ int libxl__qmp_save(libxl__gc *gc, int d
     if (!qmp)
         return ERROR_FAIL;
 
-    parameters = flexarray_make(2, 1);
-    if (!parameters) {
-        rc = ERROR_NOMEM;
-        goto out;
-    }
+    parameters = flexarray_make(gc, 2, 1);
     flexarray_append_pair(parameters, "filename", (char *)filename);
     args = libxl__xs_kvs_of_flexarray(gc, parameters, parameters->count);
-    if (!args) {
-        rc = ERROR_NOMEM;
-        goto out2;
-    }
 
     rc = qmp_synchronous_send(qmp, "xen-save-devices-state", &args,
                               NULL, NULL, qmp->timeout);
 
-out2:
-    flexarray_free(parameters);
-out:
     libxl__qmp_close(qmp);
     return rc;
 }
@@ -867,19 +850,16 @@ static int qmp_change(libxl__gc *gc, lib
     libxl_key_value_list args = NULL;
     int rc = 0;
 
-    parameters = flexarray_make(6, 1);
+    parameters = flexarray_make(gc, 6, 1);
     flexarray_append_pair(parameters, "device", device);
     flexarray_append_pair(parameters, "target", target);
     if (arg)
         flexarray_append_pair(parameters, "arg", arg);
     args = libxl__xs_kvs_of_flexarray(gc, parameters, parameters->count);
-    if (!args)
-        return ERROR_NOMEM;
 
     rc = qmp_synchronous_send(qmp, "change", &args,
                               NULL, NULL, qmp->timeout);
 
-    flexarray_free(parameters);
     return rc;
 }
 

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

From xen-changelog-bounces@lists.xen.org Fri Oct 05 21:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Oct 2012 21:44:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TKFgu-0000WI-HC; Fri, 05 Oct 2012 21:44:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgt-0000VZ-IN
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:15 +0000
Received: from [85.158.137.99:59333] by server-15.bemta-3.messagelabs.com id
	2B/0C-11584-EA45F605; Fri, 05 Oct 2012 21:44:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-217.messagelabs.com!1349473451!15106642!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22300 invoked from network); 5 Oct 2012 21:44:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2012 21:44:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgp-0001CN-Em
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgp-0000vS-AZ
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:11 +0000
Message-Id: <E1TKFgp-0000vS-AZ@xenbits.xen.org>
Date: Fri, 05 Oct 2012 21:44:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Have flexarray using the GC
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Anthony PERARD <anthony.perard@citrix.com>
# Date 1349444070 -3600
# Node ID 5c6b72b62bd7d9082e0e54ebce89e0c4a532a6a1
# Parent  2513dc3a68f617c3246bbd3da3c9bd5920d5ca21
libxl: Have flexarray using the GC

This patch makes the flexarray function libxl__gc aware.

It also updates every function that use a flexarray to pass the gc and removes
every memory allocation check and free.

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


diff -r 2513dc3a68f6 -r 5c6b72b62bd7 tools/libxl/flexarray.c
--- a/tools/libxl/flexarray.c	Fri Oct 05 14:34:29 2012 +0100
+++ b/tools/libxl/flexarray.c	Fri Oct 05 14:34:30 2012 +0100
@@ -16,36 +16,43 @@
 #include "libxl_internal.h"
 #include <stdarg.h>
 
-flexarray_t *flexarray_make(int size, int autogrow)
+/*
+ * It is safe to store gc in the struct because:
+ * - If it an actual gc, then the flexarray should not be used after the gc
+ *   have been freed.
+ * - If it is a NOGC, then this point to a structure embedded in libxl_ctx,
+ *   therefore will survive across several libxl calls.
+ */
+
+flexarray_t *flexarray_make(libxl__gc *gc, int size, int autogrow)
 {
-    flexarray_t *array = malloc(sizeof(struct flexarray));
-    if (array) {
-        array->size = size;
-        array->autogrow = autogrow;
-        array->count = 0;
-        array->data = calloc(size, sizeof(void *));
-    }
+    flexarray_t *array;
+
+    GCNEW(array);
+    array->size = size;
+    array->autogrow = autogrow;
+    array->count = 0;
+    array->gc = gc;
+    GCNEW_ARRAY(array->data, size);
+
     return array;
 }
 
 void flexarray_free(flexarray_t *array)
 {
+    assert(!libxl__gc_is_real(array->gc));
     free(array->data);
     free(array);
 }
 
-int flexarray_grow(flexarray_t *array, int extents)
+void flexarray_grow(flexarray_t *array, int extents)
 {
-    void **data;
     int newsize;
+    libxl__gc *gc = array->gc;
 
     newsize = array->size + extents;
-    data = realloc(array->data, sizeof(void *) * newsize);
-    if (!data)
-        return 1;
+    GCREALLOC_ARRAY(array->data, newsize);
     array->size += extents;
-    array->data = data;
-    return 0;
 }
 
 int flexarray_set(flexarray_t *array, unsigned int idx, void *ptr)
@@ -55,8 +62,7 @@ int flexarray_set(flexarray_t *array, un
         if (!array->autogrow)
             return 1;
         newsize = (array->size * 2 < idx) ? idx + 1 : array->size * 2;
-        if (flexarray_grow(array, newsize - array->size))
-            return 2;
+        flexarray_grow(array, newsize - array->size);
     }
     if ( idx + 1 > array->count )
         array->count = idx + 1;
@@ -104,7 +110,8 @@ void **flexarray_contents(flexarray_t *a
 {
     void **data;
     data = array->data;
-    free(array);
+    if (!libxl__gc_is_real(array->gc))
+        free(array);
     return data;
 }
 
diff -r 2513dc3a68f6 -r 5c6b72b62bd7 tools/libxl/flexarray.h
--- a/tools/libxl/flexarray.h	Fri Oct 05 14:34:29 2012 +0100
+++ b/tools/libxl/flexarray.h	Fri Oct 05 14:34:30 2012 +0100
@@ -16,16 +16,19 @@
 #ifndef FLEXARRAY_H
 #define FLEXARRAY_H
 
+struct libxl__gc;
+
 typedef struct flexarray {
     int size;
     int autogrow;
     unsigned int count;
     void **data; /* array of pointer */
+    struct libxl__gc *gc;
 } flexarray_t;
 
-_hidden flexarray_t *flexarray_make(int size, int autogrow);
+_hidden flexarray_t *flexarray_make(struct libxl__gc *gc, int size, int autogrow);
 _hidden void flexarray_free(flexarray_t *array);
-_hidden int flexarray_grow(flexarray_t *array, int extents);
+_hidden void flexarray_grow(flexarray_t *array, int extents);
 _hidden int flexarray_set(flexarray_t *array, unsigned int index, void *ptr);
 _hidden int flexarray_append(flexarray_t *array, void *ptr);
 _hidden int flexarray_append_pair(flexarray_t *array, void *ptr1, void *ptr2);
diff -r 2513dc3a68f6 -r 5c6b72b62bd7 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Fri Oct 05 14:34:29 2012 +0100
+++ b/tools/libxl/libxl.c	Fri Oct 05 14:34:30 2012 +0100
@@ -1820,27 +1820,15 @@ static void device_disk_add(libxl__egc *
         rc = libxl__device_disk_setdefault(gc, disk);
         if (rc) goto out;
 
-        if (front)
-            flexarray_free(front);
-        front = flexarray_make(16, 1);
-        if (!front) {
-            rc = ERROR_NOMEM;
-            goto out;
-        }
-        if (back)
-            flexarray_free(back);
-        back = flexarray_make(16, 1);
-        if (!back) {
-            rc = ERROR_NOMEM;
-            goto out_free;
-        }
+        front = flexarray_make(gc, 16, 1);
+        back = flexarray_make(gc, 16, 1);
 
         GCNEW(device);
         rc = libxl__device_from_disk(gc, domid, disk, device);
         if (rc != 0) {
             LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Invalid or unsupported"
                    " virtual disk identifier %s", disk->vdev);
-            goto out_free;
+            goto out;
         }
 
         switch (disk->backend) {
@@ -1878,7 +1866,7 @@ static void device_disk_add(libxl__egc *
                     LOG(ERROR, "failed to get blktap devpath for %p\n",
                         disk->pdev_path);
                     rc = ERROR_FAIL;
-                    goto out_free;
+                    goto out;
                 }
                 flexarray_append(back, "tapdisk-params");
                 flexarray_append(back, libxl__sprintf(gc, "%s:%s",
@@ -1900,7 +1888,7 @@ static void device_disk_add(libxl__egc *
             default:
                 LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "unrecognized disk backend type: %d\n", disk->backend);
                 rc = ERROR_INVAL;
-                goto out_free;
+                goto out;
         }
 
         flexarray_append(back, "frontend-id");
@@ -1937,7 +1925,7 @@ static void device_disk_add(libxl__egc *
 
         rc = libxl__xs_transaction_commit(gc, &t);
         if (!rc) break;
-        if (rc < 0) goto out_free;
+        if (rc < 0) goto out;
     }
 
     aodev->dev = device;
@@ -1946,9 +1934,6 @@ static void device_disk_add(libxl__egc *
 
     rc = 0;
 
-out_free:
-    flexarray_free(back);
-    flexarray_free(front);
 out:
     libxl__xs_transaction_abort(gc, &t);
     aodev->rc = rc;
@@ -2204,7 +2189,7 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u
     if (rc) goto out;
     path = libxl__device_backend_path(gc, &device);
 
-    insert = flexarray_make(4, 1);
+    insert = flexarray_make(gc, 4, 1);
 
     flexarray_append_pair(insert, "type",
                           libxl__device_disk_string_of_backend(disk->backend));
@@ -2230,8 +2215,6 @@ out:
         libxl_device_disk_dispose(&disks[i]);
     free(disks);
 
-    if (insert) flexarray_free(insert);
-
     if (rc) return AO_ABORT(rc);
     return AO_INPROGRESS;
 }
@@ -2567,21 +2550,13 @@ void libxl__device_nic_add(libxl__egc *e
     rc = libxl__device_nic_setdefault(gc, nic, domid);
     if (rc) goto out;
 
-    front = flexarray_make(16, 1);
-    if (!front) {
-        rc = ERROR_NOMEM;
-        goto out;
-    }
-    back = flexarray_make(16, 1);
-    if (!back) {
-        rc = ERROR_NOMEM;
-        goto out_free;
-    }
+    front = flexarray_make(gc, 16, 1);
+    back = flexarray_make(gc, 16, 1);
 
     if (nic->devid == -1) {
         if (!(dompath = libxl__xs_get_dompath(gc, domid))) {
             rc = ERROR_FAIL;
-            goto out_free;
+            goto out;
         }
         if (!(l = libxl__xs_directory(gc, XBT_NULL,
                                      libxl__sprintf(gc, "%s/device/vif", dompath), &nb))) {
@@ -2593,7 +2568,7 @@ void libxl__device_nic_add(libxl__egc *e
 
     GCNEW(device);
     rc = libxl__device_from_nic(gc, domid, nic, device);
-    if ( rc != 0 ) goto out_free;
+    if ( rc != 0 ) goto out;
 
     flexarray_append(back, "frontend-id");
     flexarray_append(back, libxl__sprintf(gc, "%d", domid));
@@ -2652,9 +2627,6 @@ void libxl__device_nic_add(libxl__egc *e
     libxl__wait_device_connection(egc, aodev);
 
     rc = 0;
-out_free:
-    flexarray_free(back);
-    flexarray_free(front);
 out:
     aodev->rc = rc;
     if (rc) aodev->callback(egc, aodev);
@@ -2851,16 +2823,8 @@ int libxl__device_console_add(libxl__gc 
         goto out;
     }
 
-    front = flexarray_make(16, 1);
-    if (!front) {
-        rc = ERROR_NOMEM;
-        goto out;
-    }
-    back = flexarray_make(16, 1);
-    if (!back) {
-        rc = ERROR_NOMEM;
-        goto out_free;
-    }
+    front = flexarray_make(gc, 16, 1);
+    back = flexarray_make(gc, 16, 1);
 
     device.backend_devid = console->devid;
     device.backend_domid = console->backend_domid;
@@ -2908,9 +2872,6 @@ int libxl__device_console_add(libxl__gc 
                              libxl__xs_kvs_of_flexarray(gc, back, back->count),
                              libxl__xs_kvs_of_flexarray(gc, front, front->count));
     rc = 0;
-out_free:
-    flexarray_free(back);
-    flexarray_free(front);
 out:
     return rc;
 }
@@ -2964,19 +2925,11 @@ int libxl__device_vkb_add(libxl__gc *gc,
     rc = libxl__device_vkb_setdefault(gc, vkb);
     if (rc) goto out;
 
-    front = flexarray_make(16, 1);
-    if (!front) {
-        rc = ERROR_NOMEM;
-        goto out;
-    }
-    back = flexarray_make(16, 1);
-    if (!back) {
-        rc = ERROR_NOMEM;
-        goto out_free;
-    }
+    front = flexarray_make(gc, 16, 1);
+    back = flexarray_make(gc, 16, 1);
 
     rc = libxl__device_from_vkb(gc, domid, vkb, &device);
-    if (rc != 0) goto out_free;
+    if (rc != 0) goto out;
 
     flexarray_append(back, "frontend-id");
     flexarray_append(back, libxl__sprintf(gc, "%d", domid));
@@ -2996,9 +2949,6 @@ int libxl__device_vkb_add(libxl__gc *gc,
                              libxl__xs_kvs_of_flexarray(gc, back, back->count),
                              libxl__xs_kvs_of_flexarray(gc, front, front->count));
     rc = 0;
-out_free:
-    flexarray_free(back);
-    flexarray_free(front);
 out:
     return rc;
 }
@@ -3063,19 +3013,11 @@ int libxl__device_vfb_add(libxl__gc *gc,
     rc = libxl__device_vfb_setdefault(gc, vfb);
     if (rc) goto out;
 
-    front = flexarray_make(16, 1);
-    if (!front) {
-        rc = ERROR_NOMEM;
-        goto out;
-    }
-    back = flexarray_make(16, 1);
-    if (!back) {
-        rc = ERROR_NOMEM;
-        goto out_free;
-    }
+    front = flexarray_make(gc, 16, 1);
+    back = flexarray_make(gc, 16, 1);
 
     rc = libxl__device_from_vfb(gc, domid, vfb, &device);
-    if (rc != 0) goto out_free;
+    if (rc != 0) goto out;
 
     flexarray_append_pair(back, "frontend-id", libxl__sprintf(gc, "%d", domid));
     flexarray_append_pair(back, "online", "1");
@@ -3108,9 +3050,6 @@ int libxl__device_vfb_add(libxl__gc *gc,
                              libxl__xs_kvs_of_flexarray(gc, back, back->count),
                              libxl__xs_kvs_of_flexarray(gc, front, front->count));
     rc = 0;
-out_free:
-    flexarray_free(front);
-    flexarray_free(back);
 out:
     return rc;
 }
diff -r 2513dc3a68f6 -r 5c6b72b62bd7 tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Fri Oct 05 14:34:29 2012 +0100
+++ b/tools/libxl/libxl_dm.c	Fri Oct 05 14:34:30 2012 +0100
@@ -109,10 +109,7 @@ static char ** libxl__build_device_model
     const char *keymap = dm_keymap(guest_config);
     int i;
     flexarray_t *dm_args;
-    dm_args = flexarray_make(16, 1);
-
-    if (!dm_args)
-        return NULL;
+    dm_args = flexarray_make(gc, 16, 1);
 
     flexarray_vappend(dm_args, dm,
                       "-d", libxl__sprintf(gc, "%d", domid), NULL);
@@ -340,9 +337,7 @@ static char ** libxl__build_device_model
     int i;
     uint64_t ram_size;
 
-    dm_args = flexarray_make(16, 1);
-    if (!dm_args)
-        return NULL;
+    dm_args = flexarray_make(gc, 16, 1);
 
     flexarray_vappend(dm_args, dm,
                       "-xen-domid",
@@ -837,7 +832,7 @@ void libxl__spawn_stub_dm(libxl__egc *eg
                          "setting target domain %d -> %d",
                          dm_domid, guest_domid);
         ret = ERROR_FAIL;
-        goto out_free;
+        goto out;
     }
     xs_set_target(ctx->xsh, dm_domid, guest_domid);
 
@@ -861,11 +856,8 @@ retry_transaction:
     libxl__add_disks(egc, ao, dm_domid, dm_config, &sdss->multidev);
     libxl__multidev_prepared(egc, &sdss->multidev, 0);
 
-    free(args);
     return;
 
-out_free:
-    free(args);
 out:
     assert(ret);
     spawn_stubdom_pvqemu_cb(egc, &sdss->pvqemu, ret);
@@ -1165,7 +1157,6 @@ retry_transaction:
 out_close:
     close(null);
     close(logfile_w);
-    free(args);
 out:
     if (rc)
         device_model_spawn_outcome(egc, dmss, rc);
diff -r 2513dc3a68f6 -r 5c6b72b62bd7 tools/libxl/libxl_json.c
--- a/tools/libxl/libxl_json.c	Fri Oct 05 14:34:29 2012 +0100
+++ b/tools/libxl/libxl_json.c	Fri Oct 05 14:34:30 2012 +0100
@@ -220,13 +220,7 @@ static libxl__json_object *json_object_a
     obj->type = type;
 
     if (type == JSON_MAP || type == JSON_ARRAY) {
-        flexarray_t *array = flexarray_make(1, 1);
-        if (array == NULL) {
-            LIBXL__LOG_ERRNO(libxl__gc_owner(gc), LIBXL__LOG_ERROR,
-                             "Failed to allocate a flexarray");
-            free(obj);
-            return NULL;
-        }
+        flexarray_t *array = flexarray_make(NOGC, 1, 1);
         if (type == JSON_MAP)
             obj->u.map = array;
         else
diff -r 2513dc3a68f6 -r 5c6b72b62bd7 tools/libxl/libxl_pci.c
--- a/tools/libxl/libxl_pci.c	Fri Oct 05 14:34:29 2012 +0100
+++ b/tools/libxl/libxl_pci.c	Fri Oct 05 14:34:30 2012 +0100
@@ -73,12 +73,8 @@ int libxl__create_pci_backend(libxl__gc 
     libxl__device device;
     int ret = ERROR_NOMEM, i;
 
-    front = flexarray_make(16, 1);
-    if (!front)
-        goto out;
-    back = flexarray_make(16, 1);
-    if (!back)
-        goto out;
+    front = flexarray_make(gc, 16, 1);
+    back = flexarray_make(gc, 16, 1);
 
     ret = 0;
 
@@ -108,11 +104,6 @@ int libxl__create_pci_backend(libxl__gc 
                               libxl__xs_kvs_of_flexarray(gc, back, back->count),
                               libxl__xs_kvs_of_flexarray(gc, front, front->count));
 
-out:
-    if (back)
-        flexarray_free(back);
-    if (front)
-        flexarray_free(front);
     return 0;
 }
 
@@ -138,9 +129,7 @@ static int libxl__device_pci_add_xenstor
             return ERROR_FAIL;
     }
 
-    back = flexarray_make(16, 1);
-    if (!back)
-        return ERROR_NOMEM;
+    back = flexarray_make(gc, 16, 1);
 
     LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "Adding new pci device to xenstore");
     num = atoi(num_devs);
@@ -157,7 +146,6 @@ retry_transaction:
         if (errno == EAGAIN)
             goto retry_transaction;
 
-    flexarray_free(back);
     return 0;
 }
 
diff -r 2513dc3a68f6 -r 5c6b72b62bd7 tools/libxl/libxl_qmp.c
--- a/tools/libxl/libxl_qmp.c	Fri Oct 05 14:34:29 2012 +0100
+++ b/tools/libxl/libxl_qmp.c	Fri Oct 05 14:34:30 2012 +0100
@@ -763,7 +763,7 @@ int libxl__qmp_pci_add(libxl__gc *gc, in
     if (!hostaddr)
         return -1;
 
-    parameters = flexarray_make(6, 1);
+    parameters = flexarray_make(gc, 6, 1);
     flexarray_append_pair(parameters, "driver", "xen-pci-passthrough");
     flexarray_append_pair(parameters, "id",
                           libxl__sprintf(gc, PCI_PT_QDEV_ID,
@@ -777,8 +777,6 @@ int libxl__qmp_pci_add(libxl__gc *gc, in
                                              PCI_FUNC(pcidev->vdevfn)));
     }
     args = libxl__xs_kvs_of_flexarray(gc, parameters, parameters->count);
-    if (!args)
-        return -1;
 
     rc = qmp_synchronous_send(qmp, "device_add", &args,
                               NULL, NULL, qmp->timeout);
@@ -787,7 +785,6 @@ int libxl__qmp_pci_add(libxl__gc *gc, in
                                   pci_add_callback, pcidev, qmp->timeout);
     }
 
-    flexarray_free(parameters);
     libxl__qmp_close(qmp);
     return rc;
 }
@@ -803,16 +800,13 @@ static int qmp_device_del(libxl__gc *gc,
     if (!qmp)
         return ERROR_FAIL;
 
-    parameters = flexarray_make(2, 1);
+    parameters = flexarray_make(gc, 2, 1);
     flexarray_append_pair(parameters, "id", id);
     args = libxl__xs_kvs_of_flexarray(gc, parameters, parameters->count);
-    if (!args)
-        return ERROR_NOMEM;
 
     rc = qmp_synchronous_send(qmp, "device_del", &args,
                               NULL, NULL, qmp->timeout);
 
-    flexarray_free(parameters);
     libxl__qmp_close(qmp);
     return rc;
 }
@@ -838,24 +832,13 @@ int libxl__qmp_save(libxl__gc *gc, int d
     if (!qmp)
         return ERROR_FAIL;
 
-    parameters = flexarray_make(2, 1);
-    if (!parameters) {
-        rc = ERROR_NOMEM;
-        goto out;
-    }
+    parameters = flexarray_make(gc, 2, 1);
     flexarray_append_pair(parameters, "filename", (char *)filename);
     args = libxl__xs_kvs_of_flexarray(gc, parameters, parameters->count);
-    if (!args) {
-        rc = ERROR_NOMEM;
-        goto out2;
-    }
 
     rc = qmp_synchronous_send(qmp, "xen-save-devices-state", &args,
                               NULL, NULL, qmp->timeout);
 
-out2:
-    flexarray_free(parameters);
-out:
     libxl__qmp_close(qmp);
     return rc;
 }
@@ -867,19 +850,16 @@ static int qmp_change(libxl__gc *gc, lib
     libxl_key_value_list args = NULL;
     int rc = 0;
 
-    parameters = flexarray_make(6, 1);
+    parameters = flexarray_make(gc, 6, 1);
     flexarray_append_pair(parameters, "device", device);
     flexarray_append_pair(parameters, "target", target);
     if (arg)
         flexarray_append_pair(parameters, "arg", arg);
     args = libxl__xs_kvs_of_flexarray(gc, parameters, parameters->count);
-    if (!args)
-        return ERROR_NOMEM;
 
     rc = qmp_synchronous_send(qmp, "change", &args,
                               NULL, NULL, qmp->timeout);
 
-    flexarray_free(parameters);
     return rc;
 }
 

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

From xen-changelog-bounces@lists.xen.org Fri Oct 05 21:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Oct 2012 21:44:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TKFgs-0000VF-0c; Fri, 05 Oct 2012 21:44:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgq-0000Uw-PH
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:12 +0000
Received: from [85.158.138.51:31744] by server-16.bemta-3.messagelabs.com id
	C4/CD-04167-BA45F605; Fri, 05 Oct 2012 21:44:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-174.messagelabs.com!1349473449!33366635!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11691 invoked from network); 5 Oct 2012 21:44:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2012 21:44:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgn-0001CB-9W
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgn-0000uT-4s
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:09 +0000
Message-Id: <E1TKFgn-0000uT-4s@xenbits.xen.org>
Date: Fri, 05 Oct 2012 21:44:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/MCE: implement recoverscan for
	AMD
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1349440322 -7200
# Node ID 513ee3b3cdf3dc3a14746ac957ed60e49f2e10cc
# Parent  993768a9e9c23c3df8da24c747def31469cd1eff
x86/MCE: implement recoverscan for AMD

Implement recoverable_scan() for AMD.

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


diff -r 993768a9e9c2 -r 513ee3b3cdf3 xen/arch/x86/cpu/mcheck/Makefile
--- a/xen/arch/x86/cpu/mcheck/Makefile	Fri Oct 05 14:30:21 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/Makefile	Fri Oct 05 14:32:02 2012 +0200
@@ -2,6 +2,7 @@ obj-y += amd_nonfatal.o
 obj-y += k7.o
 obj-y += amd_k8.o
 obj-y += amd_f10.o
+obj-y += mce_amd.o
 obj-y += barrier.o
 obj-y += mctelem.o
 obj-y += mce.o
diff -r 993768a9e9c2 -r 513ee3b3cdf3 xen/arch/x86/cpu/mcheck/amd_f10.c
--- a/xen/arch/x86/cpu/mcheck/amd_f10.c	Fri Oct 05 14:30:21 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/amd_f10.c	Fri Oct 05 14:32:02 2012 +0200
@@ -37,18 +37,13 @@
 
 #include <xen/init.h>
 #include <xen/types.h>
-#include <xen/kernel.h>
-#include <xen/config.h>
-#include <xen/smp.h>
 
-#include <asm/processor.h>
-#include <asm/system.h>
 #include <asm/msr.h>
 
 #include "mce.h"
 #include "mce_quirks.h"
 #include "x86_mca.h"
-
+#include "mce_amd.h"
 
 static struct mcinfo_extended *
 amd_f10_handler(struct mc_info *mi, uint16_t bank, uint64_t status)
@@ -101,6 +96,7 @@ enum mcheck_type amd_f10_mcheck_init(str
 		mcequirk_amd_apply(quirkflag);
 
 	x86_mce_callback_register(amd_f10_handler);
+	mce_recoverable_register(mc_amd_recoverable_scan);
 
 	return mcheck_amd_famXX;
 }
diff -r 993768a9e9c2 -r 513ee3b3cdf3 xen/arch/x86/cpu/mcheck/mce.h
--- a/xen/arch/x86/cpu/mcheck/mce.h	Fri Oct 05 14:30:21 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/mce.h	Fri Oct 05 14:32:02 2012 +0200
@@ -73,7 +73,7 @@ extern void mcheck_cmn_handler(struct cp
     struct mca_banks *, struct mca_banks *);
 
 /* Register a handler for judging whether mce is recoverable. */
-typedef int (*mce_recoverable_t)(u64 status);
+typedef int (*mce_recoverable_t)(uint64_t status);
 extern void mce_recoverable_register(mce_recoverable_t);
 
 /* Read an MSR, checking for an interposed value first */
diff -r 993768a9e9c2 -r 513ee3b3cdf3 xen/arch/x86/cpu/mcheck/mce_amd.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/x86/cpu/mcheck/mce_amd.c	Fri Oct 05 14:32:02 2012 +0200
@@ -0,0 +1,77 @@
+/*
+ * common MCA implementation for AMD CPUs.
+ * Copyright (c) 2012 Advanced Micro Devices, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <xen/init.h>
+#include <xen/types.h>
+
+#include <asm/msr.h>
+
+#include "mce.h"
+#include "x86_mca.h"
+#include "mce_amd.h"
+
+/* Error Code Types */
+enum mc_ec_type {
+    MC_EC_TLB_TYPE = 0x0010,
+    MC_EC_MEM_TYPE = 0x0100,
+    MC_EC_BUS_TYPE = 0x0800,
+};
+
+enum mc_ec_type
+mc_ec2type(uint16_t errorcode)
+{
+    if ( errorcode & MC_EC_BUS_TYPE )
+        return MC_EC_BUS_TYPE;
+    if ( errorcode & MC_EC_MEM_TYPE )
+        return MC_EC_MEM_TYPE;
+    if ( errorcode & MC_EC_TLB_TYPE )
+        return MC_EC_TLB_TYPE;
+    /* Unreached */
+    BUG();
+    return 0;
+}
+
+int
+mc_amd_recoverable_scan(uint64_t status)
+{
+    int ret = 0;
+    enum mc_ec_type ectype;
+    uint16_t errorcode;
+
+    if ( !(status & MCi_STATUS_UC) )
+        return 1;
+
+    errorcode = status & (MCi_STATUS_MCA | MCi_STATUS_MSEC);
+    ectype = mc_ec2type(errorcode);
+
+    switch ( ectype )
+    {
+    case MC_EC_BUS_TYPE: /* value in addr MSR is physical */
+        /* should run cpu offline action */
+        break;
+    case MC_EC_MEM_TYPE: /* value in addr MSR is physical */
+        ret = 1; /* run memory page offline action */
+        break;
+    case MC_EC_TLB_TYPE: /* value in addr MSR is virtual */
+        /* should run tlb flush action and retry */
+        break;
+    }
+
+    return ret;
+}
diff -r 993768a9e9c2 -r 513ee3b3cdf3 xen/arch/x86/cpu/mcheck/mce_amd.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/x86/cpu/mcheck/mce_amd.h	Fri Oct 05 14:32:02 2012 +0200
@@ -0,0 +1,6 @@
+#ifndef _MCHECK_AMD_H
+#define _MCHECK_AMD_H
+
+int mc_amd_recoverable_scan(uint64_t status);
+
+#endif
diff -r 993768a9e9c2 -r 513ee3b3cdf3 xen/arch/x86/cpu/mcheck/mce_intel.c
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c	Fri Oct 05 14:30:21 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c	Fri Oct 05 14:32:02 2012 +0200
@@ -560,7 +560,7 @@ static int intel_need_clearbank_scan(enu
  * 4) SRAO ser_support = 1, PCC = 0, S = 1, AR = 0, EN = 1 [UC = 1]
  * 5) UCNA ser_support = 1, OVER = 0, EN = 1, PCC = 0, S = 0, AR = 0, [UC = 1]
  */
-static int intel_recoverable_scan(u64 status)
+static int intel_recoverable_scan(uint64_t status)
 {
 
     if ( !(status & MCi_STATUS_UC ) )

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

From xen-changelog-bounces@lists.xen.org Fri Oct 05 21:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Oct 2012 21:44:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TKFgs-0000VF-0c; Fri, 05 Oct 2012 21:44:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgq-0000Uw-PH
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:12 +0000
Received: from [85.158.138.51:31744] by server-16.bemta-3.messagelabs.com id
	C4/CD-04167-BA45F605; Fri, 05 Oct 2012 21:44:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-174.messagelabs.com!1349473449!33366635!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11691 invoked from network); 5 Oct 2012 21:44:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2012 21:44:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgn-0001CB-9W
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgn-0000uT-4s
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:09 +0000
Message-Id: <E1TKFgn-0000uT-4s@xenbits.xen.org>
Date: Fri, 05 Oct 2012 21:44:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/MCE: implement recoverscan for
	AMD
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1349440322 -7200
# Node ID 513ee3b3cdf3dc3a14746ac957ed60e49f2e10cc
# Parent  993768a9e9c23c3df8da24c747def31469cd1eff
x86/MCE: implement recoverscan for AMD

Implement recoverable_scan() for AMD.

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


diff -r 993768a9e9c2 -r 513ee3b3cdf3 xen/arch/x86/cpu/mcheck/Makefile
--- a/xen/arch/x86/cpu/mcheck/Makefile	Fri Oct 05 14:30:21 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/Makefile	Fri Oct 05 14:32:02 2012 +0200
@@ -2,6 +2,7 @@ obj-y += amd_nonfatal.o
 obj-y += k7.o
 obj-y += amd_k8.o
 obj-y += amd_f10.o
+obj-y += mce_amd.o
 obj-y += barrier.o
 obj-y += mctelem.o
 obj-y += mce.o
diff -r 993768a9e9c2 -r 513ee3b3cdf3 xen/arch/x86/cpu/mcheck/amd_f10.c
--- a/xen/arch/x86/cpu/mcheck/amd_f10.c	Fri Oct 05 14:30:21 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/amd_f10.c	Fri Oct 05 14:32:02 2012 +0200
@@ -37,18 +37,13 @@
 
 #include <xen/init.h>
 #include <xen/types.h>
-#include <xen/kernel.h>
-#include <xen/config.h>
-#include <xen/smp.h>
 
-#include <asm/processor.h>
-#include <asm/system.h>
 #include <asm/msr.h>
 
 #include "mce.h"
 #include "mce_quirks.h"
 #include "x86_mca.h"
-
+#include "mce_amd.h"
 
 static struct mcinfo_extended *
 amd_f10_handler(struct mc_info *mi, uint16_t bank, uint64_t status)
@@ -101,6 +96,7 @@ enum mcheck_type amd_f10_mcheck_init(str
 		mcequirk_amd_apply(quirkflag);
 
 	x86_mce_callback_register(amd_f10_handler);
+	mce_recoverable_register(mc_amd_recoverable_scan);
 
 	return mcheck_amd_famXX;
 }
diff -r 993768a9e9c2 -r 513ee3b3cdf3 xen/arch/x86/cpu/mcheck/mce.h
--- a/xen/arch/x86/cpu/mcheck/mce.h	Fri Oct 05 14:30:21 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/mce.h	Fri Oct 05 14:32:02 2012 +0200
@@ -73,7 +73,7 @@ extern void mcheck_cmn_handler(struct cp
     struct mca_banks *, struct mca_banks *);
 
 /* Register a handler for judging whether mce is recoverable. */
-typedef int (*mce_recoverable_t)(u64 status);
+typedef int (*mce_recoverable_t)(uint64_t status);
 extern void mce_recoverable_register(mce_recoverable_t);
 
 /* Read an MSR, checking for an interposed value first */
diff -r 993768a9e9c2 -r 513ee3b3cdf3 xen/arch/x86/cpu/mcheck/mce_amd.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/x86/cpu/mcheck/mce_amd.c	Fri Oct 05 14:32:02 2012 +0200
@@ -0,0 +1,77 @@
+/*
+ * common MCA implementation for AMD CPUs.
+ * Copyright (c) 2012 Advanced Micro Devices, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <xen/init.h>
+#include <xen/types.h>
+
+#include <asm/msr.h>
+
+#include "mce.h"
+#include "x86_mca.h"
+#include "mce_amd.h"
+
+/* Error Code Types */
+enum mc_ec_type {
+    MC_EC_TLB_TYPE = 0x0010,
+    MC_EC_MEM_TYPE = 0x0100,
+    MC_EC_BUS_TYPE = 0x0800,
+};
+
+enum mc_ec_type
+mc_ec2type(uint16_t errorcode)
+{
+    if ( errorcode & MC_EC_BUS_TYPE )
+        return MC_EC_BUS_TYPE;
+    if ( errorcode & MC_EC_MEM_TYPE )
+        return MC_EC_MEM_TYPE;
+    if ( errorcode & MC_EC_TLB_TYPE )
+        return MC_EC_TLB_TYPE;
+    /* Unreached */
+    BUG();
+    return 0;
+}
+
+int
+mc_amd_recoverable_scan(uint64_t status)
+{
+    int ret = 0;
+    enum mc_ec_type ectype;
+    uint16_t errorcode;
+
+    if ( !(status & MCi_STATUS_UC) )
+        return 1;
+
+    errorcode = status & (MCi_STATUS_MCA | MCi_STATUS_MSEC);
+    ectype = mc_ec2type(errorcode);
+
+    switch ( ectype )
+    {
+    case MC_EC_BUS_TYPE: /* value in addr MSR is physical */
+        /* should run cpu offline action */
+        break;
+    case MC_EC_MEM_TYPE: /* value in addr MSR is physical */
+        ret = 1; /* run memory page offline action */
+        break;
+    case MC_EC_TLB_TYPE: /* value in addr MSR is virtual */
+        /* should run tlb flush action and retry */
+        break;
+    }
+
+    return ret;
+}
diff -r 993768a9e9c2 -r 513ee3b3cdf3 xen/arch/x86/cpu/mcheck/mce_amd.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/x86/cpu/mcheck/mce_amd.h	Fri Oct 05 14:32:02 2012 +0200
@@ -0,0 +1,6 @@
+#ifndef _MCHECK_AMD_H
+#define _MCHECK_AMD_H
+
+int mc_amd_recoverable_scan(uint64_t status);
+
+#endif
diff -r 993768a9e9c2 -r 513ee3b3cdf3 xen/arch/x86/cpu/mcheck/mce_intel.c
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c	Fri Oct 05 14:30:21 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c	Fri Oct 05 14:32:02 2012 +0200
@@ -560,7 +560,7 @@ static int intel_need_clearbank_scan(enu
  * 4) SRAO ser_support = 1, PCC = 0, S = 1, AR = 0, EN = 1 [UC = 1]
  * 5) UCNA ser_support = 1, OVER = 0, EN = 1, PCC = 0, S = 0, AR = 0, [UC = 1]
  */
-static int intel_recoverable_scan(u64 status)
+static int intel_recoverable_scan(uint64_t status)
 {
 
     if ( !(status & MCi_STATUS_UC ) )

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

From xen-changelog-bounces@lists.xen.org Fri Oct 05 21:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Oct 2012 21:44:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TKFgu-0000WD-Eb; Fri, 05 Oct 2012 21:44:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgt-0000VY-IV
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:15 +0000
Received: from [85.158.138.51:33779] by server-5.bemta-3.messagelabs.com id
	28/1F-00589-EA45F605; Fri, 05 Oct 2012 21:44:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-174.messagelabs.com!1349473452!32781603!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26673 invoked from network); 5 Oct 2012 21:44:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2012 21:44:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgp-0001CQ-VW
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgp-0000vh-RK
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:11 +0000
Message-Id: <E1TKFgp-0000vh-RK@xenbits.xen.org>
Date: Fri, 05 Oct 2012 21:44:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl_json: Use libxl alloc 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

# HG changeset patch
# User Anthony PERARD <anthony.perard@citrix.com>
# Date 1349444070 -3600
# Node ID 10277c76aed4c8ccff0fe9f0505a66361555fdb0
# Parent  5c6b72b62bd7d9082e0e54ebce89e0c4a532a6a1
libxl_json: Use libxl alloc function.

This patch makes use of the libxl allocation API and the GC and removes the
check for allocation failure.

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


diff -r 5c6b72b62bd7 -r 10277c76aed4 tools/libxl/libxl_json.c
--- a/tools/libxl/libxl_json.c	Fri Oct 05 14:34:30 2012 +0100
+++ b/tools/libxl/libxl_json.c	Fri Oct 05 14:34:30 2012 +0100
@@ -210,17 +210,12 @@ static libxl__json_object *json_object_a
 {
     libxl__json_object *obj;
 
-    obj = calloc(1, sizeof (libxl__json_object));
-    if (obj == NULL) {
-        LIBXL__LOG_ERRNO(libxl__gc_owner(gc), LIBXL__LOG_ERROR,
-                         "Failed to allocate a libxl__json_object");
-        return NULL;
-    }
+    obj = libxl__zalloc(gc, sizeof(*obj));
 
     obj->type = type;
 
     if (type == JSON_MAP || type == JSON_ARRAY) {
-        flexarray_t *array = flexarray_make(NOGC, 1, 1);
+        flexarray_t *array = flexarray_make(gc, 1, 1);
         if (type == JSON_MAP)
             obj->u.map = array;
         else
@@ -250,11 +245,7 @@ static int json_object_append_to(libxl__
         break;
     }
     case JSON_ARRAY:
-        if (flexarray_append(dst->u.array, obj) == 2) {
-            LIBXL__LOG_ERRNO(libxl__gc_owner(gc), LIBXL__LOG_ERROR,
-                             "Failed to grow a flexarray");
-            return -1;
-        }
+        flexarray_append(dst->u.array, obj);
         break;
     default:
         LIBXL__LOG(libxl__gc_owner(gc), LIBXL__LOG_ERROR,
@@ -387,11 +378,9 @@ static int json_callback_null(void *opaq
 
     DEBUG_GEN(ctx, null);
 
-    if ((obj = json_object_alloc(ctx->gc, JSON_NULL)) == NULL)
-        return 0;
+    obj = json_object_alloc(ctx->gc, JSON_NULL);
 
     if (json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
-        libxl__json_object_free(ctx->gc, obj);
         return 0;
     }
 
@@ -405,12 +394,10 @@ static int json_callback_boolean(void *o
 
     DEBUG_GEN_VALUE(ctx, bool, boolean);
 
-    if ((obj = json_object_alloc(ctx->gc,
-                                 boolean ? JSON_TRUE : JSON_FALSE)) == NULL)
-        return 0;
+    obj = json_object_alloc(ctx->gc,
+                            boolean ? JSON_TRUE : JSON_FALSE);
 
     if (json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
-        libxl__json_object_free(ctx->gc, obj);
         return 0;
     }
 
@@ -442,8 +429,7 @@ static int json_callback_number(void *op
             goto error;
         }
 
-        if ((obj = json_object_alloc(ctx->gc, JSON_DOUBLE)) == NULL)
-            return 0;
+        obj = json_object_alloc(ctx->gc, JSON_DOUBLE);
         obj->u.d = d;
     } else {
         long long i = strtoll(s, NULL, 10);
@@ -452,23 +438,16 @@ static int json_callback_number(void *op
             goto error;
         }
 
-        if ((obj = json_object_alloc(ctx->gc, JSON_INTEGER)) == NULL)
-            return 0;
+        obj = json_object_alloc(ctx->gc, JSON_INTEGER);
         obj->u.i = i;
     }
     goto out;
 
 error:
     /* If the conversion fail, we just store the original string. */
-    if ((obj = json_object_alloc(ctx->gc, JSON_NUMBER)) == NULL)
-        return 0;
+    obj = json_object_alloc(ctx->gc, JSON_NUMBER);
 
-    t = malloc(len + 1);
-    if (t == NULL) {
-        LIBXL__LOG_ERRNO(libxl__gc_owner(ctx->gc), LIBXL__LOG_ERROR,
-                         "Failed to allocate");
-        return 0;
-    }
+    t = libxl__zalloc(ctx->gc, len + 1);
     strncpy(t, s, len);
     t[len] = 0;
 
@@ -476,7 +455,6 @@ error:
 
 out:
     if (json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
-        libxl__json_object_free(ctx->gc, obj);
         return 0;
     }
 
@@ -490,26 +468,17 @@ static int json_callback_string(void *op
     char *t = NULL;
     libxl__json_object *obj = NULL;
 
-    t = malloc(len + 1);
-    if (t == NULL) {
-        LIBXL__LOG_ERRNO(libxl__gc_owner(ctx->gc), LIBXL__LOG_ERROR,
-                         "Failed to allocate");
-        return 0;
-    }
+    t = libxl__zalloc(ctx->gc, len + 1);
 
     DEBUG_GEN_STRING(ctx, str, len);
 
     strncpy(t, (const char *) str, len);
     t[len] = 0;
 
-    if ((obj = json_object_alloc(ctx->gc, JSON_STRING)) == NULL) {
-        free(t);
-        return 0;
-    }
+    obj = json_object_alloc(ctx->gc, JSON_STRING);
     obj->u.string = t;
 
     if (json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
-        libxl__json_object_free(ctx->gc, obj);
         return 0;
     }
 
@@ -522,13 +491,9 @@ static int json_callback_map_key(void *o
     libxl__yajl_ctx *ctx = opaque;
     char *t = NULL;
     libxl__json_object *obj = ctx->current;
+    libxl__gc *gc = ctx->gc;
 
-    t = malloc(len + 1);
-    if (t == NULL) {
-        LIBXL__LOG_ERRNO(libxl__gc_owner(ctx->gc), LIBXL__LOG_ERROR,
-                         "Failed to allocate");
-        return 0;
-    }
+    t = libxl__zalloc(gc, len + 1);
 
     DEBUG_GEN_STRING(ctx, str, len);
 
@@ -536,21 +501,13 @@ static int json_callback_map_key(void *o
     t[len] = 0;
 
     if (libxl__json_object_is_map(obj)) {
-        libxl__json_map_node *node = malloc(sizeof (libxl__json_map_node));
-        if (node == NULL) {
-            LIBXL__LOG_ERRNO(libxl__gc_owner(ctx->gc), LIBXL__LOG_ERROR,
-                             "Failed to allocate");
-            return 0;
-        }
+        libxl__json_map_node *node;
 
+        GCNEW(node);
         node->map_key = t;
         node->obj = NULL;
 
-        if (flexarray_append(obj->u.map, node) == 2) {
-            LIBXL__LOG_ERRNO(libxl__gc_owner(ctx->gc), LIBXL__LOG_ERROR,
-                             "Failed to grow a flexarray");
-            return 0;
-        }
+        flexarray_append(obj->u.map, node);
     } else {
         LIBXL__LOG(libxl__gc_owner(ctx->gc), LIBXL__LOG_ERROR,
                    "Current json object is not a map");
@@ -567,12 +524,10 @@ static int json_callback_start_map(void 
 
     DEBUG_GEN(ctx, map_open);
 
-    if ((obj = json_object_alloc(ctx->gc, JSON_MAP)) == NULL)
-        return 0;
+    obj = json_object_alloc(ctx->gc, JSON_MAP);
 
     if (ctx->current) {
         if (json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
-            libxl__json_object_free(ctx->gc, obj);
             return 0;
         }
     }
@@ -609,12 +564,10 @@ static int json_callback_start_array(voi
 
     DEBUG_GEN(ctx, array_open);
 
-    if ((obj = json_object_alloc(ctx->gc, JSON_ARRAY)) == NULL)
-        return 0;
+    obj = json_object_alloc(ctx->gc, JSON_ARRAY);
 
     if (ctx->current) {
         if (json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
-            libxl__json_object_free(ctx->gc, obj);
             return 0;
         }
     }
@@ -704,8 +657,6 @@ out:
 
     LIBXL__LOG(libxl__gc_owner(gc), LIBXL__LOG_ERROR, "yajl error: %s", str);
     yajl_free_error(yajl_ctx.hand, str);
-
-    libxl__json_object_free(gc, yajl_ctx.head);
     yajl_ctx_free(&yajl_ctx);
     return NULL;
 }
diff -r 5c6b72b62bd7 -r 10277c76aed4 tools/libxl/libxl_qmp.c
--- a/tools/libxl/libxl_qmp.c	Fri Oct 05 14:34:30 2012 +0100
+++ b/tools/libxl/libxl_qmp.c	Fri Oct 05 14:34:30 2012 +0100
@@ -484,7 +484,6 @@ static int qmp_next(libxl__gc *gc, libxl
 
                 if (o) {
                     rc = qmp_handle_response(qmp, o);
-                    libxl__json_object_free(gc, o);
                 } else {
                     LIBXL__LOG(qmp->ctx, LIBXL__LOG_ERROR,
                                "Parse error of : %s\n", s);

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

From xen-changelog-bounces@lists.xen.org Fri Oct 05 21:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Oct 2012 21:44:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TKFgu-0000WD-Eb; Fri, 05 Oct 2012 21:44:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgt-0000VY-IV
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:15 +0000
Received: from [85.158.138.51:33779] by server-5.bemta-3.messagelabs.com id
	28/1F-00589-EA45F605; Fri, 05 Oct 2012 21:44:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-174.messagelabs.com!1349473452!32781603!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26673 invoked from network); 5 Oct 2012 21:44:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2012 21:44:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgp-0001CQ-VW
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgp-0000vh-RK
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:11 +0000
Message-Id: <E1TKFgp-0000vh-RK@xenbits.xen.org>
Date: Fri, 05 Oct 2012 21:44:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl_json: Use libxl alloc 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

# HG changeset patch
# User Anthony PERARD <anthony.perard@citrix.com>
# Date 1349444070 -3600
# Node ID 10277c76aed4c8ccff0fe9f0505a66361555fdb0
# Parent  5c6b72b62bd7d9082e0e54ebce89e0c4a532a6a1
libxl_json: Use libxl alloc function.

This patch makes use of the libxl allocation API and the GC and removes the
check for allocation failure.

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


diff -r 5c6b72b62bd7 -r 10277c76aed4 tools/libxl/libxl_json.c
--- a/tools/libxl/libxl_json.c	Fri Oct 05 14:34:30 2012 +0100
+++ b/tools/libxl/libxl_json.c	Fri Oct 05 14:34:30 2012 +0100
@@ -210,17 +210,12 @@ static libxl__json_object *json_object_a
 {
     libxl__json_object *obj;
 
-    obj = calloc(1, sizeof (libxl__json_object));
-    if (obj == NULL) {
-        LIBXL__LOG_ERRNO(libxl__gc_owner(gc), LIBXL__LOG_ERROR,
-                         "Failed to allocate a libxl__json_object");
-        return NULL;
-    }
+    obj = libxl__zalloc(gc, sizeof(*obj));
 
     obj->type = type;
 
     if (type == JSON_MAP || type == JSON_ARRAY) {
-        flexarray_t *array = flexarray_make(NOGC, 1, 1);
+        flexarray_t *array = flexarray_make(gc, 1, 1);
         if (type == JSON_MAP)
             obj->u.map = array;
         else
@@ -250,11 +245,7 @@ static int json_object_append_to(libxl__
         break;
     }
     case JSON_ARRAY:
-        if (flexarray_append(dst->u.array, obj) == 2) {
-            LIBXL__LOG_ERRNO(libxl__gc_owner(gc), LIBXL__LOG_ERROR,
-                             "Failed to grow a flexarray");
-            return -1;
-        }
+        flexarray_append(dst->u.array, obj);
         break;
     default:
         LIBXL__LOG(libxl__gc_owner(gc), LIBXL__LOG_ERROR,
@@ -387,11 +378,9 @@ static int json_callback_null(void *opaq
 
     DEBUG_GEN(ctx, null);
 
-    if ((obj = json_object_alloc(ctx->gc, JSON_NULL)) == NULL)
-        return 0;
+    obj = json_object_alloc(ctx->gc, JSON_NULL);
 
     if (json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
-        libxl__json_object_free(ctx->gc, obj);
         return 0;
     }
 
@@ -405,12 +394,10 @@ static int json_callback_boolean(void *o
 
     DEBUG_GEN_VALUE(ctx, bool, boolean);
 
-    if ((obj = json_object_alloc(ctx->gc,
-                                 boolean ? JSON_TRUE : JSON_FALSE)) == NULL)
-        return 0;
+    obj = json_object_alloc(ctx->gc,
+                            boolean ? JSON_TRUE : JSON_FALSE);
 
     if (json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
-        libxl__json_object_free(ctx->gc, obj);
         return 0;
     }
 
@@ -442,8 +429,7 @@ static int json_callback_number(void *op
             goto error;
         }
 
-        if ((obj = json_object_alloc(ctx->gc, JSON_DOUBLE)) == NULL)
-            return 0;
+        obj = json_object_alloc(ctx->gc, JSON_DOUBLE);
         obj->u.d = d;
     } else {
         long long i = strtoll(s, NULL, 10);
@@ -452,23 +438,16 @@ static int json_callback_number(void *op
             goto error;
         }
 
-        if ((obj = json_object_alloc(ctx->gc, JSON_INTEGER)) == NULL)
-            return 0;
+        obj = json_object_alloc(ctx->gc, JSON_INTEGER);
         obj->u.i = i;
     }
     goto out;
 
 error:
     /* If the conversion fail, we just store the original string. */
-    if ((obj = json_object_alloc(ctx->gc, JSON_NUMBER)) == NULL)
-        return 0;
+    obj = json_object_alloc(ctx->gc, JSON_NUMBER);
 
-    t = malloc(len + 1);
-    if (t == NULL) {
-        LIBXL__LOG_ERRNO(libxl__gc_owner(ctx->gc), LIBXL__LOG_ERROR,
-                         "Failed to allocate");
-        return 0;
-    }
+    t = libxl__zalloc(ctx->gc, len + 1);
     strncpy(t, s, len);
     t[len] = 0;
 
@@ -476,7 +455,6 @@ error:
 
 out:
     if (json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
-        libxl__json_object_free(ctx->gc, obj);
         return 0;
     }
 
@@ -490,26 +468,17 @@ static int json_callback_string(void *op
     char *t = NULL;
     libxl__json_object *obj = NULL;
 
-    t = malloc(len + 1);
-    if (t == NULL) {
-        LIBXL__LOG_ERRNO(libxl__gc_owner(ctx->gc), LIBXL__LOG_ERROR,
-                         "Failed to allocate");
-        return 0;
-    }
+    t = libxl__zalloc(ctx->gc, len + 1);
 
     DEBUG_GEN_STRING(ctx, str, len);
 
     strncpy(t, (const char *) str, len);
     t[len] = 0;
 
-    if ((obj = json_object_alloc(ctx->gc, JSON_STRING)) == NULL) {
-        free(t);
-        return 0;
-    }
+    obj = json_object_alloc(ctx->gc, JSON_STRING);
     obj->u.string = t;
 
     if (json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
-        libxl__json_object_free(ctx->gc, obj);
         return 0;
     }
 
@@ -522,13 +491,9 @@ static int json_callback_map_key(void *o
     libxl__yajl_ctx *ctx = opaque;
     char *t = NULL;
     libxl__json_object *obj = ctx->current;
+    libxl__gc *gc = ctx->gc;
 
-    t = malloc(len + 1);
-    if (t == NULL) {
-        LIBXL__LOG_ERRNO(libxl__gc_owner(ctx->gc), LIBXL__LOG_ERROR,
-                         "Failed to allocate");
-        return 0;
-    }
+    t = libxl__zalloc(gc, len + 1);
 
     DEBUG_GEN_STRING(ctx, str, len);
 
@@ -536,21 +501,13 @@ static int json_callback_map_key(void *o
     t[len] = 0;
 
     if (libxl__json_object_is_map(obj)) {
-        libxl__json_map_node *node = malloc(sizeof (libxl__json_map_node));
-        if (node == NULL) {
-            LIBXL__LOG_ERRNO(libxl__gc_owner(ctx->gc), LIBXL__LOG_ERROR,
-                             "Failed to allocate");
-            return 0;
-        }
+        libxl__json_map_node *node;
 
+        GCNEW(node);
         node->map_key = t;
         node->obj = NULL;
 
-        if (flexarray_append(obj->u.map, node) == 2) {
-            LIBXL__LOG_ERRNO(libxl__gc_owner(ctx->gc), LIBXL__LOG_ERROR,
-                             "Failed to grow a flexarray");
-            return 0;
-        }
+        flexarray_append(obj->u.map, node);
     } else {
         LIBXL__LOG(libxl__gc_owner(ctx->gc), LIBXL__LOG_ERROR,
                    "Current json object is not a map");
@@ -567,12 +524,10 @@ static int json_callback_start_map(void 
 
     DEBUG_GEN(ctx, map_open);
 
-    if ((obj = json_object_alloc(ctx->gc, JSON_MAP)) == NULL)
-        return 0;
+    obj = json_object_alloc(ctx->gc, JSON_MAP);
 
     if (ctx->current) {
         if (json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
-            libxl__json_object_free(ctx->gc, obj);
             return 0;
         }
     }
@@ -609,12 +564,10 @@ static int json_callback_start_array(voi
 
     DEBUG_GEN(ctx, array_open);
 
-    if ((obj = json_object_alloc(ctx->gc, JSON_ARRAY)) == NULL)
-        return 0;
+    obj = json_object_alloc(ctx->gc, JSON_ARRAY);
 
     if (ctx->current) {
         if (json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
-            libxl__json_object_free(ctx->gc, obj);
             return 0;
         }
     }
@@ -704,8 +657,6 @@ out:
 
     LIBXL__LOG(libxl__gc_owner(gc), LIBXL__LOG_ERROR, "yajl error: %s", str);
     yajl_free_error(yajl_ctx.hand, str);
-
-    libxl__json_object_free(gc, yajl_ctx.head);
     yajl_ctx_free(&yajl_ctx);
     return NULL;
 }
diff -r 5c6b72b62bd7 -r 10277c76aed4 tools/libxl/libxl_qmp.c
--- a/tools/libxl/libxl_qmp.c	Fri Oct 05 14:34:30 2012 +0100
+++ b/tools/libxl/libxl_qmp.c	Fri Oct 05 14:34:30 2012 +0100
@@ -484,7 +484,6 @@ static int qmp_next(libxl__gc *gc, libxl
 
                 if (o) {
                     rc = qmp_handle_response(qmp, o);
-                    libxl__json_object_free(gc, o);
                 } else {
                     LIBXL__LOG(qmp->ctx, LIBXL__LOG_ERROR,
                                "Parse error of : %s\n", s);

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

From xen-changelog-bounces@lists.xen.org Fri Oct 05 21:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Oct 2012 21:44:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TKFgr-0000VA-UF; Fri, 05 Oct 2012 21:44:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgq-0000Ut-0c
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:12 +0000
Received: from [85.158.139.211:44767] by server-13.bemta-5.messagelabs.com id
	C0/11-06496-BA45F605; Fri, 05 Oct 2012 21:44:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-206.messagelabs.com!1349473449!21311062!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2567 invoked from network); 5 Oct 2012 21:44:10 -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;
	5 Oct 2012 21:44:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgm-0001C8-RS
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgm-0000uE-JS
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:08 +0000
Message-Id: <E1TKFgm-0000uE-JS@xenbits.xen.org>
Date: Fri, 05 Oct 2012 21:44:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: add sanity check and comments
	for vMCE injection
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Liu, Jinsong <jinsong.liu@intel.com>
# Date 1349440221 -7200
# Node ID 993768a9e9c23c3df8da24c747def31469cd1eff
# Parent  032de7030d2035efa4bb69dba9289fef89d134a1
x86: add sanity check and comments for vMCE injection

Add sanity check for input vcpu so that malicious value would not
return 0. Add comments since vcpu=-1 (broadcast) is some implicit to
code reader.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Suggested-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Christoph Egger <Christoph.Egger@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 032de7030d20 -r 993768a9e9c2 xen/arch/x86/cpu/mcheck/mce_intel.c
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c	Thu Oct 04 17:11:25 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c	Fri Oct 05 14:30:21 2012 +0200
@@ -360,7 +360,7 @@ static void intel_memerr_dhandler(
                 }
 
                 /* We will inject vMCE to DOMU*/
-                if ( inject_vmce(d, -1) < 0 )
+                if ( inject_vmce(d, VMCE_INJECT_BROADCAST) < 0 )
                 {
                     mce_printk(MCE_QUIET, "inject vMCE to DOM%d"
                       " failed\n", d->domain_id);
diff -r 032de7030d20 -r 993768a9e9c2 xen/arch/x86/cpu/mcheck/vmce.c
--- a/xen/arch/x86/cpu/mcheck/vmce.c	Thu Oct 04 17:11:25 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/vmce.c	Fri Oct 05 14:30:21 2012 +0200
@@ -341,14 +341,20 @@ HVM_REGISTER_SAVE_RESTORE(VMCE_VCPU, vmc
 /*
  * for Intel MCE, broadcast vMCE to all vcpus
  * for AMD MCE, only inject vMCE to vcpu0
+ *
+ * @ d, domain to which would inject vmce
+ * @ vcpu,
+ *   -1 (VMCE_INJECT_BROADCAST), broadcast vMCE to all vcpus
+ *   >= 0, vcpu, the vMCE is injected to
  */
 int inject_vmce(struct domain *d, int vcpu)
 {
     struct vcpu *v;
+    int ret = -ESRCH;
 
     for_each_vcpu ( d, v )
     {
-        if ( vcpu >= 0 && v->vcpu_id != vcpu )
+        if ( vcpu != VMCE_INJECT_BROADCAST && vcpu != v->vcpu_id )
             continue;
 
         if ( (is_hvm_domain(d) ||
@@ -358,19 +364,21 @@ int inject_vmce(struct domain *d, int vc
             mce_printk(MCE_VERBOSE, "MCE: inject vMCE to d%d:v%d\n",
                        d->domain_id, v->vcpu_id);
             vcpu_kick(v);
+            ret = 0;
         }
         else
         {
             mce_printk(MCE_QUIET, "Failed to inject vMCE to d%d:v%d\n",
                        d->domain_id, v->vcpu_id);
-            return -EBUSY;
+            ret = -EBUSY;
+            break;
         }
 
-        if ( vcpu >= 0 )
-            return 0;
+        if ( vcpu != VMCE_INJECT_BROADCAST )
+            break;
     }
 
-    return v ? -ESRCH : 0;
+    return ret;
 }
 
 int fill_vmsr_data(struct mcinfo_bank *mc_bank, struct domain *d,
diff -r 032de7030d20 -r 993768a9e9c2 xen/arch/x86/cpu/mcheck/vmce.h
--- a/xen/arch/x86/cpu/mcheck/vmce.h	Thu Oct 04 17:11:25 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/vmce.h	Fri Oct 05 14:30:21 2012 +0200
@@ -18,6 +18,8 @@ int vmce_amd_wrmsr(struct vcpu *, uint32
 
 int fill_vmsr_data(struct mcinfo_bank *mc_bank, struct domain *d,
     uint64_t gstatus);
+
+#define VMCE_INJECT_BROADCAST (-1)
 int inject_vmce(struct domain *d, int vcpu);
 
 #endif

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

From xen-changelog-bounces@lists.xen.org Fri Oct 05 21:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Oct 2012 21:44:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TKFgr-0000VA-UF; Fri, 05 Oct 2012 21:44:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgq-0000Ut-0c
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:12 +0000
Received: from [85.158.139.211:44767] by server-13.bemta-5.messagelabs.com id
	C0/11-06496-BA45F605; Fri, 05 Oct 2012 21:44:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-206.messagelabs.com!1349473449!21311062!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2567 invoked from network); 5 Oct 2012 21:44:10 -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;
	5 Oct 2012 21:44:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgm-0001C8-RS
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKFgm-0000uE-JS
	for xen-changelog@lists.xensource.com; Fri, 05 Oct 2012 21:44:08 +0000
Message-Id: <E1TKFgm-0000uE-JS@xenbits.xen.org>
Date: Fri, 05 Oct 2012 21:44:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: add sanity check and comments
	for vMCE injection
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Liu, Jinsong <jinsong.liu@intel.com>
# Date 1349440221 -7200
# Node ID 993768a9e9c23c3df8da24c747def31469cd1eff
# Parent  032de7030d2035efa4bb69dba9289fef89d134a1
x86: add sanity check and comments for vMCE injection

Add sanity check for input vcpu so that malicious value would not
return 0. Add comments since vcpu=-1 (broadcast) is some implicit to
code reader.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Suggested-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Christoph Egger <Christoph.Egger@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 032de7030d20 -r 993768a9e9c2 xen/arch/x86/cpu/mcheck/mce_intel.c
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c	Thu Oct 04 17:11:25 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c	Fri Oct 05 14:30:21 2012 +0200
@@ -360,7 +360,7 @@ static void intel_memerr_dhandler(
                 }
 
                 /* We will inject vMCE to DOMU*/
-                if ( inject_vmce(d, -1) < 0 )
+                if ( inject_vmce(d, VMCE_INJECT_BROADCAST) < 0 )
                 {
                     mce_printk(MCE_QUIET, "inject vMCE to DOM%d"
                       " failed\n", d->domain_id);
diff -r 032de7030d20 -r 993768a9e9c2 xen/arch/x86/cpu/mcheck/vmce.c
--- a/xen/arch/x86/cpu/mcheck/vmce.c	Thu Oct 04 17:11:25 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/vmce.c	Fri Oct 05 14:30:21 2012 +0200
@@ -341,14 +341,20 @@ HVM_REGISTER_SAVE_RESTORE(VMCE_VCPU, vmc
 /*
  * for Intel MCE, broadcast vMCE to all vcpus
  * for AMD MCE, only inject vMCE to vcpu0
+ *
+ * @ d, domain to which would inject vmce
+ * @ vcpu,
+ *   -1 (VMCE_INJECT_BROADCAST), broadcast vMCE to all vcpus
+ *   >= 0, vcpu, the vMCE is injected to
  */
 int inject_vmce(struct domain *d, int vcpu)
 {
     struct vcpu *v;
+    int ret = -ESRCH;
 
     for_each_vcpu ( d, v )
     {
-        if ( vcpu >= 0 && v->vcpu_id != vcpu )
+        if ( vcpu != VMCE_INJECT_BROADCAST && vcpu != v->vcpu_id )
             continue;
 
         if ( (is_hvm_domain(d) ||
@@ -358,19 +364,21 @@ int inject_vmce(struct domain *d, int vc
             mce_printk(MCE_VERBOSE, "MCE: inject vMCE to d%d:v%d\n",
                        d->domain_id, v->vcpu_id);
             vcpu_kick(v);
+            ret = 0;
         }
         else
         {
             mce_printk(MCE_QUIET, "Failed to inject vMCE to d%d:v%d\n",
                        d->domain_id, v->vcpu_id);
-            return -EBUSY;
+            ret = -EBUSY;
+            break;
         }
 
-        if ( vcpu >= 0 )
-            return 0;
+        if ( vcpu != VMCE_INJECT_BROADCAST )
+            break;
     }
 
-    return v ? -ESRCH : 0;
+    return ret;
 }
 
 int fill_vmsr_data(struct mcinfo_bank *mc_bank, struct domain *d,
diff -r 032de7030d20 -r 993768a9e9c2 xen/arch/x86/cpu/mcheck/vmce.h
--- a/xen/arch/x86/cpu/mcheck/vmce.h	Thu Oct 04 17:11:25 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/vmce.h	Fri Oct 05 14:30:21 2012 +0200
@@ -18,6 +18,8 @@ int vmce_amd_wrmsr(struct vcpu *, uint32
 
 int fill_vmsr_data(struct mcinfo_bank *mc_bank, struct domain *d,
     uint64_t gstatus);
+
+#define VMCE_INJECT_BROADCAST (-1)
 int inject_vmce(struct domain *d, int vcpu);
 
 #endif

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

From xen-changelog-bounces@lists.xen.org Sat Oct 06 01:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Oct 2012 01:33:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TKJGS-0006Mw-7r; Sat, 06 Oct 2012 01:33:12 +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 1TKJGQ-0006Mn-Vi
	for xen-changelog@lists.xensource.com; Sat, 06 Oct 2012 01:33:11 +0000
Received: from [85.158.139.211:59181] by server-13.bemta-5.messagelabs.com id
	06/62-06496-65A8F605; Sat, 06 Oct 2012 01:33:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-206.messagelabs.com!1349487188!21241344!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17208 invoked from network); 6 Oct 2012 01:33:09 -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;
	6 Oct 2012 01:33:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKJGO-0004AF-He
	for xen-changelog@lists.xensource.com; Sat, 06 Oct 2012 01:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKJGO-000773-Cw
	for xen-changelog@lists.xensource.com; Sat, 06 Oct 2012 01:33:08 +0000
Message-Id: <E1TKJGO-000773-Cw@xenbits.xen.org>
Date: Sat, 06 Oct 2012 01:33:07 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86/nested-svm: Update the paging
	mode on VMRUN and VMEXIT emulation.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1349434527 -7200
# Node ID 27db446078b50d576d8425d36daf52f886b710e6
# Parent  a69c8e5c4afcc5a116ec9d3953db425197dc028c
x86/nested-svm: Update the paging mode on VMRUN and VMEXIT emulation.

This allows Xen to walk the l1 hypervisor's shadow pagetable
correctly.  Not needed for hap-on-hap guests because they are handled
at lookup time.  Problem found with 64bit Win7 and 32bit XPMode where Win7
switches forth and back between long mode and PAE legacy pagetables.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
[Adjusted to update in all cases where the l1 vmm uses shadows]
Signed-off-by: Tim Deegan <tim@xen.org>
xen-unstable changeset: 25984:a9c84069c248
xen-unstable date: Thu Oct  4 13:20:50 UTC 2012
---


diff -r a69c8e5c4afc -r 27db446078b5 xen/arch/x86/hvm/svm/nestedsvm.c
--- a/xen/arch/x86/hvm/svm/nestedsvm.c	Thu Oct 04 10:16:20 2012 +0200
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c	Fri Oct 05 12:55:27 2012 +0200
@@ -741,6 +741,10 @@ nsvm_vcpu_vmrun(struct vcpu *v, struct c
         return 1;
     }
 
+    /* If l1 guest uses shadow paging, update the paging mode. */
+    if (!nestedhvm_paging_mode_hap(v))
+        paging_update_paging_modes(v);
+
     nv->nv_vmswitch_in_progress = 0;
     return 0;
 }
@@ -1408,6 +1412,10 @@ nestedsvm_vcpu_vmexit(struct vcpu *v, st
      */
     rc = nhvm_vcpu_vmexit(v, regs, exitcode);
 
+    /* If l1 guest uses shadow paging, update the paging mode. */
+    if (!nestedhvm_paging_mode_hap(v))
+        paging_update_paging_modes(v);
+
     nv->nv_vmswitch_in_progress = 0;
 
     if (rc)

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

From xen-changelog-bounces@lists.xen.org Sat Oct 06 01:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Oct 2012 01:33:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TKJGS-0006Mw-7r; Sat, 06 Oct 2012 01:33:12 +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 1TKJGQ-0006Mn-Vi
	for xen-changelog@lists.xensource.com; Sat, 06 Oct 2012 01:33:11 +0000
Received: from [85.158.139.211:59181] by server-13.bemta-5.messagelabs.com id
	06/62-06496-65A8F605; Sat, 06 Oct 2012 01:33:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-206.messagelabs.com!1349487188!21241344!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17208 invoked from network); 6 Oct 2012 01:33:09 -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;
	6 Oct 2012 01:33:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKJGO-0004AF-He
	for xen-changelog@lists.xensource.com; Sat, 06 Oct 2012 01:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKJGO-000773-Cw
	for xen-changelog@lists.xensource.com; Sat, 06 Oct 2012 01:33:08 +0000
Message-Id: <E1TKJGO-000773-Cw@xenbits.xen.org>
Date: Sat, 06 Oct 2012 01:33:07 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86/nested-svm: Update the paging
	mode on VMRUN and VMEXIT emulation.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1349434527 -7200
# Node ID 27db446078b50d576d8425d36daf52f886b710e6
# Parent  a69c8e5c4afcc5a116ec9d3953db425197dc028c
x86/nested-svm: Update the paging mode on VMRUN and VMEXIT emulation.

This allows Xen to walk the l1 hypervisor's shadow pagetable
correctly.  Not needed for hap-on-hap guests because they are handled
at lookup time.  Problem found with 64bit Win7 and 32bit XPMode where Win7
switches forth and back between long mode and PAE legacy pagetables.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
[Adjusted to update in all cases where the l1 vmm uses shadows]
Signed-off-by: Tim Deegan <tim@xen.org>
xen-unstable changeset: 25984:a9c84069c248
xen-unstable date: Thu Oct  4 13:20:50 UTC 2012
---


diff -r a69c8e5c4afc -r 27db446078b5 xen/arch/x86/hvm/svm/nestedsvm.c
--- a/xen/arch/x86/hvm/svm/nestedsvm.c	Thu Oct 04 10:16:20 2012 +0200
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c	Fri Oct 05 12:55:27 2012 +0200
@@ -741,6 +741,10 @@ nsvm_vcpu_vmrun(struct vcpu *v, struct c
         return 1;
     }
 
+    /* If l1 guest uses shadow paging, update the paging mode. */
+    if (!nestedhvm_paging_mode_hap(v))
+        paging_update_paging_modes(v);
+
     nv->nv_vmswitch_in_progress = 0;
     return 0;
 }
@@ -1408,6 +1412,10 @@ nestedsvm_vcpu_vmexit(struct vcpu *v, st
      */
     rc = nhvm_vcpu_vmexit(v, regs, exitcode);
 
+    /* If l1 guest uses shadow paging, update the paging mode. */
+    if (!nestedhvm_paging_mode_hap(v))
+        paging_update_paging_modes(v);
+
     nv->nv_vmswitch_in_progress = 0;
 
     if (rc)

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

From xen-changelog-bounces@lists.xen.org Sat Oct 06 03:33:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Oct 2012 03:33: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 1TKL8b-0007mi-0i; Sat, 06 Oct 2012 03:33:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKL8Z-0007mT-U5
	for xen-changelog@lists.xensource.com; Sat, 06 Oct 2012 03:33:12 +0000
Received: from [85.158.137.99:52400] by server-15.bemta-3.messagelabs.com id
	3F/C4-11584-676AF605; Sat, 06 Oct 2012 03:33:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-217.messagelabs.com!1349494389!19277431!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7054 invoked from network); 6 Oct 2012 03:33:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Oct 2012 03:33:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKL8W-0005ms-N2
	for xen-changelog@lists.xensource.com; Sat, 06 Oct 2012 03:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKL8W-0001bF-AE
	for xen-changelog@lists.xensource.com; Sat, 06 Oct 2012 03:33:08 +0000
Message-Id: <E1TKL8W-0001bF-AE@xenbits.xen.org>
Date: Sat, 06 Oct 2012 03:33:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl/libxl: add iomem support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Matthew Fioravante <matthew.fioravante@jhuapl.edu>
# Date 1349446324 -3600
# Node ID 3eb9a891889a734a21643f02dac19b1b0cbe53f7
# Parent  10277c76aed4c8ccff0fe9f0505a66361555fdb0
xl/libxl: add iomem support

This patch adds a new option for xen config files for
directly mapping hardware io memory into a vm.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 10277c76aed4 -r 3eb9a891889a docs/man/xl.cfg.pod.5
--- a/docs/man/xl.cfg.pod.5	Fri Oct 05 14:34:30 2012 +0100
+++ b/docs/man/xl.cfg.pod.5	Fri Oct 05 15:12:04 2012 +0100
@@ -496,6 +496,17 @@ is given in hexadecimal and may either a
 It is recommended to use this option only for trusted VMs under
 administrator control.
 
+=item B<iomem=[ "IOMEM_START,NUM_PAGES", "IOMEM_START,NUM_PAGES", ... ]>
+
+Allow guest to access specific hardware I/O memory pages. B<IOMEM_START>
+is a physical page number. B<NUM_PAGES> is the number
+of pages beginning with B<START_PAGE> to allow access. Both values
+must be given in hexadecimal.
+
+It is recommended to use this option only for trusted VMs under
+administrator control.
+
+
 =item B<irqs=[ NUMBER, NUMBER, ... ]>
 
 Allow a guest to access specific physical IRQs.
diff -r 10277c76aed4 -r 3eb9a891889a tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Fri Oct 05 14:34:30 2012 +0100
+++ b/tools/libxl/libxl_create.c	Fri Oct 05 15:12:04 2012 +0100
@@ -942,7 +942,7 @@ static void domcreate_launch_dm(libxl__e
 
         ret = xc_domain_ioport_permission(CTX->xch, domid,
                                           io->first, io->number, 1);
-        if ( ret<0 ){
+        if (ret < 0) {
             LOGE(ERROR,
                  "failed give dom%d access to ioports %"PRIx32"-%"PRIx32,
                  domid, io->first, io->first + io->number - 1);
@@ -956,13 +956,31 @@ static void domcreate_launch_dm(libxl__e
         LOG(DEBUG, "dom%d irq %"PRIx32, domid, irq);
 
         ret = xc_domain_irq_permission(CTX->xch, domid, irq, 1);
-        if ( ret<0 ){
+        if (ret < 0) {
             LOGE(ERROR,
                  "failed give dom%d access to irq %"PRId32, domid, irq);
             ret = ERROR_FAIL;
         }
     }
 
+    for (i = 0; i < d_config->b_info.num_iomem; i++) {
+        libxl_iomem_range *io = &d_config->b_info.iomem[i];
+
+        LOG(DEBUG, "dom%d iomem %"PRIx64"-%"PRIx64,
+            domid, io->start, io->start + io->number - 1);
+
+        ret = xc_domain_iomem_permission(CTX->xch, domid,
+                                          io->start, io->number, 1);
+        if (ret < 0) {
+            LOGE(ERROR,
+                 "failed give dom%d access to iomem range %"PRIx64"-%"PRIx64,
+                 domid, io->start, io->start + io->number - 1);
+            ret = ERROR_FAIL;
+        }
+    }
+
+
+
     for (i = 0; i < d_config->num_nics; i++) {
         /* We have to init the nic here, because we still haven't
          * called libxl_device_nic_add at this point, but qemu needs
diff -r 10277c76aed4 -r 3eb9a891889a tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Fri Oct 05 14:34:30 2012 +0100
+++ b/tools/libxl/libxl_types.idl	Fri Oct 05 15:12:04 2012 +0100
@@ -141,6 +141,11 @@ libxl_ioport_range = Struct("ioport_rang
     ("number", uint32),
     ])
 
+libxl_iomem_range = Struct("iomem_range", [
+    ("start", uint64),
+    ("number", uint64),
+    ])
+
 libxl_vga_interface_info = Struct("vga_interface_info", [
     ("kind",    libxl_vga_interface_type),
     ])
@@ -285,6 +290,7 @@ libxl_domain_build_info = Struct("domain
 
     ("ioports",          Array(libxl_ioport_range, "num_ioports")),
     ("irqs",             Array(uint32, "num_irqs")),
+    ("iomem",            Array(libxl_iomem_range, "num_iomem")),
 
     ("u", KeyedUnion(None, libxl_domain_type, "type",
                 [("hvm", Struct(None, [("firmware",         string),
diff -r 10277c76aed4 -r 3eb9a891889a tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Fri Oct 05 14:34:30 2012 +0100
+++ b/tools/libxl/xl_cmdimpl.c	Fri Oct 05 15:12:04 2012 +0100
@@ -574,8 +574,8 @@ static void parse_config_data(const char
     long l;
     XLU_Config *config;
     XLU_ConfigList *cpus, *vbds, *nics, *pcis, *cvfbs, *cpuids;
-    XLU_ConfigList *ioports, *irqs;
-    int num_ioports, num_irqs;
+    XLU_ConfigList *ioports, *irqs, *iomem;
+    int num_ioports, num_irqs, num_iomem;
     int pci_power_mgmt = 0;
     int pci_msitranslate = 0;
     int pci_permissive = 0;
@@ -1005,6 +1005,33 @@ static void parse_config_data(const char
         }
     }
 
+    if (!xlu_cfg_get_list(config, "iomem", &iomem, &num_iomem, 0)) {
+        b_info->num_iomem = num_iomem;
+        b_info->iomem = calloc(num_iomem, sizeof(*b_info->iomem));
+        if (b_info->iomem == NULL) {
+            fprintf(stderr, "unable to allocate memory for iomem\n");
+            exit(-1);
+        }
+        for (i = 0; i < num_iomem; i++) {
+            buf = xlu_cfg_get_listitem (iomem, i);
+            if (!buf) {
+                fprintf(stderr,
+                        "xl: Unable to get element %d in iomem list\n", i);
+                exit(1);
+            }
+            if(sscanf(buf, "%" SCNx64",%" SCNx64,
+                     &b_info->iomem[i].start,
+                     &b_info->iomem[i].number)
+                  != 2) {
+               fprintf(stderr,
+                       "xl: Invalid argument parsing iomem: %s\n", buf);
+               exit(1);
+            }
+        }
+    }
+
+
+
     if (!xlu_cfg_get_list (config, "disk", &vbds, 0, 0)) {
         d_config->num_disks = 0;
         d_config->disks = NULL;

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

From xen-changelog-bounces@lists.xen.org Sat Oct 06 03:33:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Oct 2012 03:33: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 1TKL8b-0007mi-0i; Sat, 06 Oct 2012 03:33:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKL8Z-0007mT-U5
	for xen-changelog@lists.xensource.com; Sat, 06 Oct 2012 03:33:12 +0000
Received: from [85.158.137.99:52400] by server-15.bemta-3.messagelabs.com id
	3F/C4-11584-676AF605; Sat, 06 Oct 2012 03:33:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-217.messagelabs.com!1349494389!19277431!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7054 invoked from network); 6 Oct 2012 03:33:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Oct 2012 03:33:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKL8W-0005ms-N2
	for xen-changelog@lists.xensource.com; Sat, 06 Oct 2012 03:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TKL8W-0001bF-AE
	for xen-changelog@lists.xensource.com; Sat, 06 Oct 2012 03:33:08 +0000
Message-Id: <E1TKL8W-0001bF-AE@xenbits.xen.org>
Date: Sat, 06 Oct 2012 03:33:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl/libxl: add iomem support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Matthew Fioravante <matthew.fioravante@jhuapl.edu>
# Date 1349446324 -3600
# Node ID 3eb9a891889a734a21643f02dac19b1b0cbe53f7
# Parent  10277c76aed4c8ccff0fe9f0505a66361555fdb0
xl/libxl: add iomem support

This patch adds a new option for xen config files for
directly mapping hardware io memory into a vm.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 10277c76aed4 -r 3eb9a891889a docs/man/xl.cfg.pod.5
--- a/docs/man/xl.cfg.pod.5	Fri Oct 05 14:34:30 2012 +0100
+++ b/docs/man/xl.cfg.pod.5	Fri Oct 05 15:12:04 2012 +0100
@@ -496,6 +496,17 @@ is given in hexadecimal and may either a
 It is recommended to use this option only for trusted VMs under
 administrator control.
 
+=item B<iomem=[ "IOMEM_START,NUM_PAGES", "IOMEM_START,NUM_PAGES", ... ]>
+
+Allow guest to access specific hardware I/O memory pages. B<IOMEM_START>
+is a physical page number. B<NUM_PAGES> is the number
+of pages beginning with B<START_PAGE> to allow access. Both values
+must be given in hexadecimal.
+
+It is recommended to use this option only for trusted VMs under
+administrator control.
+
+
 =item B<irqs=[ NUMBER, NUMBER, ... ]>
 
 Allow a guest to access specific physical IRQs.
diff -r 10277c76aed4 -r 3eb9a891889a tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Fri Oct 05 14:34:30 2012 +0100
+++ b/tools/libxl/libxl_create.c	Fri Oct 05 15:12:04 2012 +0100
@@ -942,7 +942,7 @@ static void domcreate_launch_dm(libxl__e
 
         ret = xc_domain_ioport_permission(CTX->xch, domid,
                                           io->first, io->number, 1);
-        if ( ret<0 ){
+        if (ret < 0) {
             LOGE(ERROR,
                  "failed give dom%d access to ioports %"PRIx32"-%"PRIx32,
                  domid, io->first, io->first + io->number - 1);
@@ -956,13 +956,31 @@ static void domcreate_launch_dm(libxl__e
         LOG(DEBUG, "dom%d irq %"PRIx32, domid, irq);
 
         ret = xc_domain_irq_permission(CTX->xch, domid, irq, 1);
-        if ( ret<0 ){
+        if (ret < 0) {
             LOGE(ERROR,
                  "failed give dom%d access to irq %"PRId32, domid, irq);
             ret = ERROR_FAIL;
         }
     }
 
+    for (i = 0; i < d_config->b_info.num_iomem; i++) {
+        libxl_iomem_range *io = &d_config->b_info.iomem[i];
+
+        LOG(DEBUG, "dom%d iomem %"PRIx64"-%"PRIx64,
+            domid, io->start, io->start + io->number - 1);
+
+        ret = xc_domain_iomem_permission(CTX->xch, domid,
+                                          io->start, io->number, 1);
+        if (ret < 0) {
+            LOGE(ERROR,
+                 "failed give dom%d access to iomem range %"PRIx64"-%"PRIx64,
+                 domid, io->start, io->start + io->number - 1);
+            ret = ERROR_FAIL;
+        }
+    }
+
+
+
     for (i = 0; i < d_config->num_nics; i++) {
         /* We have to init the nic here, because we still haven't
          * called libxl_device_nic_add at this point, but qemu needs
diff -r 10277c76aed4 -r 3eb9a891889a tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Fri Oct 05 14:34:30 2012 +0100
+++ b/tools/libxl/libxl_types.idl	Fri Oct 05 15:12:04 2012 +0100
@@ -141,6 +141,11 @@ libxl_ioport_range = Struct("ioport_rang
     ("number", uint32),
     ])
 
+libxl_iomem_range = Struct("iomem_range", [
+    ("start", uint64),
+    ("number", uint64),
+    ])
+
 libxl_vga_interface_info = Struct("vga_interface_info", [
     ("kind",    libxl_vga_interface_type),
     ])
@@ -285,6 +290,7 @@ libxl_domain_build_info = Struct("domain
 
     ("ioports",          Array(libxl_ioport_range, "num_ioports")),
     ("irqs",             Array(uint32, "num_irqs")),
+    ("iomem",            Array(libxl_iomem_range, "num_iomem")),
 
     ("u", KeyedUnion(None, libxl_domain_type, "type",
                 [("hvm", Struct(None, [("firmware",         string),
diff -r 10277c76aed4 -r 3eb9a891889a tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Fri Oct 05 14:34:30 2012 +0100
+++ b/tools/libxl/xl_cmdimpl.c	Fri Oct 05 15:12:04 2012 +0100
@@ -574,8 +574,8 @@ static void parse_config_data(const char
     long l;
     XLU_Config *config;
     XLU_ConfigList *cpus, *vbds, *nics, *pcis, *cvfbs, *cpuids;
-    XLU_ConfigList *ioports, *irqs;
-    int num_ioports, num_irqs;
+    XLU_ConfigList *ioports, *irqs, *iomem;
+    int num_ioports, num_irqs, num_iomem;
     int pci_power_mgmt = 0;
     int pci_msitranslate = 0;
     int pci_permissive = 0;
@@ -1005,6 +1005,33 @@ static void parse_config_data(const char
         }
     }
 
+    if (!xlu_cfg_get_list(config, "iomem", &iomem, &num_iomem, 0)) {
+        b_info->num_iomem = num_iomem;
+        b_info->iomem = calloc(num_iomem, sizeof(*b_info->iomem));
+        if (b_info->iomem == NULL) {
+            fprintf(stderr, "unable to allocate memory for iomem\n");
+            exit(-1);
+        }
+        for (i = 0; i < num_iomem; i++) {
+            buf = xlu_cfg_get_listitem (iomem, i);
+            if (!buf) {
+                fprintf(stderr,
+                        "xl: Unable to get element %d in iomem list\n", i);
+                exit(1);
+            }
+            if(sscanf(buf, "%" SCNx64",%" SCNx64,
+                     &b_info->iomem[i].start,
+                     &b_info->iomem[i].number)
+                  != 2) {
+               fprintf(stderr,
+                       "xl: Invalid argument parsing iomem: %s\n", buf);
+               exit(1);
+            }
+        }
+    }
+
+
+
     if (!xlu_cfg_get_list (config, "disk", &vbds, 0, 0)) {
         d_config->num_disks = 0;
         d_config->disks = NULL;

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

From xen-changelog-bounces@lists.xen.org Mon Oct 08 15:55:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Oct 2012 15: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 1TLFfl-0006Yj-CT; Mon, 08 Oct 2012 15:55:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfj-0006Yd-Vy
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:12 +0000
Received: from [85.158.139.211:45192] by server-15.bemta-5.messagelabs.com id
	B7/28-06905-F57F2705; Mon, 08 Oct 2012 15:55:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-206.messagelabs.com!1349711709!21533388!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27904 invoked from network); 8 Oct 2012 15:55:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2012 15:55:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfh-0007Y0-FK
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfg-0008KH-D3
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:09 +0000
Message-Id: <E1TLFfg-0008KH-D3@xenbits.xen.org>
Date: Mon, 08 Oct 2012 15:55:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Add a comment about NOGC
	usage with flexarray
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Anthony PERARD <anthony.perard@citrix.com>
# Date 1349693129 -3600
# Node ID 93e3e6a33e0a1ec9f92fc575334caa35e6dbc757
# Parent  3eb9a891889a734a21643f02dac19b1b0cbe53f7
libxl: Add a comment about NOGC usage with flexarray

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


diff -r 3eb9a891889a -r 93e3e6a33e0a tools/libxl/flexarray.h
--- a/tools/libxl/flexarray.h	Fri Oct 05 15:12:04 2012 +0100
+++ b/tools/libxl/flexarray.h	Mon Oct 08 11:45:29 2012 +0100
@@ -26,7 +26,13 @@ typedef struct flexarray {
     struct libxl__gc *gc;
 } flexarray_t;
 
-_hidden flexarray_t *flexarray_make(struct libxl__gc *gc, int size, int autogrow);
+/*
+ * NOGC can be used with flexarrays, but flexarray_free will need to be called
+ * to free the struct. The content of the flexarray will not be freed through
+ * flexarray_free.
+ */
+_hidden flexarray_t *flexarray_make(struct libxl__gc *gc_opt,
+                                    int size, int autogrow);
 _hidden void flexarray_free(flexarray_t *array);
 _hidden void flexarray_grow(flexarray_t *array, int extents);
 _hidden int flexarray_set(flexarray_t *array, unsigned int index, void *ptr);

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

From xen-changelog-bounces@lists.xen.org Mon Oct 08 15:55:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Oct 2012 15: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 1TLFfl-0006Yj-CT; Mon, 08 Oct 2012 15:55:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfj-0006Yd-Vy
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:12 +0000
Received: from [85.158.139.211:45192] by server-15.bemta-5.messagelabs.com id
	B7/28-06905-F57F2705; Mon, 08 Oct 2012 15:55:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-206.messagelabs.com!1349711709!21533388!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27904 invoked from network); 8 Oct 2012 15:55:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2012 15:55:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfh-0007Y0-FK
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfg-0008KH-D3
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:09 +0000
Message-Id: <E1TLFfg-0008KH-D3@xenbits.xen.org>
Date: Mon, 08 Oct 2012 15:55:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Add a comment about NOGC
	usage with flexarray
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Anthony PERARD <anthony.perard@citrix.com>
# Date 1349693129 -3600
# Node ID 93e3e6a33e0a1ec9f92fc575334caa35e6dbc757
# Parent  3eb9a891889a734a21643f02dac19b1b0cbe53f7
libxl: Add a comment about NOGC usage with flexarray

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


diff -r 3eb9a891889a -r 93e3e6a33e0a tools/libxl/flexarray.h
--- a/tools/libxl/flexarray.h	Fri Oct 05 15:12:04 2012 +0100
+++ b/tools/libxl/flexarray.h	Mon Oct 08 11:45:29 2012 +0100
@@ -26,7 +26,13 @@ typedef struct flexarray {
     struct libxl__gc *gc;
 } flexarray_t;
 
-_hidden flexarray_t *flexarray_make(struct libxl__gc *gc, int size, int autogrow);
+/*
+ * NOGC can be used with flexarrays, but flexarray_free will need to be called
+ * to free the struct. The content of the flexarray will not be freed through
+ * flexarray_free.
+ */
+_hidden flexarray_t *flexarray_make(struct libxl__gc *gc_opt,
+                                    int size, int autogrow);
 _hidden void flexarray_free(flexarray_t *array);
 _hidden void flexarray_grow(flexarray_t *array, int extents);
 _hidden int flexarray_set(flexarray_t *array, unsigned int index, void *ptr);

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

From xen-changelog-bounces@lists.xen.org Mon Oct 08 15:55:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Oct 2012 15:55:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TLFfm-0006Yt-F8; Mon, 08 Oct 2012 15:55:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfl-0006Yi-HD
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:13 +0000
Received: from [85.158.139.83:4833] by server-11.bemta-5.messagelabs.com id
	BF/08-13866-067F2705; Mon, 08 Oct 2012 15:55:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-182.messagelabs.com!1349711710!28311958!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15140 invoked from network); 8 Oct 2012 15:55:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2012 15:55:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfi-0007Y3-7x
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfh-0008KW-Uq
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:09 +0000
Message-Id: <E1TLFfh-0008KW-Uq@xenbits.xen.org>
Date: Mon, 08 Oct 2012 15:55:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl_json: Export json_object
	related 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

# HG changeset patch
# User Anthony PERARD <anthony.perard@citrix.com>
# Date 1349693129 -3600
# Node ID c9b80c7f8db1a5d26906a2298c481bf7e87fda94
# Parent  93e3e6a33e0a1ec9f92fc575334caa35e6dbc757
libxl_json: Export json_object related function.

Export libxl__json_object_alloc and libxl__json_object_append_to to
use them in a later patch.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 93e3e6a33e0a -r c9b80c7f8db1 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Mon Oct 08 11:45:29 2012 +0100
+++ b/tools/libxl/libxl_internal.h	Mon Oct 08 11:45:29 2012 +0100
@@ -1516,6 +1516,15 @@ static inline long long libxl__json_obje
         return -1;
 }
 
+/*
+ * NOGC can be used with those json_object functions, but the
+ * libxl__json_object* will need to be freed with libxl__json_object_free.
+ */
+_hidden libxl__json_object *libxl__json_object_alloc(libxl__gc *gc_opt,
+                                                     libxl__json_node_type type);
+_hidden int libxl__json_object_append_to(libxl__gc *gc_opt,
+                                         libxl__json_object *obj,
+                                         libxl__json_object *dst);
 _hidden libxl__json_object *libxl__json_array_get(const libxl__json_object *o,
                                                   int i);
 _hidden
@@ -1524,9 +1533,10 @@ libxl__json_map_node *libxl__json_map_no
 _hidden const libxl__json_object *libxl__json_map_get(const char *key,
                                           const libxl__json_object *o,
                                           libxl__json_node_type expected_type);
-_hidden void libxl__json_object_free(libxl__gc *gc, libxl__json_object *obj);
-
-_hidden libxl__json_object *libxl__json_parse(libxl__gc *gc, const char *s);
+_hidden void libxl__json_object_free(libxl__gc *gc_opt,
+                                     libxl__json_object *obj);
+
+_hidden libxl__json_object *libxl__json_parse(libxl__gc *gc_opt, const char *s);
 
   /* Based on /local/domain/$domid/dm-version xenstore key
    * default is qemu xen traditional */
diff -r 93e3e6a33e0a -r c9b80c7f8db1 tools/libxl/libxl_json.c
--- a/tools/libxl/libxl_json.c	Mon Oct 08 11:45:29 2012 +0100
+++ b/tools/libxl/libxl_json.c	Mon Oct 08 11:45:29 2012 +0100
@@ -205,7 +205,7 @@ yajl_gen_status libxl__string_gen_json(y
  * libxl__json_object helper functions
  */
 
-static libxl__json_object *json_object_alloc(libxl__gc *gc,
+libxl__json_object *libxl__json_object_alloc(libxl__gc *gc,
                                              libxl__json_node_type type)
 {
     libxl__json_object *obj;
@@ -225,7 +225,7 @@ static libxl__json_object *json_object_a
     return obj;
 }
 
-static int json_object_append_to(libxl__gc *gc,
+int libxl__json_object_append_to(libxl__gc *gc,
                                  libxl__json_object *obj,
                                  libxl__json_object *dst)
 {
@@ -378,9 +378,9 @@ static int json_callback_null(void *opaq
 
     DEBUG_GEN(ctx, null);
 
-    obj = json_object_alloc(ctx->gc, JSON_NULL);
+    obj = libxl__json_object_alloc(ctx->gc, JSON_NULL);
 
-    if (json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
+    if (libxl__json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
         return 0;
     }
 
@@ -394,10 +394,10 @@ static int json_callback_boolean(void *o
 
     DEBUG_GEN_VALUE(ctx, bool, boolean);
 
-    obj = json_object_alloc(ctx->gc,
-                            boolean ? JSON_TRUE : JSON_FALSE);
+    obj = libxl__json_object_alloc(ctx->gc,
+                                   boolean ? JSON_TRUE : JSON_FALSE);
 
-    if (json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
+    if (libxl__json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
         return 0;
     }
 
@@ -429,7 +429,7 @@ static int json_callback_number(void *op
             goto error;
         }
 
-        obj = json_object_alloc(ctx->gc, JSON_DOUBLE);
+        obj = libxl__json_object_alloc(ctx->gc, JSON_DOUBLE);
         obj->u.d = d;
     } else {
         long long i = strtoll(s, NULL, 10);
@@ -438,14 +438,14 @@ static int json_callback_number(void *op
             goto error;
         }
 
-        obj = json_object_alloc(ctx->gc, JSON_INTEGER);
+        obj = libxl__json_object_alloc(ctx->gc, JSON_INTEGER);
         obj->u.i = i;
     }
     goto out;
 
 error:
     /* If the conversion fail, we just store the original string. */
-    obj = json_object_alloc(ctx->gc, JSON_NUMBER);
+    obj = libxl__json_object_alloc(ctx->gc, JSON_NUMBER);
 
     t = libxl__zalloc(ctx->gc, len + 1);
     strncpy(t, s, len);
@@ -454,7 +454,7 @@ error:
     obj->u.string = t;
 
 out:
-    if (json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
+    if (libxl__json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
         return 0;
     }
 
@@ -475,10 +475,10 @@ static int json_callback_string(void *op
     strncpy(t, (const char *) str, len);
     t[len] = 0;
 
-    obj = json_object_alloc(ctx->gc, JSON_STRING);
+    obj = libxl__json_object_alloc(ctx->gc, JSON_STRING);
     obj->u.string = t;
 
-    if (json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
+    if (libxl__json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
         return 0;
     }
 
@@ -524,10 +524,10 @@ static int json_callback_start_map(void 
 
     DEBUG_GEN(ctx, map_open);
 
-    obj = json_object_alloc(ctx->gc, JSON_MAP);
+    obj = libxl__json_object_alloc(ctx->gc, JSON_MAP);
 
     if (ctx->current) {
-        if (json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
+        if (libxl__json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
             return 0;
         }
     }
@@ -564,10 +564,10 @@ static int json_callback_start_array(voi
 
     DEBUG_GEN(ctx, array_open);
 
-    obj = json_object_alloc(ctx->gc, JSON_ARRAY);
+    obj = libxl__json_object_alloc(ctx->gc, JSON_ARRAY);
 
     if (ctx->current) {
-        if (json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
+        if (libxl__json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
             return 0;
         }
     }

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

From xen-changelog-bounces@lists.xen.org Mon Oct 08 15:55:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Oct 2012 15:55:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TLFfm-0006Yt-F8; Mon, 08 Oct 2012 15:55:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfl-0006Yi-HD
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:13 +0000
Received: from [85.158.139.83:4833] by server-11.bemta-5.messagelabs.com id
	BF/08-13866-067F2705; Mon, 08 Oct 2012 15:55:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-182.messagelabs.com!1349711710!28311958!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15140 invoked from network); 8 Oct 2012 15:55:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2012 15:55:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfi-0007Y3-7x
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfh-0008KW-Uq
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:09 +0000
Message-Id: <E1TLFfh-0008KW-Uq@xenbits.xen.org>
Date: Mon, 08 Oct 2012 15:55:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl_json: Export json_object
	related 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

# HG changeset patch
# User Anthony PERARD <anthony.perard@citrix.com>
# Date 1349693129 -3600
# Node ID c9b80c7f8db1a5d26906a2298c481bf7e87fda94
# Parent  93e3e6a33e0a1ec9f92fc575334caa35e6dbc757
libxl_json: Export json_object related function.

Export libxl__json_object_alloc and libxl__json_object_append_to to
use them in a later patch.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 93e3e6a33e0a -r c9b80c7f8db1 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Mon Oct 08 11:45:29 2012 +0100
+++ b/tools/libxl/libxl_internal.h	Mon Oct 08 11:45:29 2012 +0100
@@ -1516,6 +1516,15 @@ static inline long long libxl__json_obje
         return -1;
 }
 
+/*
+ * NOGC can be used with those json_object functions, but the
+ * libxl__json_object* will need to be freed with libxl__json_object_free.
+ */
+_hidden libxl__json_object *libxl__json_object_alloc(libxl__gc *gc_opt,
+                                                     libxl__json_node_type type);
+_hidden int libxl__json_object_append_to(libxl__gc *gc_opt,
+                                         libxl__json_object *obj,
+                                         libxl__json_object *dst);
 _hidden libxl__json_object *libxl__json_array_get(const libxl__json_object *o,
                                                   int i);
 _hidden
@@ -1524,9 +1533,10 @@ libxl__json_map_node *libxl__json_map_no
 _hidden const libxl__json_object *libxl__json_map_get(const char *key,
                                           const libxl__json_object *o,
                                           libxl__json_node_type expected_type);
-_hidden void libxl__json_object_free(libxl__gc *gc, libxl__json_object *obj);
-
-_hidden libxl__json_object *libxl__json_parse(libxl__gc *gc, const char *s);
+_hidden void libxl__json_object_free(libxl__gc *gc_opt,
+                                     libxl__json_object *obj);
+
+_hidden libxl__json_object *libxl__json_parse(libxl__gc *gc_opt, const char *s);
 
   /* Based on /local/domain/$domid/dm-version xenstore key
    * default is qemu xen traditional */
diff -r 93e3e6a33e0a -r c9b80c7f8db1 tools/libxl/libxl_json.c
--- a/tools/libxl/libxl_json.c	Mon Oct 08 11:45:29 2012 +0100
+++ b/tools/libxl/libxl_json.c	Mon Oct 08 11:45:29 2012 +0100
@@ -205,7 +205,7 @@ yajl_gen_status libxl__string_gen_json(y
  * libxl__json_object helper functions
  */
 
-static libxl__json_object *json_object_alloc(libxl__gc *gc,
+libxl__json_object *libxl__json_object_alloc(libxl__gc *gc,
                                              libxl__json_node_type type)
 {
     libxl__json_object *obj;
@@ -225,7 +225,7 @@ static libxl__json_object *json_object_a
     return obj;
 }
 
-static int json_object_append_to(libxl__gc *gc,
+int libxl__json_object_append_to(libxl__gc *gc,
                                  libxl__json_object *obj,
                                  libxl__json_object *dst)
 {
@@ -378,9 +378,9 @@ static int json_callback_null(void *opaq
 
     DEBUG_GEN(ctx, null);
 
-    obj = json_object_alloc(ctx->gc, JSON_NULL);
+    obj = libxl__json_object_alloc(ctx->gc, JSON_NULL);
 
-    if (json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
+    if (libxl__json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
         return 0;
     }
 
@@ -394,10 +394,10 @@ static int json_callback_boolean(void *o
 
     DEBUG_GEN_VALUE(ctx, bool, boolean);
 
-    obj = json_object_alloc(ctx->gc,
-                            boolean ? JSON_TRUE : JSON_FALSE);
+    obj = libxl__json_object_alloc(ctx->gc,
+                                   boolean ? JSON_TRUE : JSON_FALSE);
 
-    if (json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
+    if (libxl__json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
         return 0;
     }
 
@@ -429,7 +429,7 @@ static int json_callback_number(void *op
             goto error;
         }
 
-        obj = json_object_alloc(ctx->gc, JSON_DOUBLE);
+        obj = libxl__json_object_alloc(ctx->gc, JSON_DOUBLE);
         obj->u.d = d;
     } else {
         long long i = strtoll(s, NULL, 10);
@@ -438,14 +438,14 @@ static int json_callback_number(void *op
             goto error;
         }
 
-        obj = json_object_alloc(ctx->gc, JSON_INTEGER);
+        obj = libxl__json_object_alloc(ctx->gc, JSON_INTEGER);
         obj->u.i = i;
     }
     goto out;
 
 error:
     /* If the conversion fail, we just store the original string. */
-    obj = json_object_alloc(ctx->gc, JSON_NUMBER);
+    obj = libxl__json_object_alloc(ctx->gc, JSON_NUMBER);
 
     t = libxl__zalloc(ctx->gc, len + 1);
     strncpy(t, s, len);
@@ -454,7 +454,7 @@ error:
     obj->u.string = t;
 
 out:
-    if (json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
+    if (libxl__json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
         return 0;
     }
 
@@ -475,10 +475,10 @@ static int json_callback_string(void *op
     strncpy(t, (const char *) str, len);
     t[len] = 0;
 
-    obj = json_object_alloc(ctx->gc, JSON_STRING);
+    obj = libxl__json_object_alloc(ctx->gc, JSON_STRING);
     obj->u.string = t;
 
-    if (json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
+    if (libxl__json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
         return 0;
     }
 
@@ -524,10 +524,10 @@ static int json_callback_start_map(void 
 
     DEBUG_GEN(ctx, map_open);
 
-    obj = json_object_alloc(ctx->gc, JSON_MAP);
+    obj = libxl__json_object_alloc(ctx->gc, JSON_MAP);
 
     if (ctx->current) {
-        if (json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
+        if (libxl__json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
             return 0;
         }
     }
@@ -564,10 +564,10 @@ static int json_callback_start_array(voi
 
     DEBUG_GEN(ctx, array_open);
 
-    obj = json_object_alloc(ctx->gc, JSON_ARRAY);
+    obj = libxl__json_object_alloc(ctx->gc, JSON_ARRAY);
 
     if (ctx->current) {
-        if (json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
+        if (libxl__json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
             return 0;
         }
     }

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

From xen-changelog-bounces@lists.xen.org Mon Oct 08 15:55:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Oct 2012 15:55:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TLFfn-0006Z6-Hf; Mon, 08 Oct 2012 15:55:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfm-0006Ys-VC
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:15 +0000
Received: from [85.158.139.83:4950] by server-7.bemta-5.messagelabs.com id
	BF/7F-00431-167F2705; Mon, 08 Oct 2012 15:55:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-182.messagelabs.com!1349711711!29397134!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31423 invoked from network); 8 Oct 2012 15:55:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2012 15:55:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfj-0007Y9-Kn
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfj-0008L3-56
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:11 +0000
Message-Id: <E1TLFfj-0008L3-56@xenbits.xen.org>
Date: Mon, 08 Oct 2012 15:55:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl_json: Replace JSON_TRUE/FALSE
	by JSON_BOOL.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Anthony PERARD <anthony.perard@citrix.com>
# Date 1349693131 -3600
# Node ID 3f71aab0e2774ded0c5a03436c364fb031ba9aa0
# Parent  4a6d5d8cba4fc44f9bbda201188885868604b8e8
libxl_json: Replace JSON_TRUE/FALSE by JSON_BOOL.

Those two JSON_TRUE and JSON_FALSE were types of node. But it's better
to have a unique JSON_BOOL type.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 4a6d5d8cba4f -r 3f71aab0e277 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Mon Oct 08 11:45:30 2012 +0100
+++ b/tools/libxl/libxl_internal.h	Mon Oct 08 11:45:31 2012 +0100
@@ -1433,8 +1433,7 @@ _hidden yajl_gen_status libxl__yajl_gen_
 
 typedef enum {
     JSON_NULL,
-    JSON_TRUE,
-    JSON_FALSE,
+    JSON_BOOL,
     JSON_INTEGER,
     JSON_DOUBLE,
     /* number is store in string, it's too big to be a long long or a double */
@@ -1448,6 +1447,7 @@ typedef enum {
 typedef struct libxl__json_object {
     libxl__json_node_type type;
     union {
+        bool b;
         long long i;
         double d;
         char *string;
@@ -1466,6 +1466,10 @@ typedef struct {
 
 typedef struct libxl__yajl_ctx libxl__yajl_ctx;
 
+static inline bool libxl__json_object_is_bool(const libxl__json_object *o)
+{
+    return o != NULL && o->type == JSON_BOOL;
+}
 static inline bool libxl__json_object_is_string(const libxl__json_object *o)
 {
     return o != NULL && o->type == JSON_STRING;
@@ -1483,6 +1487,13 @@ static inline bool libxl__json_object_is
     return o != NULL && o->type == JSON_ARRAY;
 }
 
+static inline bool libxl__json_object_get_bool(const libxl__json_object *o)
+{
+    if (libxl__json_object_is_bool(o))
+        return o->u.b;
+    else
+        return false;
+}
 static inline
 const char *libxl__json_object_get_string(const libxl__json_object *o)
 {
diff -r 4a6d5d8cba4f -r 3f71aab0e277 tools/libxl/libxl_json.c
--- a/tools/libxl/libxl_json.c	Mon Oct 08 11:45:30 2012 +0100
+++ b/tools/libxl/libxl_json.c	Mon Oct 08 11:45:31 2012 +0100
@@ -394,8 +394,8 @@ static int json_callback_boolean(void *o
 
     DEBUG_GEN_VALUE(ctx, bool, boolean);
 
-    obj = libxl__json_object_alloc(ctx->gc,
-                                   boolean ? JSON_TRUE : JSON_FALSE);
+    obj = libxl__json_object_alloc(ctx->gc, JSON_BOOL);
+    obj->u.b = boolean;
 
     if (libxl__json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
         return 0;
diff -r 4a6d5d8cba4f -r 3f71aab0e277 tools/libxl/libxl_qmp.c
--- a/tools/libxl/libxl_qmp.c	Mon Oct 08 11:45:30 2012 +0100
+++ b/tools/libxl/libxl_qmp.c	Mon Oct 08 11:45:31 2012 +0100
@@ -178,7 +178,8 @@ static int qmp_register_vnc_callback(lib
         goto out;
     }
 
-    if (libxl__json_map_get("enabled", o, JSON_FALSE)) {
+    obj = libxl__json_map_get("enabled", o, JSON_BOOL);
+    if (!obj || !libxl__json_object_get_bool(obj)) {
         rc = 0;
         goto out;
     }

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

From xen-changelog-bounces@lists.xen.org Mon Oct 08 15:55:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Oct 2012 15:55:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TLFfn-0006Z6-Hf; Mon, 08 Oct 2012 15:55:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfm-0006Ys-VC
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:15 +0000
Received: from [85.158.139.83:4950] by server-7.bemta-5.messagelabs.com id
	BF/7F-00431-167F2705; Mon, 08 Oct 2012 15:55:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-182.messagelabs.com!1349711711!29397134!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31423 invoked from network); 8 Oct 2012 15:55:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2012 15:55:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfj-0007Y9-Kn
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfj-0008L3-56
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:11 +0000
Message-Id: <E1TLFfj-0008L3-56@xenbits.xen.org>
Date: Mon, 08 Oct 2012 15:55:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl_json: Replace JSON_TRUE/FALSE
	by JSON_BOOL.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Anthony PERARD <anthony.perard@citrix.com>
# Date 1349693131 -3600
# Node ID 3f71aab0e2774ded0c5a03436c364fb031ba9aa0
# Parent  4a6d5d8cba4fc44f9bbda201188885868604b8e8
libxl_json: Replace JSON_TRUE/FALSE by JSON_BOOL.

Those two JSON_TRUE and JSON_FALSE were types of node. But it's better
to have a unique JSON_BOOL type.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 4a6d5d8cba4f -r 3f71aab0e277 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Mon Oct 08 11:45:30 2012 +0100
+++ b/tools/libxl/libxl_internal.h	Mon Oct 08 11:45:31 2012 +0100
@@ -1433,8 +1433,7 @@ _hidden yajl_gen_status libxl__yajl_gen_
 
 typedef enum {
     JSON_NULL,
-    JSON_TRUE,
-    JSON_FALSE,
+    JSON_BOOL,
     JSON_INTEGER,
     JSON_DOUBLE,
     /* number is store in string, it's too big to be a long long or a double */
@@ -1448,6 +1447,7 @@ typedef enum {
 typedef struct libxl__json_object {
     libxl__json_node_type type;
     union {
+        bool b;
         long long i;
         double d;
         char *string;
@@ -1466,6 +1466,10 @@ typedef struct {
 
 typedef struct libxl__yajl_ctx libxl__yajl_ctx;
 
+static inline bool libxl__json_object_is_bool(const libxl__json_object *o)
+{
+    return o != NULL && o->type == JSON_BOOL;
+}
 static inline bool libxl__json_object_is_string(const libxl__json_object *o)
 {
     return o != NULL && o->type == JSON_STRING;
@@ -1483,6 +1487,13 @@ static inline bool libxl__json_object_is
     return o != NULL && o->type == JSON_ARRAY;
 }
 
+static inline bool libxl__json_object_get_bool(const libxl__json_object *o)
+{
+    if (libxl__json_object_is_bool(o))
+        return o->u.b;
+    else
+        return false;
+}
 static inline
 const char *libxl__json_object_get_string(const libxl__json_object *o)
 {
diff -r 4a6d5d8cba4f -r 3f71aab0e277 tools/libxl/libxl_json.c
--- a/tools/libxl/libxl_json.c	Mon Oct 08 11:45:30 2012 +0100
+++ b/tools/libxl/libxl_json.c	Mon Oct 08 11:45:31 2012 +0100
@@ -394,8 +394,8 @@ static int json_callback_boolean(void *o
 
     DEBUG_GEN_VALUE(ctx, bool, boolean);
 
-    obj = libxl__json_object_alloc(ctx->gc,
-                                   boolean ? JSON_TRUE : JSON_FALSE);
+    obj = libxl__json_object_alloc(ctx->gc, JSON_BOOL);
+    obj->u.b = boolean;
 
     if (libxl__json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
         return 0;
diff -r 4a6d5d8cba4f -r 3f71aab0e277 tools/libxl/libxl_qmp.c
--- a/tools/libxl/libxl_qmp.c	Mon Oct 08 11:45:30 2012 +0100
+++ b/tools/libxl/libxl_qmp.c	Mon Oct 08 11:45:31 2012 +0100
@@ -178,7 +178,8 @@ static int qmp_register_vnc_callback(lib
         goto out;
     }
 
-    if (libxl__json_map_get("enabled", o, JSON_FALSE)) {
+    obj = libxl__json_map_get("enabled", o, JSON_BOOL);
+    if (!obj || !libxl__json_object_get_bool(obj)) {
         rc = 0;
         goto out;
     }

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

From xen-changelog-bounces@lists.xen.org Mon Oct 08 15:55:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Oct 2012 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 1TLFfp-0006ZM-Kb; Mon, 08 Oct 2012 15:55:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfo-0006Yi-Aw
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:16 +0000
Received: from [85.158.139.83:18674] by server-11.bemta-5.messagelabs.com id
	8B/28-13866-467F2705; Mon, 08 Oct 2012 15:55:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-182.messagelabs.com!1349711713!26707608!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2465 invoked from network); 8 Oct 2012 15:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2012 15:55:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfl-0007YI-Hf
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfl-0008Lm-Cj
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:13 +0000
Message-Id: <E1TLFfl-0008Lm-Cj@xenbits.xen.org>
Date: Mon, 08 Oct 2012 15:55:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl_qmp: Use qmp_parameters_*
	functions for param list of a QMP command.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Anthony PERARD <anthony.perard@citrix.com>
# Date 1349693133 -3600
# Node ID be5d014f91dfbd67afacc3385c265243794a246f
# Parent  6f7847729f0f42614de516d15257ede7243f995f
libxl_qmp: Use qmp_parameters_* functions for param list of a QMP command.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 6f7847729f0f -r be5d014f91df tools/libxl/libxl_qmp.c
--- a/tools/libxl/libxl_qmp.c	Mon Oct 08 11:45:32 2012 +0100
+++ b/tools/libxl/libxl_qmp.c	Mon Oct 08 11:45:33 2012 +0100
@@ -78,7 +78,7 @@ struct libxl__qmp_handler {
 };
 
 static int qmp_send(libxl__qmp_handler *qmp,
-                    const char *cmd, libxl_key_value_list *args,
+                    const char *cmd, libxl__json_object *args,
                     qmp_callback_t callback, void *opaque,
                     qmp_request_context *context);
 
@@ -502,7 +502,7 @@ static int qmp_next(libxl__gc *gc, libxl
 }
 
 static char *qmp_send_prepare(libxl__gc *gc, libxl__qmp_handler *qmp,
-                              const char *cmd, libxl_key_value_list *args,
+                              const char *cmd, libxl__json_object *args,
                               qmp_callback_t callback, void *opaque,
                               qmp_request_context *context)
 {
@@ -526,7 +526,7 @@ static char *qmp_send_prepare(libxl__gc 
     yajl_gen_integer(hand, ++qmp->last_id_used);
     if (args) {
         libxl__yajl_gen_asciiz(hand, "arguments");
-        libxl_key_value_list_gen_json(hand, args);
+        libxl__json_object_to_yajl_gen(gc, hand, args);
     }
     yajl_gen_map_close(hand);
 
@@ -560,7 +560,7 @@ out:
 }
 
 static int qmp_send(libxl__qmp_handler *qmp,
-                    const char *cmd, libxl_key_value_list *args,
+                    const char *cmd, libxl__json_object *args,
                     qmp_callback_t callback, void *opaque,
                     qmp_request_context *context)
 {
@@ -588,7 +588,7 @@ out:
 }
 
 static int qmp_synchronous_send(libxl__qmp_handler *qmp, const char *cmd,
-                                libxl_key_value_list *args,
+                                libxl__json_object *args,
                                 qmp_callback_t callback, void *opaque,
                                 int ask_timeout)
 {
@@ -623,7 +623,6 @@ static void qmp_free_handler(libxl__qmp_
     free(qmp);
 }
 
-#if 0
 /*
  * QMP Parameters Helpers
  */
@@ -658,6 +657,7 @@ static void qmp_parameters_add_string(li
     qmp_parameters_common_add(gc, param, name, obj);
 }
 
+#if 0
 static void qmp_parameters_add_bool(libxl__gc *gc,
                                     libxl__json_object **param,
                                     const char *name, bool b)
@@ -668,11 +668,11 @@ static void qmp_parameters_add_bool(libx
     obj->u.b = b;
     qmp_parameters_common_add(gc, param, name, obj);
 }
+#endif
 
 #define QMP_PARAMETERS_SPRINTF(args, name, format, ...) \
     qmp_parameters_add_string(gc, args, name, \
                               libxl__sprintf(gc, format, __VA_ARGS__))
-#endif
 
 /*
  * API
@@ -800,8 +800,7 @@ out:
 int libxl__qmp_pci_add(libxl__gc *gc, int domid, libxl_device_pci *pcidev)
 {
     libxl__qmp_handler *qmp = NULL;
-    flexarray_t *parameters = NULL;
-    libxl_key_value_list args = NULL;
+    libxl__json_object *args = NULL;
     char *hostaddr = NULL;
     int rc = 0;
 
@@ -814,22 +813,16 @@ int libxl__qmp_pci_add(libxl__gc *gc, in
     if (!hostaddr)
         return -1;
 
-    parameters = flexarray_make(gc, 6, 1);
-    flexarray_append_pair(parameters, "driver", "xen-pci-passthrough");
-    flexarray_append_pair(parameters, "id",
-                          libxl__sprintf(gc, PCI_PT_QDEV_ID,
-                                         pcidev->bus, pcidev->dev,
-                                         pcidev->func));
-    flexarray_append_pair(parameters, "hostaddr", hostaddr);
+    qmp_parameters_add_string(gc, &args, "driver", "xen-pci-passthrough");
+    QMP_PARAMETERS_SPRINTF(&args, "id", PCI_PT_QDEV_ID,
+                           pcidev->bus, pcidev->dev, pcidev->func);
+    qmp_parameters_add_string(gc, &args, "hostaddr", hostaddr);
     if (pcidev->vdevfn) {
-        flexarray_append_pair(parameters, "addr",
-                              libxl__sprintf(gc, "%x.%x",
-                                             PCI_SLOT(pcidev->vdevfn),
-                                             PCI_FUNC(pcidev->vdevfn)));
+        QMP_PARAMETERS_SPRINTF(&args, "addr", "%x.%x",
+                               PCI_SLOT(pcidev->vdevfn), PCI_FUNC(pcidev->vdevfn));
     }
-    args = libxl__xs_kvs_of_flexarray(gc, parameters, parameters->count);
 
-    rc = qmp_synchronous_send(qmp, "device_add", &args,
+    rc = qmp_synchronous_send(qmp, "device_add", args,
                               NULL, NULL, qmp->timeout);
     if (rc == 0) {
         rc = qmp_synchronous_send(qmp, "query-pci", NULL,
@@ -843,19 +836,16 @@ int libxl__qmp_pci_add(libxl__gc *gc, in
 static int qmp_device_del(libxl__gc *gc, int domid, char *id)
 {
     libxl__qmp_handler *qmp = NULL;
-    flexarray_t *parameters = NULL;
-    libxl_key_value_list args = NULL;
+    libxl__json_object *args = NULL;
     int rc = 0;
 
     qmp = libxl__qmp_initialize(gc, domid);
     if (!qmp)
         return ERROR_FAIL;
 
-    parameters = flexarray_make(gc, 2, 1);
-    flexarray_append_pair(parameters, "id", id);
-    args = libxl__xs_kvs_of_flexarray(gc, parameters, parameters->count);
+    qmp_parameters_add_string(gc, &args, "id", id);
 
-    rc = qmp_synchronous_send(qmp, "device_del", &args,
+    rc = qmp_synchronous_send(qmp, "device_del", args,
                               NULL, NULL, qmp->timeout);
 
     libxl__qmp_close(qmp);
@@ -875,19 +865,16 @@ int libxl__qmp_pci_del(libxl__gc *gc, in
 int libxl__qmp_save(libxl__gc *gc, int domid, const char *filename)
 {
     libxl__qmp_handler *qmp = NULL;
-    flexarray_t *parameters = NULL;
-    libxl_key_value_list args = NULL;
+    libxl__json_object *args = NULL;
     int rc = 0;
 
     qmp = libxl__qmp_initialize(gc, domid);
     if (!qmp)
         return ERROR_FAIL;
 
-    parameters = flexarray_make(gc, 2, 1);
-    flexarray_append_pair(parameters, "filename", (char *)filename);
-    args = libxl__xs_kvs_of_flexarray(gc, parameters, parameters->count);
+    qmp_parameters_add_string(gc, &args, "filename", (char *)filename);
 
-    rc = qmp_synchronous_send(qmp, "xen-save-devices-state", &args,
+    rc = qmp_synchronous_send(qmp, "xen-save-devices-state", args,
                               NULL, NULL, qmp->timeout);
 
     libxl__qmp_close(qmp);
@@ -897,18 +884,16 @@ int libxl__qmp_save(libxl__gc *gc, int d
 static int qmp_change(libxl__gc *gc, libxl__qmp_handler *qmp,
                       char *device, char *target, char *arg)
 {
-    flexarray_t *parameters = NULL;
-    libxl_key_value_list args = NULL;
+    libxl__json_object *args = NULL;
     int rc = 0;
 
-    parameters = flexarray_make(gc, 6, 1);
-    flexarray_append_pair(parameters, "device", device);
-    flexarray_append_pair(parameters, "target", target);
-    if (arg)
-        flexarray_append_pair(parameters, "arg", arg);
-    args = libxl__xs_kvs_of_flexarray(gc, parameters, parameters->count);
+    qmp_parameters_add_string(gc, &args, "device", device);
+    qmp_parameters_add_string(gc, &args, "target", target);
+    if (arg) {
+        qmp_parameters_add_string(gc, &args, "arg", arg);
+    }
 
-    rc = qmp_synchronous_send(qmp, "change", &args,
+    rc = qmp_synchronous_send(qmp, "change", args,
                               NULL, NULL, qmp->timeout);
 
     return rc;

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

From xen-changelog-bounces@lists.xen.org Mon Oct 08 15:55:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Oct 2012 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 1TLFfp-0006ZM-Kb; Mon, 08 Oct 2012 15:55:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfo-0006Yi-Aw
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:16 +0000
Received: from [85.158.139.83:18674] by server-11.bemta-5.messagelabs.com id
	8B/28-13866-467F2705; Mon, 08 Oct 2012 15:55:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-182.messagelabs.com!1349711713!26707608!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2465 invoked from network); 8 Oct 2012 15:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2012 15:55:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfl-0007YI-Hf
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfl-0008Lm-Cj
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:13 +0000
Message-Id: <E1TLFfl-0008Lm-Cj@xenbits.xen.org>
Date: Mon, 08 Oct 2012 15:55:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl_qmp: Use qmp_parameters_*
	functions for param list of a QMP command.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Anthony PERARD <anthony.perard@citrix.com>
# Date 1349693133 -3600
# Node ID be5d014f91dfbd67afacc3385c265243794a246f
# Parent  6f7847729f0f42614de516d15257ede7243f995f
libxl_qmp: Use qmp_parameters_* functions for param list of a QMP command.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 6f7847729f0f -r be5d014f91df tools/libxl/libxl_qmp.c
--- a/tools/libxl/libxl_qmp.c	Mon Oct 08 11:45:32 2012 +0100
+++ b/tools/libxl/libxl_qmp.c	Mon Oct 08 11:45:33 2012 +0100
@@ -78,7 +78,7 @@ struct libxl__qmp_handler {
 };
 
 static int qmp_send(libxl__qmp_handler *qmp,
-                    const char *cmd, libxl_key_value_list *args,
+                    const char *cmd, libxl__json_object *args,
                     qmp_callback_t callback, void *opaque,
                     qmp_request_context *context);
 
@@ -502,7 +502,7 @@ static int qmp_next(libxl__gc *gc, libxl
 }
 
 static char *qmp_send_prepare(libxl__gc *gc, libxl__qmp_handler *qmp,
-                              const char *cmd, libxl_key_value_list *args,
+                              const char *cmd, libxl__json_object *args,
                               qmp_callback_t callback, void *opaque,
                               qmp_request_context *context)
 {
@@ -526,7 +526,7 @@ static char *qmp_send_prepare(libxl__gc 
     yajl_gen_integer(hand, ++qmp->last_id_used);
     if (args) {
         libxl__yajl_gen_asciiz(hand, "arguments");
-        libxl_key_value_list_gen_json(hand, args);
+        libxl__json_object_to_yajl_gen(gc, hand, args);
     }
     yajl_gen_map_close(hand);
 
@@ -560,7 +560,7 @@ out:
 }
 
 static int qmp_send(libxl__qmp_handler *qmp,
-                    const char *cmd, libxl_key_value_list *args,
+                    const char *cmd, libxl__json_object *args,
                     qmp_callback_t callback, void *opaque,
                     qmp_request_context *context)
 {
@@ -588,7 +588,7 @@ out:
 }
 
 static int qmp_synchronous_send(libxl__qmp_handler *qmp, const char *cmd,
-                                libxl_key_value_list *args,
+                                libxl__json_object *args,
                                 qmp_callback_t callback, void *opaque,
                                 int ask_timeout)
 {
@@ -623,7 +623,6 @@ static void qmp_free_handler(libxl__qmp_
     free(qmp);
 }
 
-#if 0
 /*
  * QMP Parameters Helpers
  */
@@ -658,6 +657,7 @@ static void qmp_parameters_add_string(li
     qmp_parameters_common_add(gc, param, name, obj);
 }
 
+#if 0
 static void qmp_parameters_add_bool(libxl__gc *gc,
                                     libxl__json_object **param,
                                     const char *name, bool b)
@@ -668,11 +668,11 @@ static void qmp_parameters_add_bool(libx
     obj->u.b = b;
     qmp_parameters_common_add(gc, param, name, obj);
 }
+#endif
 
 #define QMP_PARAMETERS_SPRINTF(args, name, format, ...) \
     qmp_parameters_add_string(gc, args, name, \
                               libxl__sprintf(gc, format, __VA_ARGS__))
-#endif
 
 /*
  * API
@@ -800,8 +800,7 @@ out:
 int libxl__qmp_pci_add(libxl__gc *gc, int domid, libxl_device_pci *pcidev)
 {
     libxl__qmp_handler *qmp = NULL;
-    flexarray_t *parameters = NULL;
-    libxl_key_value_list args = NULL;
+    libxl__json_object *args = NULL;
     char *hostaddr = NULL;
     int rc = 0;
 
@@ -814,22 +813,16 @@ int libxl__qmp_pci_add(libxl__gc *gc, in
     if (!hostaddr)
         return -1;
 
-    parameters = flexarray_make(gc, 6, 1);
-    flexarray_append_pair(parameters, "driver", "xen-pci-passthrough");
-    flexarray_append_pair(parameters, "id",
-                          libxl__sprintf(gc, PCI_PT_QDEV_ID,
-                                         pcidev->bus, pcidev->dev,
-                                         pcidev->func));
-    flexarray_append_pair(parameters, "hostaddr", hostaddr);
+    qmp_parameters_add_string(gc, &args, "driver", "xen-pci-passthrough");
+    QMP_PARAMETERS_SPRINTF(&args, "id", PCI_PT_QDEV_ID,
+                           pcidev->bus, pcidev->dev, pcidev->func);
+    qmp_parameters_add_string(gc, &args, "hostaddr", hostaddr);
     if (pcidev->vdevfn) {
-        flexarray_append_pair(parameters, "addr",
-                              libxl__sprintf(gc, "%x.%x",
-                                             PCI_SLOT(pcidev->vdevfn),
-                                             PCI_FUNC(pcidev->vdevfn)));
+        QMP_PARAMETERS_SPRINTF(&args, "addr", "%x.%x",
+                               PCI_SLOT(pcidev->vdevfn), PCI_FUNC(pcidev->vdevfn));
     }
-    args = libxl__xs_kvs_of_flexarray(gc, parameters, parameters->count);
 
-    rc = qmp_synchronous_send(qmp, "device_add", &args,
+    rc = qmp_synchronous_send(qmp, "device_add", args,
                               NULL, NULL, qmp->timeout);
     if (rc == 0) {
         rc = qmp_synchronous_send(qmp, "query-pci", NULL,
@@ -843,19 +836,16 @@ int libxl__qmp_pci_add(libxl__gc *gc, in
 static int qmp_device_del(libxl__gc *gc, int domid, char *id)
 {
     libxl__qmp_handler *qmp = NULL;
-    flexarray_t *parameters = NULL;
-    libxl_key_value_list args = NULL;
+    libxl__json_object *args = NULL;
     int rc = 0;
 
     qmp = libxl__qmp_initialize(gc, domid);
     if (!qmp)
         return ERROR_FAIL;
 
-    parameters = flexarray_make(gc, 2, 1);
-    flexarray_append_pair(parameters, "id", id);
-    args = libxl__xs_kvs_of_flexarray(gc, parameters, parameters->count);
+    qmp_parameters_add_string(gc, &args, "id", id);
 
-    rc = qmp_synchronous_send(qmp, "device_del", &args,
+    rc = qmp_synchronous_send(qmp, "device_del", args,
                               NULL, NULL, qmp->timeout);
 
     libxl__qmp_close(qmp);
@@ -875,19 +865,16 @@ int libxl__qmp_pci_del(libxl__gc *gc, in
 int libxl__qmp_save(libxl__gc *gc, int domid, const char *filename)
 {
     libxl__qmp_handler *qmp = NULL;
-    flexarray_t *parameters = NULL;
-    libxl_key_value_list args = NULL;
+    libxl__json_object *args = NULL;
     int rc = 0;
 
     qmp = libxl__qmp_initialize(gc, domid);
     if (!qmp)
         return ERROR_FAIL;
 
-    parameters = flexarray_make(gc, 2, 1);
-    flexarray_append_pair(parameters, "filename", (char *)filename);
-    args = libxl__xs_kvs_of_flexarray(gc, parameters, parameters->count);
+    qmp_parameters_add_string(gc, &args, "filename", (char *)filename);
 
-    rc = qmp_synchronous_send(qmp, "xen-save-devices-state", &args,
+    rc = qmp_synchronous_send(qmp, "xen-save-devices-state", args,
                               NULL, NULL, qmp->timeout);
 
     libxl__qmp_close(qmp);
@@ -897,18 +884,16 @@ int libxl__qmp_save(libxl__gc *gc, int d
 static int qmp_change(libxl__gc *gc, libxl__qmp_handler *qmp,
                       char *device, char *target, char *arg)
 {
-    flexarray_t *parameters = NULL;
-    libxl_key_value_list args = NULL;
+    libxl__json_object *args = NULL;
     int rc = 0;
 
-    parameters = flexarray_make(gc, 6, 1);
-    flexarray_append_pair(parameters, "device", device);
-    flexarray_append_pair(parameters, "target", target);
-    if (arg)
-        flexarray_append_pair(parameters, "arg", arg);
-    args = libxl__xs_kvs_of_flexarray(gc, parameters, parameters->count);
+    qmp_parameters_add_string(gc, &args, "device", device);
+    qmp_parameters_add_string(gc, &args, "target", target);
+    if (arg) {
+        qmp_parameters_add_string(gc, &args, "arg", arg);
+    }
 
-    rc = qmp_synchronous_send(qmp, "change", &args,
+    rc = qmp_synchronous_send(qmp, "change", args,
                               NULL, NULL, qmp->timeout);
 
     return rc;

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

From xen-changelog-bounces@lists.xen.org Mon Oct 08 15:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Oct 2012 15: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 1TLFfr-0006aS-NW; Mon, 08 Oct 2012 15:55:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfq-0006ZL-4Z
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:18 +0000
Received: from [85.158.139.211:47815] by server-9.bemta-5.messagelabs.com id
	A3/66-14846-567F2705; Mon, 08 Oct 2012 15:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-206.messagelabs.com!1349711715!21533398!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28035 invoked from network); 8 Oct 2012 15:55:16 -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;
	8 Oct 2012 15:55:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfn-0007YR-Dl
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfn-0008MV-CB
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:15 +0000
Message-Id: <E1TLFfn-0008MV-CB@xenbits.xen.org>
Date: Mon, 08 Oct 2012 15:55:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl_dom: Call the right switch
	logdirty for the right DM.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Anthony PERARD <anthony.perard@citrix.com>
# Date 1349693136 -3600
# Node ID 08fac5c2bf3dcbc493ce45091383f6ce1938f369
# Parent  d4aec9eff7e6d15c2805957af620c82555553b3e
libxl_dom: Call the right switch logdirty for the right DM.

This patch dispatch the switch logdirty call depending on which device model
version is running.

The call to qemu-xen right now is synchronous, not like the one to
qemu-xen-traditional.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r d4aec9eff7e6 -r 08fac5c2bf3d tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c	Mon Oct 08 11:45:35 2012 +0100
+++ b/tools/libxl/libxl_dom.c	Mon Oct 08 11:45:36 2012 +0100
@@ -685,10 +685,10 @@ static void logdirty_init(libxl__logdirt
     libxl__ev_time_init(&lds->timeout);
 }
 
-void libxl__domain_suspend_common_switch_qemu_logdirty
-                               (int domid, unsigned enable, void *user)
+static void domain_suspend_switch_qemu_xen_traditional_logdirty
+                               (int domid, unsigned enable,
+                                libxl__save_helper_state *shs)
 {
-    libxl__save_helper_state *shs = user;
     libxl__egc *egc = shs->egc;
     libxl__domain_suspend_state *dss = CONTAINER_OF(shs, *dss, shs);
     libxl__logdirty_switch *lds = &dss->logdirty;
@@ -756,6 +756,45 @@ void libxl__domain_suspend_common_switch
     switch_logdirty_done(egc,dss,-1);
 }
 
+static void domain_suspend_switch_qemu_xen_logdirty
+                               (int domid, unsigned enable,
+                                libxl__save_helper_state *shs)
+{
+    libxl__egc *egc = shs->egc;
+    libxl__domain_suspend_state *dss = CONTAINER_OF(shs, *dss, shs);
+    STATE_AO_GC(dss->ao);
+    int rc;
+
+    rc = libxl__qmp_set_global_dirty_log(gc, domid, enable);
+    if (!rc) {
+        libxl__xc_domain_saverestore_async_callback_done(egc, shs, 0);
+    } else {
+        LOG(ERROR,"logdirty switch failed (rc=%d), aborting suspend",rc);
+        libxl__xc_domain_saverestore_async_callback_done(egc, shs, -1);
+    }
+}
+
+void libxl__domain_suspend_common_switch_qemu_logdirty
+                               (int domid, unsigned enable, void *user)
+{
+    libxl__save_helper_state *shs = user;
+    libxl__egc *egc = shs->egc;
+    libxl__domain_suspend_state *dss = CONTAINER_OF(shs, *dss, shs);
+    STATE_AO_GC(dss->ao);
+
+    switch (libxl__device_model_version_running(gc, domid)) {
+    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:
+        domain_suspend_switch_qemu_xen_traditional_logdirty(domid, enable, shs);
+        break;
+    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
+        domain_suspend_switch_qemu_xen_logdirty(domid, enable, shs);
+        break;
+    default:
+        LOG(ERROR,"logdirty switch failed"
+            ", no valid device model version found, aborting suspend");
+        libxl__xc_domain_saverestore_async_callback_done(egc, shs, -1);
+    }
+}
 static void switch_logdirty_timeout(libxl__egc *egc, libxl__ev_time *ev,
                                     const struct timeval *requested_abs)
 {

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

From xen-changelog-bounces@lists.xen.org Mon Oct 08 15:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Oct 2012 15: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 1TLFfr-0006aS-NW; Mon, 08 Oct 2012 15:55:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfq-0006ZL-4Z
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:18 +0000
Received: from [85.158.139.211:47815] by server-9.bemta-5.messagelabs.com id
	A3/66-14846-567F2705; Mon, 08 Oct 2012 15:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-206.messagelabs.com!1349711715!21533398!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28035 invoked from network); 8 Oct 2012 15:55:16 -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;
	8 Oct 2012 15:55:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfn-0007YR-Dl
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfn-0008MV-CB
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:15 +0000
Message-Id: <E1TLFfn-0008MV-CB@xenbits.xen.org>
Date: Mon, 08 Oct 2012 15:55:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl_dom: Call the right switch
	logdirty for the right DM.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Anthony PERARD <anthony.perard@citrix.com>
# Date 1349693136 -3600
# Node ID 08fac5c2bf3dcbc493ce45091383f6ce1938f369
# Parent  d4aec9eff7e6d15c2805957af620c82555553b3e
libxl_dom: Call the right switch logdirty for the right DM.

This patch dispatch the switch logdirty call depending on which device model
version is running.

The call to qemu-xen right now is synchronous, not like the one to
qemu-xen-traditional.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r d4aec9eff7e6 -r 08fac5c2bf3d tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c	Mon Oct 08 11:45:35 2012 +0100
+++ b/tools/libxl/libxl_dom.c	Mon Oct 08 11:45:36 2012 +0100
@@ -685,10 +685,10 @@ static void logdirty_init(libxl__logdirt
     libxl__ev_time_init(&lds->timeout);
 }
 
-void libxl__domain_suspend_common_switch_qemu_logdirty
-                               (int domid, unsigned enable, void *user)
+static void domain_suspend_switch_qemu_xen_traditional_logdirty
+                               (int domid, unsigned enable,
+                                libxl__save_helper_state *shs)
 {
-    libxl__save_helper_state *shs = user;
     libxl__egc *egc = shs->egc;
     libxl__domain_suspend_state *dss = CONTAINER_OF(shs, *dss, shs);
     libxl__logdirty_switch *lds = &dss->logdirty;
@@ -756,6 +756,45 @@ void libxl__domain_suspend_common_switch
     switch_logdirty_done(egc,dss,-1);
 }
 
+static void domain_suspend_switch_qemu_xen_logdirty
+                               (int domid, unsigned enable,
+                                libxl__save_helper_state *shs)
+{
+    libxl__egc *egc = shs->egc;
+    libxl__domain_suspend_state *dss = CONTAINER_OF(shs, *dss, shs);
+    STATE_AO_GC(dss->ao);
+    int rc;
+
+    rc = libxl__qmp_set_global_dirty_log(gc, domid, enable);
+    if (!rc) {
+        libxl__xc_domain_saverestore_async_callback_done(egc, shs, 0);
+    } else {
+        LOG(ERROR,"logdirty switch failed (rc=%d), aborting suspend",rc);
+        libxl__xc_domain_saverestore_async_callback_done(egc, shs, -1);
+    }
+}
+
+void libxl__domain_suspend_common_switch_qemu_logdirty
+                               (int domid, unsigned enable, void *user)
+{
+    libxl__save_helper_state *shs = user;
+    libxl__egc *egc = shs->egc;
+    libxl__domain_suspend_state *dss = CONTAINER_OF(shs, *dss, shs);
+    STATE_AO_GC(dss->ao);
+
+    switch (libxl__device_model_version_running(gc, domid)) {
+    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:
+        domain_suspend_switch_qemu_xen_traditional_logdirty(domid, enable, shs);
+        break;
+    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
+        domain_suspend_switch_qemu_xen_logdirty(domid, enable, shs);
+        break;
+    default:
+        LOG(ERROR,"logdirty switch failed"
+            ", no valid device model version found, aborting suspend");
+        libxl__xc_domain_saverestore_async_callback_done(egc, shs, -1);
+    }
+}
 static void switch_logdirty_timeout(libxl__egc *egc, libxl__ev_time *ev,
                                     const struct timeval *requested_abs)
 {

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

From xen-changelog-bounces@lists.xen.org Mon Oct 08 15:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Oct 2012 15: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 1TLFfr-0006aX-Po; Mon, 08 Oct 2012 15:55:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfq-0006Zo-JA
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:18 +0000
Received: from [85.158.138.51:59644] by server-9.bemta-3.messagelabs.com id
	AD/B1-20338-567F2705; Mon, 08 Oct 2012 15:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1349711714!33475833!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21321 invoked from network); 8 Oct 2012 15:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2012 15:55:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfm-0007YL-9e
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfl-0008M1-Uf
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:14 +0000
Message-Id: <E1TLFfl-0008M1-Uf@xenbits.xen.org>
Date: Mon, 08 Oct 2012 15:55:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl_qmp: Simplify run of single
	QMP commands.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Anthony PERARD <anthony.perard@citrix.com>
# Date 1349693134 -3600
# Node ID f3890916496445c97d6778d6c986b0270ff707f2
# Parent  be5d014f91dfbd67afacc3385c265243794a246f
libxl_qmp: Simplify run of single QMP commands.

This new function connects to QEMU, sends the command and disconnects.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r be5d014f91df -r f38909164964 tools/libxl/libxl_qmp.c
--- a/tools/libxl/libxl_qmp.c	Mon Oct 08 11:45:33 2012 +0100
+++ b/tools/libxl/libxl_qmp.c	Mon Oct 08 11:45:34 2012 +0100
@@ -797,6 +797,23 @@ out:
     return rc;
 }
 
+static int qmp_run_command(libxl__gc *gc, int domid,
+                           const char *cmd, libxl__json_object *args,
+                           qmp_callback_t callback, void *opaque)
+{
+    libxl__qmp_handler *qmp = NULL;
+    int rc = 0;
+
+    qmp = libxl__qmp_initialize(gc, domid);
+    if (!qmp)
+        return ERROR_FAIL;
+
+    rc = qmp_synchronous_send(qmp, cmd, args, callback, opaque, qmp->timeout);
+
+    libxl__qmp_close(qmp);
+    return rc;
+}
+
 int libxl__qmp_pci_add(libxl__gc *gc, int domid, libxl_device_pci *pcidev)
 {
     libxl__qmp_handler *qmp = NULL;
@@ -835,21 +852,10 @@ int libxl__qmp_pci_add(libxl__gc *gc, in
 
 static int qmp_device_del(libxl__gc *gc, int domid, char *id)
 {
-    libxl__qmp_handler *qmp = NULL;
     libxl__json_object *args = NULL;
-    int rc = 0;
-
-    qmp = libxl__qmp_initialize(gc, domid);
-    if (!qmp)
-        return ERROR_FAIL;
 
     qmp_parameters_add_string(gc, &args, "id", id);
-
-    rc = qmp_synchronous_send(qmp, "device_del", args,
-                              NULL, NULL, qmp->timeout);
-
-    libxl__qmp_close(qmp);
-    return rc;
+    return qmp_run_command(gc, domid, "device_del", args, NULL, NULL);
 }
 
 int libxl__qmp_pci_del(libxl__gc *gc, int domid, libxl_device_pci *pcidev)
@@ -864,21 +870,11 @@ int libxl__qmp_pci_del(libxl__gc *gc, in
 
 int libxl__qmp_save(libxl__gc *gc, int domid, const char *filename)
 {
-    libxl__qmp_handler *qmp = NULL;
     libxl__json_object *args = NULL;
-    int rc = 0;
-
-    qmp = libxl__qmp_initialize(gc, domid);
-    if (!qmp)
-        return ERROR_FAIL;
 
     qmp_parameters_add_string(gc, &args, "filename", (char *)filename);
-
-    rc = qmp_synchronous_send(qmp, "xen-save-devices-state", args,
-                              NULL, NULL, qmp->timeout);
-
-    libxl__qmp_close(qmp);
-    return rc;
+    return qmp_run_command(gc, domid, "xen-save-devices-state", args,
+                           NULL, NULL);
 }
 
 static int qmp_change(libxl__gc *gc, libxl__qmp_handler *qmp,
@@ -901,34 +897,12 @@ static int qmp_change(libxl__gc *gc, lib
 
 int libxl__qmp_stop(libxl__gc *gc, int domid)
 {
-    libxl__qmp_handler *qmp = NULL;
-    int rc = 0;
-
-    qmp = libxl__qmp_initialize(gc, domid);
-    if (!qmp)
-        return ERROR_FAIL;
-
-    rc = qmp_synchronous_send(qmp, "stop", NULL,
-                              NULL, NULL, qmp->timeout);
-
-    libxl__qmp_close(qmp);
-    return rc;
+    return qmp_run_command(gc, domid, "stop", NULL, NULL, NULL);
 }
 
 int libxl__qmp_resume(libxl__gc *gc, int domid)
 {
-    libxl__qmp_handler *qmp = NULL;
-    int rc = 0;
-
-    qmp = libxl__qmp_initialize(gc, domid);
-    if (!qmp)
-        return ERROR_FAIL;
-
-    rc = qmp_synchronous_send(qmp, "cont", NULL,
-                              NULL, NULL, qmp->timeout);
-
-    libxl__qmp_close(qmp);
-    return rc;
+    return qmp_run_command(gc, domid, "cont", NULL, NULL, NULL);
 }
 
 int libxl__qmp_initializations(libxl__gc *gc, uint32_t domid,

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

From xen-changelog-bounces@lists.xen.org Mon Oct 08 15:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Oct 2012 15: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 1TLFfr-0006aX-Po; Mon, 08 Oct 2012 15:55:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfq-0006Zo-JA
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:18 +0000
Received: from [85.158.138.51:59644] by server-9.bemta-3.messagelabs.com id
	AD/B1-20338-567F2705; Mon, 08 Oct 2012 15:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1349711714!33475833!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21321 invoked from network); 8 Oct 2012 15:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2012 15:55:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfm-0007YL-9e
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfl-0008M1-Uf
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:14 +0000
Message-Id: <E1TLFfl-0008M1-Uf@xenbits.xen.org>
Date: Mon, 08 Oct 2012 15:55:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl_qmp: Simplify run of single
	QMP commands.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Anthony PERARD <anthony.perard@citrix.com>
# Date 1349693134 -3600
# Node ID f3890916496445c97d6778d6c986b0270ff707f2
# Parent  be5d014f91dfbd67afacc3385c265243794a246f
libxl_qmp: Simplify run of single QMP commands.

This new function connects to QEMU, sends the command and disconnects.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r be5d014f91df -r f38909164964 tools/libxl/libxl_qmp.c
--- a/tools/libxl/libxl_qmp.c	Mon Oct 08 11:45:33 2012 +0100
+++ b/tools/libxl/libxl_qmp.c	Mon Oct 08 11:45:34 2012 +0100
@@ -797,6 +797,23 @@ out:
     return rc;
 }
 
+static int qmp_run_command(libxl__gc *gc, int domid,
+                           const char *cmd, libxl__json_object *args,
+                           qmp_callback_t callback, void *opaque)
+{
+    libxl__qmp_handler *qmp = NULL;
+    int rc = 0;
+
+    qmp = libxl__qmp_initialize(gc, domid);
+    if (!qmp)
+        return ERROR_FAIL;
+
+    rc = qmp_synchronous_send(qmp, cmd, args, callback, opaque, qmp->timeout);
+
+    libxl__qmp_close(qmp);
+    return rc;
+}
+
 int libxl__qmp_pci_add(libxl__gc *gc, int domid, libxl_device_pci *pcidev)
 {
     libxl__qmp_handler *qmp = NULL;
@@ -835,21 +852,10 @@ int libxl__qmp_pci_add(libxl__gc *gc, in
 
 static int qmp_device_del(libxl__gc *gc, int domid, char *id)
 {
-    libxl__qmp_handler *qmp = NULL;
     libxl__json_object *args = NULL;
-    int rc = 0;
-
-    qmp = libxl__qmp_initialize(gc, domid);
-    if (!qmp)
-        return ERROR_FAIL;
 
     qmp_parameters_add_string(gc, &args, "id", id);
-
-    rc = qmp_synchronous_send(qmp, "device_del", args,
-                              NULL, NULL, qmp->timeout);
-
-    libxl__qmp_close(qmp);
-    return rc;
+    return qmp_run_command(gc, domid, "device_del", args, NULL, NULL);
 }
 
 int libxl__qmp_pci_del(libxl__gc *gc, int domid, libxl_device_pci *pcidev)
@@ -864,21 +870,11 @@ int libxl__qmp_pci_del(libxl__gc *gc, in
 
 int libxl__qmp_save(libxl__gc *gc, int domid, const char *filename)
 {
-    libxl__qmp_handler *qmp = NULL;
     libxl__json_object *args = NULL;
-    int rc = 0;
-
-    qmp = libxl__qmp_initialize(gc, domid);
-    if (!qmp)
-        return ERROR_FAIL;
 
     qmp_parameters_add_string(gc, &args, "filename", (char *)filename);
-
-    rc = qmp_synchronous_send(qmp, "xen-save-devices-state", args,
-                              NULL, NULL, qmp->timeout);
-
-    libxl__qmp_close(qmp);
-    return rc;
+    return qmp_run_command(gc, domid, "xen-save-devices-state", args,
+                           NULL, NULL);
 }
 
 static int qmp_change(libxl__gc *gc, libxl__qmp_handler *qmp,
@@ -901,34 +897,12 @@ static int qmp_change(libxl__gc *gc, lib
 
 int libxl__qmp_stop(libxl__gc *gc, int domid)
 {
-    libxl__qmp_handler *qmp = NULL;
-    int rc = 0;
-
-    qmp = libxl__qmp_initialize(gc, domid);
-    if (!qmp)
-        return ERROR_FAIL;
-
-    rc = qmp_synchronous_send(qmp, "stop", NULL,
-                              NULL, NULL, qmp->timeout);
-
-    libxl__qmp_close(qmp);
-    return rc;
+    return qmp_run_command(gc, domid, "stop", NULL, NULL, NULL);
 }
 
 int libxl__qmp_resume(libxl__gc *gc, int domid)
 {
-    libxl__qmp_handler *qmp = NULL;
-    int rc = 0;
-
-    qmp = libxl__qmp_initialize(gc, domid);
-    if (!qmp)
-        return ERROR_FAIL;
-
-    rc = qmp_synchronous_send(qmp, "cont", NULL,
-                              NULL, NULL, qmp->timeout);
-
-    libxl__qmp_close(qmp);
-    return rc;
+    return qmp_run_command(gc, domid, "cont", NULL, NULL, NULL);
 }
 
 int libxl__qmp_initializations(libxl__gc *gc, uint32_t domid,

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

From xen-changelog-bounces@lists.xen.org Mon Oct 08 15:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Oct 2012 15: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 1TLFfu-0006be-0g; Mon, 08 Oct 2012 15:55:22 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfs-0006Z1-Dw
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-27.messagelabs.com!1349711713!10555161!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15385 invoked from network); 8 Oct 2012 15:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2012 15:55:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfk-0007YF-Sd
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfk-0008LX-Qo
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:12 +0000
Message-Id: <E1TLFfk-0008LX-Qo@xenbits.xen.org>
Date: Mon, 08 Oct 2012 15:55:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl_qmp: Introduces helpers to
	create an argument list.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Anthony PERARD <anthony.perard@citrix.com>
# Date 1349693132 -3600
# Node ID 6f7847729f0f42614de516d15257ede7243f995f
# Parent  74dee58cfc0d2d6594f388db3b4d2ce91d1bb204
libxl_qmp: Introduces helpers to create an argument list.

Those functions will be used to create a "list" of parameters that
contain more than just strings. This list is converted by qmp_send to
a string to be sent to QEMU.

Those functions will be used in the next two patches, so right now
there are not compiled.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 74dee58cfc0d -r 6f7847729f0f tools/libxl/libxl_qmp.c
--- a/tools/libxl/libxl_qmp.c	Mon Oct 08 11:45:32 2012 +0100
+++ b/tools/libxl/libxl_qmp.c	Mon Oct 08 11:45:32 2012 +0100
@@ -623,6 +623,57 @@ static void qmp_free_handler(libxl__qmp_
     free(qmp);
 }
 
+#if 0
+/*
+ * QMP Parameters Helpers
+ */
+static void qmp_parameters_common_add(libxl__gc *gc,
+                                      libxl__json_object **param,
+                                      const char *name,
+                                      libxl__json_object *obj)
+{
+    libxl__json_map_node *arg = NULL;
+
+    if (!*param) {
+        *param = libxl__json_object_alloc(gc, JSON_MAP);
+    }
+
+    arg = libxl__zalloc(gc, sizeof(*arg));
+
+    arg->map_key = libxl__strdup(gc, name);
+    arg->obj = obj;
+
+    flexarray_append((*param)->u.map, arg);
+}
+
+static void qmp_parameters_add_string(libxl__gc *gc,
+                                      libxl__json_object **param,
+                                      const char *name, const char *argument)
+{
+    libxl__json_object *obj;
+
+    obj = libxl__json_object_alloc(gc, JSON_STRING);
+    obj->u.string = libxl__strdup(gc, argument);
+
+    qmp_parameters_common_add(gc, param, name, obj);
+}
+
+static void qmp_parameters_add_bool(libxl__gc *gc,
+                                    libxl__json_object **param,
+                                    const char *name, bool b)
+{
+    libxl__json_object *obj;
+
+    obj = libxl__json_object_alloc(gc, JSON_BOOL);
+    obj->u.b = b;
+    qmp_parameters_common_add(gc, param, name, obj);
+}
+
+#define QMP_PARAMETERS_SPRINTF(args, name, format, ...) \
+    qmp_parameters_add_string(gc, args, name, \
+                              libxl__sprintf(gc, format, __VA_ARGS__))
+#endif
+
 /*
  * API
  */

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

From xen-changelog-bounces@lists.xen.org Mon Oct 08 15:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Oct 2012 15: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 1TLFfu-0006be-0g; Mon, 08 Oct 2012 15:55:22 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfs-0006Z1-Dw
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-27.messagelabs.com!1349711713!10555161!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15385 invoked from network); 8 Oct 2012 15:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2012 15:55:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfk-0007YF-Sd
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfk-0008LX-Qo
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:12 +0000
Message-Id: <E1TLFfk-0008LX-Qo@xenbits.xen.org>
Date: Mon, 08 Oct 2012 15:55:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl_qmp: Introduces helpers to
	create an argument list.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Anthony PERARD <anthony.perard@citrix.com>
# Date 1349693132 -3600
# Node ID 6f7847729f0f42614de516d15257ede7243f995f
# Parent  74dee58cfc0d2d6594f388db3b4d2ce91d1bb204
libxl_qmp: Introduces helpers to create an argument list.

Those functions will be used to create a "list" of parameters that
contain more than just strings. This list is converted by qmp_send to
a string to be sent to QEMU.

Those functions will be used in the next two patches, so right now
there are not compiled.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 74dee58cfc0d -r 6f7847729f0f tools/libxl/libxl_qmp.c
--- a/tools/libxl/libxl_qmp.c	Mon Oct 08 11:45:32 2012 +0100
+++ b/tools/libxl/libxl_qmp.c	Mon Oct 08 11:45:32 2012 +0100
@@ -623,6 +623,57 @@ static void qmp_free_handler(libxl__qmp_
     free(qmp);
 }
 
+#if 0
+/*
+ * QMP Parameters Helpers
+ */
+static void qmp_parameters_common_add(libxl__gc *gc,
+                                      libxl__json_object **param,
+                                      const char *name,
+                                      libxl__json_object *obj)
+{
+    libxl__json_map_node *arg = NULL;
+
+    if (!*param) {
+        *param = libxl__json_object_alloc(gc, JSON_MAP);
+    }
+
+    arg = libxl__zalloc(gc, sizeof(*arg));
+
+    arg->map_key = libxl__strdup(gc, name);
+    arg->obj = obj;
+
+    flexarray_append((*param)->u.map, arg);
+}
+
+static void qmp_parameters_add_string(libxl__gc *gc,
+                                      libxl__json_object **param,
+                                      const char *name, const char *argument)
+{
+    libxl__json_object *obj;
+
+    obj = libxl__json_object_alloc(gc, JSON_STRING);
+    obj->u.string = libxl__strdup(gc, argument);
+
+    qmp_parameters_common_add(gc, param, name, obj);
+}
+
+static void qmp_parameters_add_bool(libxl__gc *gc,
+                                    libxl__json_object **param,
+                                    const char *name, bool b)
+{
+    libxl__json_object *obj;
+
+    obj = libxl__json_object_alloc(gc, JSON_BOOL);
+    obj->u.b = b;
+    qmp_parameters_common_add(gc, param, name, obj);
+}
+
+#define QMP_PARAMETERS_SPRINTF(args, name, format, ...) \
+    qmp_parameters_add_string(gc, args, name, \
+                              libxl__sprintf(gc, format, __VA_ARGS__))
+#endif
+
 /*
  * API
  */

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

From xen-changelog-bounces@lists.xen.org Mon Oct 08 15:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Oct 2012 15: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 1TLFfu-0006bk-3h; Mon, 08 Oct 2012 15:55:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFft-0006aq-3i
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:21 +0000
Received: from [85.158.137.99:6807] by server-1.bemta-3.messagelabs.com id
	B9/A1-16425-867F2705; Mon, 08 Oct 2012 15:55:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-217.messagelabs.com!1349711715!17585579!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14633 invoked from network); 8 Oct 2012 15:55:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2012 15:55:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfn-0007YO-1p
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfm-0008MG-QT
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:14 +0000
Message-Id: <E1TLFfm-0008MG-QT@xenbits.xen.org>
Date: Mon, 08 Oct 2012 15:55:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl_qmp: Introduce
	libxl__qmp_set_global_dirty_log.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Anthony PERARD <anthony.perard@citrix.com>
# Date 1349693135 -3600
# Node ID d4aec9eff7e6d15c2805957af620c82555553b3e
# Parent  f3890916496445c97d6778d6c986b0270ff707f2
libxl_qmp: Introduce libxl__qmp_set_global_dirty_log.

This function will enable or disable the global dirty log on QEMU,
used during a migration.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r f38909164964 -r d4aec9eff7e6 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Mon Oct 08 11:45:34 2012 +0100
+++ b/tools/libxl/libxl_internal.h	Mon Oct 08 11:45:35 2012 +0100
@@ -1404,6 +1404,8 @@ _hidden int libxl__qmp_stop(libxl__gc *g
 _hidden int libxl__qmp_resume(libxl__gc *gc, int domid);
 /* Save current QEMU state into fd. */
 _hidden int libxl__qmp_save(libxl__gc *gc, int domid, const char *filename);
+/* Set dirty bitmap logging status */
+_hidden int libxl__qmp_set_global_dirty_log(libxl__gc *gc, int domid, bool enable);
 /* close and free the QMP handler */
 _hidden void libxl__qmp_close(libxl__qmp_handler *qmp);
 /* remove the socket file, if the file has already been removed,
diff -r f38909164964 -r d4aec9eff7e6 tools/libxl/libxl_qmp.c
--- a/tools/libxl/libxl_qmp.c	Mon Oct 08 11:45:34 2012 +0100
+++ b/tools/libxl/libxl_qmp.c	Mon Oct 08 11:45:35 2012 +0100
@@ -657,7 +657,6 @@ static void qmp_parameters_add_string(li
     qmp_parameters_common_add(gc, param, name, obj);
 }
 
-#if 0
 static void qmp_parameters_add_bool(libxl__gc *gc,
                                     libxl__json_object **param,
                                     const char *name, bool b)
@@ -668,7 +667,6 @@ static void qmp_parameters_add_bool(libx
     obj->u.b = b;
     qmp_parameters_common_add(gc, param, name, obj);
 }
-#endif
 
 #define QMP_PARAMETERS_SPRINTF(args, name, format, ...) \
     qmp_parameters_add_string(gc, args, name, \
@@ -905,6 +903,16 @@ int libxl__qmp_resume(libxl__gc *gc, int
     return qmp_run_command(gc, domid, "cont", NULL, NULL, NULL);
 }
 
+int libxl__qmp_set_global_dirty_log(libxl__gc *gc, int domid, bool enable)
+{
+    libxl__json_object *args = NULL;
+
+    qmp_parameters_add_bool(gc, &args, "enable", enable);
+
+    return qmp_run_command(gc, domid, "xen-set-global-dirty-log", args,
+                           NULL, NULL);
+}
+
 int libxl__qmp_initializations(libxl__gc *gc, uint32_t domid,
                                const libxl_domain_config *guest_config)
 {

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

From xen-changelog-bounces@lists.xen.org Mon Oct 08 15:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Oct 2012 15: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 1TLFft-0006bZ-Ul; Mon, 08 Oct 2012 15:55:21 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfs-0006Yy-6S
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-27.messagelabs.com!1349711712!11917743!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18025 invoked from network); 8 Oct 2012 15:55:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2012 15:55:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfk-0007YC-8p
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfk-0008LI-4m
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:12 +0000
Message-Id: <E1TLFfk-0008LI-4m@xenbits.xen.org>
Date: Mon, 08 Oct 2012 15:55:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl_json: Introduce
	libxl__json_object_to_yajl_gen.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Anthony PERARD <anthony.perard@citrix.com>
# Date 1349693132 -3600
# Node ID 74dee58cfc0d2d6594f388db3b4d2ce91d1bb204
# Parent  3f71aab0e2774ded0c5a03436c364fb031ba9aa0
libxl_json: Introduce libxl__json_object_to_yajl_gen.

This function converts a libxl__json_object to yajl by calling every
yajl_gen_* function on a preallocated yajl_gen hand.

This helps to integrate a json_object into an already existing
yajl_gen tree.

This function is used in a later patch.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc -- renamed local variable "index" to "idx" to avoid clash with
         index(3) function, highlighted by Wshadow ]
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 3f71aab0e277 -r 74dee58cfc0d tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Mon Oct 08 11:45:31 2012 +0100
+++ b/tools/libxl/libxl_internal.h	Mon Oct 08 11:45:32 2012 +0100
@@ -1543,6 +1543,9 @@ libxl__json_map_node *libxl__json_map_no
 _hidden const libxl__json_object *libxl__json_map_get(const char *key,
                                           const libxl__json_object *o,
                                           libxl__json_node_type expected_type);
+_hidden yajl_status libxl__json_object_to_yajl_gen(libxl__gc *gc_opt,
+                                                   yajl_gen hand,
+                                                   libxl__json_object *param);
 _hidden void libxl__json_object_free(libxl__gc *gc_opt,
                                      libxl__json_object *obj);
 
diff -r 3f71aab0e277 -r 74dee58cfc0d tools/libxl/libxl_json.c
--- a/tools/libxl/libxl_json.c	Mon Oct 08 11:45:31 2012 +0100
+++ b/tools/libxl/libxl_json.c	Mon Oct 08 11:45:32 2012 +0100
@@ -366,6 +366,67 @@ const libxl__json_object *libxl__json_ma
     return NULL;
 }
 
+yajl_status libxl__json_object_to_yajl_gen(libxl__gc *gc,
+                                           yajl_gen hand,
+                                           libxl__json_object *obj)
+{
+    int idx = 0;
+    yajl_status rc;
+
+    switch (obj->type) {
+    case JSON_NULL:
+        return yajl_gen_null(hand);
+    case JSON_BOOL:
+        return yajl_gen_bool(hand, obj->u.b);
+    case JSON_INTEGER:
+        return yajl_gen_integer(hand, obj->u.i);
+    case JSON_DOUBLE:
+        return yajl_gen_double(hand, obj->u.d);
+    case JSON_NUMBER:
+        return yajl_gen_number(hand, obj->u.string, strlen(obj->u.string));
+    case JSON_STRING:
+        return libxl__yajl_gen_asciiz(hand, obj->u.string);
+    case JSON_MAP: {
+        libxl__json_map_node *node = NULL;
+
+        rc = yajl_gen_map_open(hand);
+        if (rc != yajl_status_ok)
+            return rc;
+        for (idx = 0; idx < obj->u.map->count; idx++) {
+            if (flexarray_get(obj->u.map, idx, (void**)&node) != 0)
+                break;
+
+            rc = libxl__yajl_gen_asciiz(hand, node->map_key);
+            if (rc != yajl_status_ok)
+                return rc;
+            rc = libxl__json_object_to_yajl_gen(gc, hand, node->obj);
+            if (rc != yajl_status_ok)
+                return rc;
+        }
+        return yajl_gen_map_close(hand);
+    }
+    case JSON_ARRAY: {
+        libxl__json_object *node = NULL;
+
+        rc = yajl_gen_array_open(hand);
+        if (rc != yajl_status_ok)
+            return rc;
+        for (idx = 0; idx < obj->u.array->count; idx++) {
+            if (flexarray_get(obj->u.array, idx, (void**)&node) != 0)
+                break;
+            rc = libxl__json_object_to_yajl_gen(gc, hand, node);
+            if (rc != yajl_status_ok)
+                return rc;
+        }
+        return yajl_gen_array_close(hand);
+    }
+    case JSON_ANY:
+        /* JSON_ANY is not a valid value for obj->type. */
+        ;
+    }
+    abort();
+}
+
 
 /*
  * JSON callbacks

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

From xen-changelog-bounces@lists.xen.org Mon Oct 08 15:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Oct 2012 15: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 1TLFft-0006bZ-Ul; Mon, 08 Oct 2012 15:55:21 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfs-0006Yy-6S
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-27.messagelabs.com!1349711712!11917743!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18025 invoked from network); 8 Oct 2012 15:55:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2012 15:55:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfk-0007YC-8p
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfk-0008LI-4m
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:12 +0000
Message-Id: <E1TLFfk-0008LI-4m@xenbits.xen.org>
Date: Mon, 08 Oct 2012 15:55:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl_json: Introduce
	libxl__json_object_to_yajl_gen.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Anthony PERARD <anthony.perard@citrix.com>
# Date 1349693132 -3600
# Node ID 74dee58cfc0d2d6594f388db3b4d2ce91d1bb204
# Parent  3f71aab0e2774ded0c5a03436c364fb031ba9aa0
libxl_json: Introduce libxl__json_object_to_yajl_gen.

This function converts a libxl__json_object to yajl by calling every
yajl_gen_* function on a preallocated yajl_gen hand.

This helps to integrate a json_object into an already existing
yajl_gen tree.

This function is used in a later patch.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc -- renamed local variable "index" to "idx" to avoid clash with
         index(3) function, highlighted by Wshadow ]
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 3f71aab0e277 -r 74dee58cfc0d tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Mon Oct 08 11:45:31 2012 +0100
+++ b/tools/libxl/libxl_internal.h	Mon Oct 08 11:45:32 2012 +0100
@@ -1543,6 +1543,9 @@ libxl__json_map_node *libxl__json_map_no
 _hidden const libxl__json_object *libxl__json_map_get(const char *key,
                                           const libxl__json_object *o,
                                           libxl__json_node_type expected_type);
+_hidden yajl_status libxl__json_object_to_yajl_gen(libxl__gc *gc_opt,
+                                                   yajl_gen hand,
+                                                   libxl__json_object *param);
 _hidden void libxl__json_object_free(libxl__gc *gc_opt,
                                      libxl__json_object *obj);
 
diff -r 3f71aab0e277 -r 74dee58cfc0d tools/libxl/libxl_json.c
--- a/tools/libxl/libxl_json.c	Mon Oct 08 11:45:31 2012 +0100
+++ b/tools/libxl/libxl_json.c	Mon Oct 08 11:45:32 2012 +0100
@@ -366,6 +366,67 @@ const libxl__json_object *libxl__json_ma
     return NULL;
 }
 
+yajl_status libxl__json_object_to_yajl_gen(libxl__gc *gc,
+                                           yajl_gen hand,
+                                           libxl__json_object *obj)
+{
+    int idx = 0;
+    yajl_status rc;
+
+    switch (obj->type) {
+    case JSON_NULL:
+        return yajl_gen_null(hand);
+    case JSON_BOOL:
+        return yajl_gen_bool(hand, obj->u.b);
+    case JSON_INTEGER:
+        return yajl_gen_integer(hand, obj->u.i);
+    case JSON_DOUBLE:
+        return yajl_gen_double(hand, obj->u.d);
+    case JSON_NUMBER:
+        return yajl_gen_number(hand, obj->u.string, strlen(obj->u.string));
+    case JSON_STRING:
+        return libxl__yajl_gen_asciiz(hand, obj->u.string);
+    case JSON_MAP: {
+        libxl__json_map_node *node = NULL;
+
+        rc = yajl_gen_map_open(hand);
+        if (rc != yajl_status_ok)
+            return rc;
+        for (idx = 0; idx < obj->u.map->count; idx++) {
+            if (flexarray_get(obj->u.map, idx, (void**)&node) != 0)
+                break;
+
+            rc = libxl__yajl_gen_asciiz(hand, node->map_key);
+            if (rc != yajl_status_ok)
+                return rc;
+            rc = libxl__json_object_to_yajl_gen(gc, hand, node->obj);
+            if (rc != yajl_status_ok)
+                return rc;
+        }
+        return yajl_gen_map_close(hand);
+    }
+    case JSON_ARRAY: {
+        libxl__json_object *node = NULL;
+
+        rc = yajl_gen_array_open(hand);
+        if (rc != yajl_status_ok)
+            return rc;
+        for (idx = 0; idx < obj->u.array->count; idx++) {
+            if (flexarray_get(obj->u.array, idx, (void**)&node) != 0)
+                break;
+            rc = libxl__json_object_to_yajl_gen(gc, hand, node);
+            if (rc != yajl_status_ok)
+                return rc;
+        }
+        return yajl_gen_array_close(hand);
+    }
+    case JSON_ANY:
+        /* JSON_ANY is not a valid value for obj->type. */
+        ;
+    }
+    abort();
+}
+
 
 /*
  * JSON callbacks

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

From xen-changelog-bounces@lists.xen.org Mon Oct 08 15:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Oct 2012 15: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 1TLFfu-0006bk-3h; Mon, 08 Oct 2012 15:55:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFft-0006aq-3i
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:21 +0000
Received: from [85.158.137.99:6807] by server-1.bemta-3.messagelabs.com id
	B9/A1-16425-867F2705; Mon, 08 Oct 2012 15:55:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-217.messagelabs.com!1349711715!17585579!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14633 invoked from network); 8 Oct 2012 15:55:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2012 15:55:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfn-0007YO-1p
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfm-0008MG-QT
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:14 +0000
Message-Id: <E1TLFfm-0008MG-QT@xenbits.xen.org>
Date: Mon, 08 Oct 2012 15:55:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl_qmp: Introduce
	libxl__qmp_set_global_dirty_log.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Anthony PERARD <anthony.perard@citrix.com>
# Date 1349693135 -3600
# Node ID d4aec9eff7e6d15c2805957af620c82555553b3e
# Parent  f3890916496445c97d6778d6c986b0270ff707f2
libxl_qmp: Introduce libxl__qmp_set_global_dirty_log.

This function will enable or disable the global dirty log on QEMU,
used during a migration.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r f38909164964 -r d4aec9eff7e6 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Mon Oct 08 11:45:34 2012 +0100
+++ b/tools/libxl/libxl_internal.h	Mon Oct 08 11:45:35 2012 +0100
@@ -1404,6 +1404,8 @@ _hidden int libxl__qmp_stop(libxl__gc *g
 _hidden int libxl__qmp_resume(libxl__gc *gc, int domid);
 /* Save current QEMU state into fd. */
 _hidden int libxl__qmp_save(libxl__gc *gc, int domid, const char *filename);
+/* Set dirty bitmap logging status */
+_hidden int libxl__qmp_set_global_dirty_log(libxl__gc *gc, int domid, bool enable);
 /* close and free the QMP handler */
 _hidden void libxl__qmp_close(libxl__qmp_handler *qmp);
 /* remove the socket file, if the file has already been removed,
diff -r f38909164964 -r d4aec9eff7e6 tools/libxl/libxl_qmp.c
--- a/tools/libxl/libxl_qmp.c	Mon Oct 08 11:45:34 2012 +0100
+++ b/tools/libxl/libxl_qmp.c	Mon Oct 08 11:45:35 2012 +0100
@@ -657,7 +657,6 @@ static void qmp_parameters_add_string(li
     qmp_parameters_common_add(gc, param, name, obj);
 }
 
-#if 0
 static void qmp_parameters_add_bool(libxl__gc *gc,
                                     libxl__json_object **param,
                                     const char *name, bool b)
@@ -668,7 +667,6 @@ static void qmp_parameters_add_bool(libx
     obj->u.b = b;
     qmp_parameters_common_add(gc, param, name, obj);
 }
-#endif
 
 #define QMP_PARAMETERS_SPRINTF(args, name, format, ...) \
     qmp_parameters_add_string(gc, args, name, \
@@ -905,6 +903,16 @@ int libxl__qmp_resume(libxl__gc *gc, int
     return qmp_run_command(gc, domid, "cont", NULL, NULL, NULL);
 }
 
+int libxl__qmp_set_global_dirty_log(libxl__gc *gc, int domid, bool enable)
+{
+    libxl__json_object *args = NULL;
+
+    qmp_parameters_add_bool(gc, &args, "enable", enable);
+
+    return qmp_run_command(gc, domid, "xen-set-global-dirty-log", args,
+                           NULL, NULL);
+}
+
 int libxl__qmp_initializations(libxl__gc *gc, uint32_t domid,
                                const libxl_domain_config *guest_config)
 {

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

From xen-changelog-bounces@lists.xen.org Mon Oct 08 15:55:34 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Oct 2012 15: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 1TLFg4-0006fy-7F; Mon, 08 Oct 2012 15:55:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFg2-0006ew-8c
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:30 +0000
Received: from [85.158.138.51:43711] by server-13.bemta-3.messagelabs.com id
	81/75-28885-177F2705; Mon, 08 Oct 2012 15:55:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-174.messagelabs.com!1349711716!33040965!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8952 invoked from network); 8 Oct 2012 15:55:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2012 15:55:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfo-0007YU-2f
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfn-0008Mk-Ub
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:16 +0000
Message-Id: <E1TLFfn-0008Mk-Ub@xenbits.xen.org>
Date: Mon, 08 Oct 2012 15:55:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Allow migration with qemu-xen.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Anthony PERARD <anthony.perard@citrix.com>
# Date 1349693136 -3600
# Node ID 0995890022391682a2499a202c3c8608e1d3780a
# Parent  08fac5c2bf3dcbc493ce45091383f6ce1938f369
libxl: Allow migration with qemu-xen.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 08fac5c2bf3d -r 099589002239 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Mon Oct 08 11:45:36 2012 +0100
+++ b/tools/libxl/libxl.c	Mon Oct 08 11:45:36 2012 +0100
@@ -767,23 +767,6 @@ int libxl_domain_suspend(libxl_ctx *ctx,
         goto out_err;
     }
 
-    if (type == LIBXL_DOMAIN_TYPE_HVM && flags & LIBXL_SUSPEND_LIVE) {
-        switch (libxl__device_model_version_running(gc, domid)) {
-        case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
-            LOG(ERROR,
-                "cannot live migrate HVM domains with qemu-xen device-model");
-            rc = ERROR_FAIL;
-            goto out_err;
-        case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:
-            /* No problem */
-            break;
-        case -1:
-            rc = ERROR_FAIL;
-            goto out_err;
-        default: abort();
-        }
-    }
-
     libxl__domain_suspend_state *dss;
     GCNEW(dss);
 

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

From xen-changelog-bounces@lists.xen.org Mon Oct 08 15:55:34 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Oct 2012 15: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 1TLFg4-0006fy-7F; Mon, 08 Oct 2012 15:55:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFg2-0006ew-8c
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:30 +0000
Received: from [85.158.138.51:43711] by server-13.bemta-3.messagelabs.com id
	81/75-28885-177F2705; Mon, 08 Oct 2012 15:55:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-174.messagelabs.com!1349711716!33040965!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8952 invoked from network); 8 Oct 2012 15:55:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2012 15:55:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfo-0007YU-2f
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfn-0008Mk-Ub
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:16 +0000
Message-Id: <E1TLFfn-0008Mk-Ub@xenbits.xen.org>
Date: Mon, 08 Oct 2012 15:55:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Allow migration with qemu-xen.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Anthony PERARD <anthony.perard@citrix.com>
# Date 1349693136 -3600
# Node ID 0995890022391682a2499a202c3c8608e1d3780a
# Parent  08fac5c2bf3dcbc493ce45091383f6ce1938f369
libxl: Allow migration with qemu-xen.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 08fac5c2bf3d -r 099589002239 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Mon Oct 08 11:45:36 2012 +0100
+++ b/tools/libxl/libxl.c	Mon Oct 08 11:45:36 2012 +0100
@@ -767,23 +767,6 @@ int libxl_domain_suspend(libxl_ctx *ctx,
         goto out_err;
     }
 
-    if (type == LIBXL_DOMAIN_TYPE_HVM && flags & LIBXL_SUSPEND_LIVE) {
-        switch (libxl__device_model_version_running(gc, domid)) {
-        case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
-            LOG(ERROR,
-                "cannot live migrate HVM domains with qemu-xen device-model");
-            rc = ERROR_FAIL;
-            goto out_err;
-        case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:
-            /* No problem */
-            break;
-        case -1:
-            rc = ERROR_FAIL;
-            goto out_err;
-        default: abort();
-        }
-    }
-
     libxl__domain_suspend_state *dss;
     GCNEW(dss);
 

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

From xen-changelog-bounces@lists.xen.org Mon Oct 08 15:55:43 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Oct 2012 15:55:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TLFgE-0006k8-AL; Mon, 08 Oct 2012 15:55:42 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFgC-0006hS-To
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:41 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-27.messagelabs.com!1349711710!4585459!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18588 invoked from network); 8 Oct 2012 15:55:12 -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;
	8 Oct 2012 15:55:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfi-0007Y6-KE
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfi-0008Kl-IV
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:10 +0000
Message-Id: <E1TLFfi-0008Kl-IV@xenbits.xen.org>
Date: Mon, 08 Oct 2012 15:55:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl_json: Remove JSON_ERROR from
	enum.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Anthony PERARD <anthony.perard@citrix.com>
# Date 1349693130 -3600
# Node ID 4a6d5d8cba4fc44f9bbda201188885868604b8e8
# Parent  c9b80c7f8db1a5d26906a2298c481bf7e87fda94
libxl_json: Remove JSON_ERROR from enum.

This value from libxl__json_node_type is never used.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r c9b80c7f8db1 -r 4a6d5d8cba4f tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Mon Oct 08 11:45:29 2012 +0100
+++ b/tools/libxl/libxl_internal.h	Mon Oct 08 11:45:30 2012 +0100
@@ -1432,7 +1432,6 @@ _hidden yajl_gen_status libxl__yajl_gen_
 _hidden yajl_gen_status libxl__yajl_gen_enum(yajl_gen hand, const char *str);
 
 typedef enum {
-    JSON_ERROR,
     JSON_NULL,
     JSON_TRUE,
     JSON_FALSE,

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

From xen-changelog-bounces@lists.xen.org Mon Oct 08 15:55:43 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Oct 2012 15:55:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TLFgE-0006k8-AL; Mon, 08 Oct 2012 15:55:42 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFgC-0006hS-To
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:41 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-27.messagelabs.com!1349711710!4585459!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18588 invoked from network); 8 Oct 2012 15:55:12 -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;
	8 Oct 2012 15:55:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfi-0007Y6-KE
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TLFfi-0008Kl-IV
	for xen-changelog@lists.xensource.com; Mon, 08 Oct 2012 15:55:10 +0000
Message-Id: <E1TLFfi-0008Kl-IV@xenbits.xen.org>
Date: Mon, 08 Oct 2012 15:55:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl_json: Remove JSON_ERROR from
	enum.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Anthony PERARD <anthony.perard@citrix.com>
# Date 1349693130 -3600
# Node ID 4a6d5d8cba4fc44f9bbda201188885868604b8e8
# Parent  c9b80c7f8db1a5d26906a2298c481bf7e87fda94
libxl_json: Remove JSON_ERROR from enum.

This value from libxl__json_node_type is never used.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r c9b80c7f8db1 -r 4a6d5d8cba4f tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Mon Oct 08 11:45:29 2012 +0100
+++ b/tools/libxl/libxl_internal.h	Mon Oct 08 11:45:30 2012 +0100
@@ -1432,7 +1432,6 @@ _hidden yajl_gen_status libxl__yajl_gen_
 _hidden yajl_gen_status libxl__yajl_gen_enum(yajl_gen hand, const char *str);
 
 typedef enum {
-    JSON_ERROR,
     JSON_NULL,
     JSON_TRUE,
     JSON_FALSE,

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4Uk-0007kW-78; Wed, 10 Oct 2012 22:11:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ui-0007jz-Kb
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:12 +0000
Received: from [85.158.139.211:32530] by server-16.bemta-5.messagelabs.com id
	98/89-10155-F72F5705; Wed, 10 Oct 2012 22:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-206.messagelabs.com!1349907070!21892554!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21824 invoked from network); 10 Oct 2012 22:11:11 -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;
	10 Oct 2012 22:11:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uf-0005y9-Uk
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uf-0000Gf-LU
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:09 +0000
Message-Id: <E1TM4Uf-0000Gf-LU@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenballoond.init: remove 4 from
	default runlevel
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1349695111 -3600
# Node ID fe756682cc7f44a2471fdfdca96f1f8860f0bb73
# Parent  8b6870d686d64f5e5e023fc84ebf1e10e36be2d3
xenballoond.init: remove 4 from default runlevel

Remove 4 from default runlevel in xenballoond.init.

Similar to what changeset 24847:0900b1c905f1 does in xencommons, remove
runlevel 4 from the other runlevel scripts. LSB defines runlevel 4 as
reserved for local use, the local sysadmin is responsible for symlink
creation in rc4.d.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 8b6870d686d6 -r fe756682cc7f tools/xenballoon/xenballoond.init
--- a/tools/xenballoon/xenballoond.init	Mon Oct 08 12:18:30 2012 +0100
+++ b/tools/xenballoon/xenballoond.init	Mon Oct 08 12:18:31 2012 +0100
@@ -14,7 +14,7 @@
 # Should-Start:
 # Required-Stop:     $syslog $remote_fs
 # Should-Stop:
-# Default-Start:     3 4 5
+# Default-Start:     3 5
 # Default-Stop:      0 1 2 6
 # Short-Description: Start/stop xenballoond
 # Description:       Starts and stops the Xen ballooning daemon.

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4Uk-0007kW-78; Wed, 10 Oct 2012 22:11:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ui-0007jz-Kb
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:12 +0000
Received: from [85.158.139.211:32530] by server-16.bemta-5.messagelabs.com id
	98/89-10155-F72F5705; Wed, 10 Oct 2012 22:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-206.messagelabs.com!1349907070!21892554!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21824 invoked from network); 10 Oct 2012 22:11:11 -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;
	10 Oct 2012 22:11:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uf-0005y9-Uk
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uf-0000Gf-LU
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:09 +0000
Message-Id: <E1TM4Uf-0000Gf-LU@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenballoond.init: remove 4 from
	default runlevel
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1349695111 -3600
# Node ID fe756682cc7f44a2471fdfdca96f1f8860f0bb73
# Parent  8b6870d686d64f5e5e023fc84ebf1e10e36be2d3
xenballoond.init: remove 4 from default runlevel

Remove 4 from default runlevel in xenballoond.init.

Similar to what changeset 24847:0900b1c905f1 does in xencommons, remove
runlevel 4 from the other runlevel scripts. LSB defines runlevel 4 as
reserved for local use, the local sysadmin is responsible for symlink
creation in rc4.d.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 8b6870d686d6 -r fe756682cc7f tools/xenballoon/xenballoond.init
--- a/tools/xenballoon/xenballoond.init	Mon Oct 08 12:18:30 2012 +0100
+++ b/tools/xenballoon/xenballoond.init	Mon Oct 08 12:18:31 2012 +0100
@@ -14,7 +14,7 @@
 # Should-Start:
 # Required-Stop:     $syslog $remote_fs
 # Should-Stop:
-# Default-Start:     3 4 5
+# Default-Start:     3 5
 # Default-Stop:      0 1 2 6
 # Short-Description: Start/stop xenballoond
 # Description:       Starts and stops the Xen ballooning daemon.

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4Uk-0007kl-EF; Wed, 10 Oct 2012 22:11:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uj-0007kD-RM
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:14 +0000
Received: from [85.158.143.99:8705] by server-2.bemta-4.messagelabs.com id
	44/6D-25171-182F5705; Wed, 10 Oct 2012 22:11:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1349907071!26637900!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3334 invoked from network); 10 Oct 2012 22:11:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uh-0005yI-9J
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uh-0000HR-7N
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:11 +0000
Message-Id: <E1TM4Uh-0000HR-7N@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xend/pvscsi: update sysfs parser for
	Linux 3.0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1349695113 -3600
# Node ID cff10030c6ea920a20af07d674bed62ed644dc74
# Parent  2dbfa4d2e107f06e6be7b3fcdff8bee2cd642dc4
xend/pvscsi: update sysfs parser for Linux 3.0

The sysfs parser for /sys/bus/scsi/devices understands only the layout
of kernel version 2.6.16. This looks as follows:

/sys/bus/scsi/devices/1:0:0:0/block:sda is a symlink to /sys/block/sda/
/sys/bus/scsi/devices/1:0:0:0/scsi_generic:sg1 is a symlink to /sys/class/scsi_generic/sg1

Both directories contain a 'dev' file with the major:minor information.
This patch updates the used regex strings to match also the colon to
make it more robust against possible future changes.

In kernel version 3.0 the layout changed:
/sys/bus/scsi/devices/ contains now additional symlinks to directories
such as host1 and target1:0:0. This patch ignores these as they do not
point to the desired scsi devices. They just clutter the devices array.

The directory layout in '1:0:0:0' changed as well, the 'type:name'
notation was replaced with 'type/name' directories:

/sys/bus/scsi/devices/1:0:0:0/block/sda/
/sys/bus/scsi/devices/1:0:0:0/scsi_generic/sg1/

Both directories contain a 'dev' file with the major:minor information.
This patch adds additional code to walk the subdir to find the 'dev'
file to make sure the given subdirectory is really the kernel name.

In addition this patch makes sure devname is not None.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 2dbfa4d2e107 -r cff10030c6ea tools/python/xen/util/vscsi_util.py
--- a/tools/python/xen/util/vscsi_util.py	Mon Oct 08 12:18:32 2012 +0100
+++ b/tools/python/xen/util/vscsi_util.py	Mon Oct 08 12:18:33 2012 +0100
@@ -130,20 +130,36 @@ def _vscsi_get_scsidevices_by_sysfs():
 
     for dirpath, dirnames, files in os.walk(sysfs_mnt + SYSFS_SCSI_PATH):
         for hctl in dirnames:
+            if len(hctl.split(':')) != 4:
+                continue
             paths = os.path.join(dirpath, hctl)
             devname = None
             sg = None
             scsi_id = None
             for f in os.listdir(paths):
                 realpath = os.path.realpath(os.path.join(paths, f))
-                if  re.match('^block', f) or \
-                    re.match('^tape', f) or \
-                    re.match('^scsi_changer', f) or \
-                    re.match('^onstream_tape', f):
+                if  re.match('^block:', f) or \
+                    re.match('^tape:', f) or \
+                    re.match('^scsi_changer:', f) or \
+                    re.match('^onstream_tape:', f):
                     devname = os.path.basename(realpath)
+                elif f == "block" or \
+                     f == "tape" or \
+                     f == "scsi_changer" or \
+                     f == "onstream_tape":
+                    for dir in os.listdir(os.path.join(paths, f)):
+                        if os.path.exists(os.path.join(paths, f, dir, "dev")):
+                            devname = os.path.basename(dir)
 
-                if re.match('^scsi_generic', f):
+                if re.match('^scsi_generic:', f):
                     sg = os.path.basename(realpath)
+                elif f == "scsi_generic":
+                    for dir in os.listdir(os.path.join(paths, f)):
+                        if os.path.exists(os.path.join(paths, f, dir, "dev")):
+                            sg = os.path.basename(dir)
+                if sg:
+                    if devname is None:
+                        devname = sg
                     scsi_id = _vscsi_get_scsiid(sg)
             devices.append([hctl, devname, sg, scsi_id])
 

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4Uk-0007kl-EF; Wed, 10 Oct 2012 22:11:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uj-0007kD-RM
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:14 +0000
Received: from [85.158.143.99:8705] by server-2.bemta-4.messagelabs.com id
	44/6D-25171-182F5705; Wed, 10 Oct 2012 22:11:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1349907071!26637900!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3334 invoked from network); 10 Oct 2012 22:11:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uh-0005yI-9J
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uh-0000HR-7N
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:11 +0000
Message-Id: <E1TM4Uh-0000HR-7N@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xend/pvscsi: update sysfs parser for
	Linux 3.0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1349695113 -3600
# Node ID cff10030c6ea920a20af07d674bed62ed644dc74
# Parent  2dbfa4d2e107f06e6be7b3fcdff8bee2cd642dc4
xend/pvscsi: update sysfs parser for Linux 3.0

The sysfs parser for /sys/bus/scsi/devices understands only the layout
of kernel version 2.6.16. This looks as follows:

/sys/bus/scsi/devices/1:0:0:0/block:sda is a symlink to /sys/block/sda/
/sys/bus/scsi/devices/1:0:0:0/scsi_generic:sg1 is a symlink to /sys/class/scsi_generic/sg1

Both directories contain a 'dev' file with the major:minor information.
This patch updates the used regex strings to match also the colon to
make it more robust against possible future changes.

In kernel version 3.0 the layout changed:
/sys/bus/scsi/devices/ contains now additional symlinks to directories
such as host1 and target1:0:0. This patch ignores these as they do not
point to the desired scsi devices. They just clutter the devices array.

The directory layout in '1:0:0:0' changed as well, the 'type:name'
notation was replaced with 'type/name' directories:

/sys/bus/scsi/devices/1:0:0:0/block/sda/
/sys/bus/scsi/devices/1:0:0:0/scsi_generic/sg1/

Both directories contain a 'dev' file with the major:minor information.
This patch adds additional code to walk the subdir to find the 'dev'
file to make sure the given subdirectory is really the kernel name.

In addition this patch makes sure devname is not None.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 2dbfa4d2e107 -r cff10030c6ea tools/python/xen/util/vscsi_util.py
--- a/tools/python/xen/util/vscsi_util.py	Mon Oct 08 12:18:32 2012 +0100
+++ b/tools/python/xen/util/vscsi_util.py	Mon Oct 08 12:18:33 2012 +0100
@@ -130,20 +130,36 @@ def _vscsi_get_scsidevices_by_sysfs():
 
     for dirpath, dirnames, files in os.walk(sysfs_mnt + SYSFS_SCSI_PATH):
         for hctl in dirnames:
+            if len(hctl.split(':')) != 4:
+                continue
             paths = os.path.join(dirpath, hctl)
             devname = None
             sg = None
             scsi_id = None
             for f in os.listdir(paths):
                 realpath = os.path.realpath(os.path.join(paths, f))
-                if  re.match('^block', f) or \
-                    re.match('^tape', f) or \
-                    re.match('^scsi_changer', f) or \
-                    re.match('^onstream_tape', f):
+                if  re.match('^block:', f) or \
+                    re.match('^tape:', f) or \
+                    re.match('^scsi_changer:', f) or \
+                    re.match('^onstream_tape:', f):
                     devname = os.path.basename(realpath)
+                elif f == "block" or \
+                     f == "tape" or \
+                     f == "scsi_changer" or \
+                     f == "onstream_tape":
+                    for dir in os.listdir(os.path.join(paths, f)):
+                        if os.path.exists(os.path.join(paths, f, dir, "dev")):
+                            devname = os.path.basename(dir)
 
-                if re.match('^scsi_generic', f):
+                if re.match('^scsi_generic:', f):
                     sg = os.path.basename(realpath)
+                elif f == "scsi_generic":
+                    for dir in os.listdir(os.path.join(paths, f)):
+                        if os.path.exists(os.path.join(paths, f, dir, "dev")):
+                            sg = os.path.basename(dir)
+                if sg:
+                    if devname is None:
+                        devname = sg
                     scsi_id = _vscsi_get_scsiid(sg)
             devices.append([hctl, devname, sg, scsi_id])
 

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4Uk-0007kb-9d; Wed, 10 Oct 2012 22:11:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uj-0007k1-7L
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:13 +0000
Received: from [85.158.143.35:20226] by server-1.bemta-4.messagelabs.com id
	AB/26-19551-082F5705; Wed, 10 Oct 2012 22:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-21.messagelabs.com!1349907069!18271907!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27560 invoked from network); 10 Oct 2012 22:11:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uf-0005y6-8z
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uf-0000GQ-4W
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:09 +0000
Message-Id: <E1TM4Uf-0000GQ-4W@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hotplug/Linux: Remove tracing (bash
	-x) from network-nat script
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1349695110 -3600
# Node ID 8b6870d686d64f5e5e023fc84ebf1e10e36be2d3
# Parent  cdb48f1742f3274545fa377de1f592f04f2691da
hotplug/Linux: Remove tracing (bash -x) from network-nat script

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r cdb48f1742f3 -r 8b6870d686d6 tools/hotplug/Linux/network-nat
--- a/tools/hotplug/Linux/network-nat	Mon Oct 08 12:18:29 2012 +0100
+++ b/tools/hotplug/Linux/network-nat	Mon Oct 08 12:18:30 2012 +0100
@@ -1,4 +1,4 @@
-#!/bin/bash -x
+#!/bin/bash
 #============================================================================
 # Default Xen network start/stop script when using NAT.
 # Xend calls a network script when it starts.

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4Uj-0007k7-4e; Wed, 10 Oct 2012 22:11:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uh-0007ju-Ro
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:12 +0000
Received: from [85.158.139.83:12019] by server-11.bemta-5.messagelabs.com id
	2C/A7-15507-F72F5705; Wed, 10 Oct 2012 22:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-182.messagelabs.com!1349907069!20239358!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10460 invoked from network); 10 Oct 2012 22:11:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uf-0005y3-1Z
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ue-0000GB-Hs
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:08 +0000
Message-Id: <E1TM4Ue-0000GB-Hs@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] autoconf: add -Werror to libutil.h
	header 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

# HG changeset patch
# User Roger Pau Monne <roger.pau@citrix.com>
# Date 1349695109 -3600
# Node ID cdb48f1742f3274545fa377de1f592f04f2691da
# Parent  0995890022391682a2499a202c3c8608e1d3780a
autoconf: add -Werror to libutil.h header check

libutil.h is only needed on BSDs, but not in Linux. Debian package
libbsd-dev-0.3.0-1 installed a libutil.h overlay that contains a

Perform the libutil.h check with -Werror, so we don't include this
bogus header.

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


diff -r 099589002239 -r cdb48f1742f3 tools/configure
--- a/tools/configure	Mon Oct 08 11:45:36 2012 +0100
+++ b/tools/configure	Mon Oct 08 12:18:29 2012 +0100
@@ -6543,6 +6543,10 @@ fi
 
 
 
+
+    saved_CPPFLAGS="$CPPFLAGS"
+
+    CPPFLAGS="$CPPFLAGS -Werror"
     ac_fn_c_check_header_mongrel "$LINENO" "libutil.h" "ac_cv_header_libutil_h" "$ac_includes_default"
 if test "x$ac_cv_header_libutil_h" = x""yes; then :
 
@@ -6553,6 +6557,9 @@ if test "x$ac_cv_header_libutil_h" = x""
 fi
 
 
+
+    CPPFLAGS="$saved_CPPFLAGS"
+
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openpty et al" >&5
 $as_echo_n "checking for openpty et al... " >&6; }
 if test "${ax_cv_ptyfuncs_libs+set}" = set; then :
diff -r 099589002239 -r cdb48f1742f3 tools/m4/ptyfuncs.m4
--- a/tools/m4/ptyfuncs.m4	Mon Oct 08 11:45:36 2012 +0100
+++ b/tools/m4/ptyfuncs.m4	Mon Oct 08 12:18:29 2012 +0100
@@ -1,7 +1,14 @@
 AC_DEFUN([AX_CHECK_PTYFUNCS], [
+    dnl This is a workaround for a bug in Debian package
+    dnl libbsd-dev-0.3.0-1. Once we no longer support that
+    dnl package we can remove the addition of -Werror to
+    dnl CPPFLAGS.
+    AX_SAVEVAR_SAVE(CPPFLAGS)
+    CPPFLAGS="$CPPFLAGS -Werror"
     AC_CHECK_HEADER([libutil.h],[
       AC_DEFINE([INCLUDE_LIBUTIL_H],[<libutil.h>],[libutil header file name])
     ])
+    AX_SAVEVAR_RESTORE(CPPFLAGS)
     AC_CACHE_CHECK([for openpty et al], [ax_cv_ptyfuncs_libs], [
         for ax_cv_ptyfuncs_libs in -lutil "" NOT_FOUND; do
             if test "x$ax_cv_ptyfuncs_libs" = "xNOT_FOUND"; then

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4Uk-0007kb-9d; Wed, 10 Oct 2012 22:11:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uj-0007k1-7L
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:13 +0000
Received: from [85.158.143.35:20226] by server-1.bemta-4.messagelabs.com id
	AB/26-19551-082F5705; Wed, 10 Oct 2012 22:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-21.messagelabs.com!1349907069!18271907!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27560 invoked from network); 10 Oct 2012 22:11:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uf-0005y6-8z
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uf-0000GQ-4W
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:09 +0000
Message-Id: <E1TM4Uf-0000GQ-4W@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hotplug/Linux: Remove tracing (bash
	-x) from network-nat script
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1349695110 -3600
# Node ID 8b6870d686d64f5e5e023fc84ebf1e10e36be2d3
# Parent  cdb48f1742f3274545fa377de1f592f04f2691da
hotplug/Linux: Remove tracing (bash -x) from network-nat script

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r cdb48f1742f3 -r 8b6870d686d6 tools/hotplug/Linux/network-nat
--- a/tools/hotplug/Linux/network-nat	Mon Oct 08 12:18:29 2012 +0100
+++ b/tools/hotplug/Linux/network-nat	Mon Oct 08 12:18:30 2012 +0100
@@ -1,4 +1,4 @@
-#!/bin/bash -x
+#!/bin/bash
 #============================================================================
 # Default Xen network start/stop script when using NAT.
 # Xend calls a network script when it starts.

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4Uj-0007k7-4e; Wed, 10 Oct 2012 22:11:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uh-0007ju-Ro
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:12 +0000
Received: from [85.158.139.83:12019] by server-11.bemta-5.messagelabs.com id
	2C/A7-15507-F72F5705; Wed, 10 Oct 2012 22:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-182.messagelabs.com!1349907069!20239358!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10460 invoked from network); 10 Oct 2012 22:11:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uf-0005y3-1Z
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ue-0000GB-Hs
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:08 +0000
Message-Id: <E1TM4Ue-0000GB-Hs@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] autoconf: add -Werror to libutil.h
	header 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

# HG changeset patch
# User Roger Pau Monne <roger.pau@citrix.com>
# Date 1349695109 -3600
# Node ID cdb48f1742f3274545fa377de1f592f04f2691da
# Parent  0995890022391682a2499a202c3c8608e1d3780a
autoconf: add -Werror to libutil.h header check

libutil.h is only needed on BSDs, but not in Linux. Debian package
libbsd-dev-0.3.0-1 installed a libutil.h overlay that contains a

Perform the libutil.h check with -Werror, so we don't include this
bogus header.

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


diff -r 099589002239 -r cdb48f1742f3 tools/configure
--- a/tools/configure	Mon Oct 08 11:45:36 2012 +0100
+++ b/tools/configure	Mon Oct 08 12:18:29 2012 +0100
@@ -6543,6 +6543,10 @@ fi
 
 
 
+
+    saved_CPPFLAGS="$CPPFLAGS"
+
+    CPPFLAGS="$CPPFLAGS -Werror"
     ac_fn_c_check_header_mongrel "$LINENO" "libutil.h" "ac_cv_header_libutil_h" "$ac_includes_default"
 if test "x$ac_cv_header_libutil_h" = x""yes; then :
 
@@ -6553,6 +6557,9 @@ if test "x$ac_cv_header_libutil_h" = x""
 fi
 
 
+
+    CPPFLAGS="$saved_CPPFLAGS"
+
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openpty et al" >&5
 $as_echo_n "checking for openpty et al... " >&6; }
 if test "${ax_cv_ptyfuncs_libs+set}" = set; then :
diff -r 099589002239 -r cdb48f1742f3 tools/m4/ptyfuncs.m4
--- a/tools/m4/ptyfuncs.m4	Mon Oct 08 11:45:36 2012 +0100
+++ b/tools/m4/ptyfuncs.m4	Mon Oct 08 12:18:29 2012 +0100
@@ -1,7 +1,14 @@
 AC_DEFUN([AX_CHECK_PTYFUNCS], [
+    dnl This is a workaround for a bug in Debian package
+    dnl libbsd-dev-0.3.0-1. Once we no longer support that
+    dnl package we can remove the addition of -Werror to
+    dnl CPPFLAGS.
+    AX_SAVEVAR_SAVE(CPPFLAGS)
+    CPPFLAGS="$CPPFLAGS -Werror"
     AC_CHECK_HEADER([libutil.h],[
       AC_DEFINE([INCLUDE_LIBUTIL_H],[<libutil.h>],[libutil header file name])
     ])
+    AX_SAVEVAR_RESTORE(CPPFLAGS)
     AC_CACHE_CHECK([for openpty et al], [ax_cv_ptyfuncs_libs], [
         for ax_cv_ptyfuncs_libs in -lutil "" NOT_FOUND; do
             if test "x$ax_cv_ptyfuncs_libs" = "xNOT_FOUND"; then

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4Uk-0007kg-Bz; Wed, 10 Oct 2012 22:11:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uj-0007k6-CF
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:13 +0000
Received: from [85.158.139.211:58421] by server-3.bemta-5.messagelabs.com id
	FC/E2-09712-082F5705; Wed, 10 Oct 2012 22:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-206.messagelabs.com!1349907071!21832311!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19980 invoked from network); 10 Oct 2012 22:11:12 -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 2012 22:11:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ug-0005yC-H9
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ug-0000Gv-5z
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:10 +0000
Message-Id: <E1TM4Ug-0000Gv-5z@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xend/pvscsi: fix passing of SCSI
	control LUNs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1349695111 -3600
# Node ID eecb528583d7dc30db3801fac09c79434f7e7835
# Parent  fe756682cc7f44a2471fdfdca96f1f8860f0bb73
xend/pvscsi: fix passing of SCSI control LUNs

Currently pvscsi can not pass SCSI devices that have just a scsi_generic node.
In the following example sg3 is a control LUN for the disk sdd.
But vscsi=['4:0:2:0,0:0:0:0'] does not work because the internal 'devname'
variable remains None. Later writing p-devname to xenstore fails because None
is not a valid string variable.

Since devname is used for just informational purpose use sg also as devname.

carron:~ $ lsscsi -g
[0:0:0:0]    disk    ATA      FK0032CAAZP      HPF2  /dev/sda   /dev/sg0
[4:0:0:0]    disk    HP       P2000G3 FC/iSCSI T100  /dev/sdb   /dev/sg1
[4:0:1:0]    disk    HP       P2000G3 FC/iSCSI T100  /dev/sdc   /dev/sg2
[4:0:2:0]    storage HP       HSV400           0950  -         /dev/sg3
[4:0:2:1]    disk    HP       HSV400           0950  /dev/sdd   /dev/sg4
[4:0:3:0]    storage HP       HSV400           0950  -         /dev/sg5
[4:0:3:1]    disk    HP       HSV400           0950  /dev/sde   /dev/sg6

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r fe756682cc7f -r eecb528583d7 tools/python/xen/util/vscsi_util.py
--- a/tools/python/xen/util/vscsi_util.py	Mon Oct 08 12:18:31 2012 +0100
+++ b/tools/python/xen/util/vscsi_util.py	Mon Oct 08 12:18:31 2012 +0100
@@ -105,6 +105,8 @@ def _vscsi_get_scsidevices_by_lsscsi(opt
             devname = None
         try:
             sg = s[-1].split('/dev/')[1]
+            if devname is None:
+                devname = sg
             scsi_id = _vscsi_get_scsiid(sg)
         except IndexError:
             sg = None

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4Uk-0007kq-Gz; Wed, 10 Oct 2012 22:11:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uj-0007kC-Tz
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:14 +0000
Received: from [85.158.138.51:33547] by server-12.bemta-3.messagelabs.com id
	04/88-27853-182F5705; Wed, 10 Oct 2012 22:11:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-174.messagelabs.com!1349907071!25012860!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24980 invoked from network); 10 Oct 2012 22:11:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uh-0005yE-1K
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ug-0000HA-Mf
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:10 +0000
Message-Id: <E1TM4Ug-0000HA-Mf@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xend/pvscsi: fix usage of persistant
	device names for SCSI devices
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1349695112 -3600
# Node ID 2dbfa4d2e107f06e6be7b3fcdff8bee2cd642dc4
# Parent  eecb528583d7dc30db3801fac09c79434f7e7835
xend/pvscsi: fix usage of persistant device names for SCSI devices

Currently the callers of vscsi_get_scsidevices() do not pass a mask
string.  This will call "lsscsi -g '[]'", which causes a lsscsi syntax
error. As a result the sysfs parser _vscsi_get_scsidevices() is used.
But this parser is broken and the specified names in the config file are
not found.

Using a mask '*' if no mask was given will call lsscsi correctly and the
following config is parsed correctly:

vscsi=[
	'/dev/sg3, 0:0:0:0',
	'/dev/disk/by-id/wwn-0x600508b4000cf1c30000800000410000, 0:0:0:1'
]

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r eecb528583d7 -r 2dbfa4d2e107 tools/python/xen/util/vscsi_util.py
--- a/tools/python/xen/util/vscsi_util.py	Mon Oct 08 12:18:31 2012 +0100
+++ b/tools/python/xen/util/vscsi_util.py	Mon Oct 08 12:18:32 2012 +0100
@@ -150,7 +150,7 @@ def _vscsi_get_scsidevices_by_sysfs():
     return devices
 
 
-def vscsi_get_scsidevices(mask=""):
+def vscsi_get_scsidevices(mask="*"):
     """ get all scsi devices information """
 
     devices = _vscsi_get_scsidevices_by_lsscsi("[%s]" % mask)
@@ -279,7 +279,7 @@ def get_scsi_device(pHCTL):
             return _make_scsi_record(scsi_info)
     return None
 
-def get_all_scsi_devices(mask=""):
+def get_all_scsi_devices(mask="*"):
     scsi_records = []
     for scsi_info in vscsi_get_scsidevices(mask):
         scsi_record = _make_scsi_record(scsi_info)

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4Uk-0007kq-Gz; Wed, 10 Oct 2012 22:11:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uj-0007kC-Tz
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:14 +0000
Received: from [85.158.138.51:33547] by server-12.bemta-3.messagelabs.com id
	04/88-27853-182F5705; Wed, 10 Oct 2012 22:11:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-174.messagelabs.com!1349907071!25012860!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24980 invoked from network); 10 Oct 2012 22:11:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uh-0005yE-1K
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ug-0000HA-Mf
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:10 +0000
Message-Id: <E1TM4Ug-0000HA-Mf@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xend/pvscsi: fix usage of persistant
	device names for SCSI devices
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1349695112 -3600
# Node ID 2dbfa4d2e107f06e6be7b3fcdff8bee2cd642dc4
# Parent  eecb528583d7dc30db3801fac09c79434f7e7835
xend/pvscsi: fix usage of persistant device names for SCSI devices

Currently the callers of vscsi_get_scsidevices() do not pass a mask
string.  This will call "lsscsi -g '[]'", which causes a lsscsi syntax
error. As a result the sysfs parser _vscsi_get_scsidevices() is used.
But this parser is broken and the specified names in the config file are
not found.

Using a mask '*' if no mask was given will call lsscsi correctly and the
following config is parsed correctly:

vscsi=[
	'/dev/sg3, 0:0:0:0',
	'/dev/disk/by-id/wwn-0x600508b4000cf1c30000800000410000, 0:0:0:1'
]

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r eecb528583d7 -r 2dbfa4d2e107 tools/python/xen/util/vscsi_util.py
--- a/tools/python/xen/util/vscsi_util.py	Mon Oct 08 12:18:31 2012 +0100
+++ b/tools/python/xen/util/vscsi_util.py	Mon Oct 08 12:18:32 2012 +0100
@@ -150,7 +150,7 @@ def _vscsi_get_scsidevices_by_sysfs():
     return devices
 
 
-def vscsi_get_scsidevices(mask=""):
+def vscsi_get_scsidevices(mask="*"):
     """ get all scsi devices information """
 
     devices = _vscsi_get_scsidevices_by_lsscsi("[%s]" % mask)
@@ -279,7 +279,7 @@ def get_scsi_device(pHCTL):
             return _make_scsi_record(scsi_info)
     return None
 
-def get_all_scsi_devices(mask=""):
+def get_all_scsi_devices(mask="*"):
     scsi_records = []
     for scsi_info in vscsi_get_scsidevices(mask):
         scsi_record = _make_scsi_record(scsi_info)

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4Uk-0007kg-Bz; Wed, 10 Oct 2012 22:11:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uj-0007k6-CF
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:13 +0000
Received: from [85.158.139.211:58421] by server-3.bemta-5.messagelabs.com id
	FC/E2-09712-082F5705; Wed, 10 Oct 2012 22:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-206.messagelabs.com!1349907071!21832311!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19980 invoked from network); 10 Oct 2012 22:11:12 -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 2012 22:11:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ug-0005yC-H9
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ug-0000Gv-5z
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:10 +0000
Message-Id: <E1TM4Ug-0000Gv-5z@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xend/pvscsi: fix passing of SCSI
	control LUNs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1349695111 -3600
# Node ID eecb528583d7dc30db3801fac09c79434f7e7835
# Parent  fe756682cc7f44a2471fdfdca96f1f8860f0bb73
xend/pvscsi: fix passing of SCSI control LUNs

Currently pvscsi can not pass SCSI devices that have just a scsi_generic node.
In the following example sg3 is a control LUN for the disk sdd.
But vscsi=['4:0:2:0,0:0:0:0'] does not work because the internal 'devname'
variable remains None. Later writing p-devname to xenstore fails because None
is not a valid string variable.

Since devname is used for just informational purpose use sg also as devname.

carron:~ $ lsscsi -g
[0:0:0:0]    disk    ATA      FK0032CAAZP      HPF2  /dev/sda   /dev/sg0
[4:0:0:0]    disk    HP       P2000G3 FC/iSCSI T100  /dev/sdb   /dev/sg1
[4:0:1:0]    disk    HP       P2000G3 FC/iSCSI T100  /dev/sdc   /dev/sg2
[4:0:2:0]    storage HP       HSV400           0950  -         /dev/sg3
[4:0:2:1]    disk    HP       HSV400           0950  /dev/sdd   /dev/sg4
[4:0:3:0]    storage HP       HSV400           0950  -         /dev/sg5
[4:0:3:1]    disk    HP       HSV400           0950  /dev/sde   /dev/sg6

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r fe756682cc7f -r eecb528583d7 tools/python/xen/util/vscsi_util.py
--- a/tools/python/xen/util/vscsi_util.py	Mon Oct 08 12:18:31 2012 +0100
+++ b/tools/python/xen/util/vscsi_util.py	Mon Oct 08 12:18:31 2012 +0100
@@ -105,6 +105,8 @@ def _vscsi_get_scsidevices_by_lsscsi(opt
             devname = None
         try:
             sg = s[-1].split('/dev/')[1]
+            if devname is None:
+                devname = sg
             scsi_id = _vscsi_get_scsiid(sg)
         except IndexError:
             sg = None

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4Um-0007lQ-Ly; Wed, 10 Oct 2012 22:11:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ul-0007kD-Lm
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:15 +0000
Received: from [85.158.143.99:42826] by server-2.bemta-4.messagelabs.com id
	B7/6D-25171-382F5705; Wed, 10 Oct 2012 22:11:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-216.messagelabs.com!1349907073!27522425!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2945 invoked from network); 10 Oct 2012 22:11:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uj-0005yU-BW
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uj-0000IP-9w
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:13 +0000
Message-Id: <E1TM4Uj-0000IP-9w@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] minios: Add endian, byteswap,
	and wordsize macros to mini-os
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Matthew Fioravante <matthew.fioravante@jhuapl.edu>
# Date 1349703389 -3600
# Node ID 8fdb8d464eceaa3ae40000523b873c183c5a09d9
# Parent  a797d59e1d2981f892b5d07e8fe87ee27828c10c
minios: Add endian, byteswap, and wordsize macros to mini-os

This patch addes byte swapping macros and endian support to mini-os.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyons.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r a797d59e1d29 -r 8fdb8d464ece extras/mini-os/include/byteorder.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/mini-os/include/byteorder.h	Mon Oct 08 14:36:29 2012 +0100
@@ -0,0 +1,36 @@
+#ifndef MINIOS_BYTEORDER_H
+#define MINIOS_BYTEORDER_H
+
+#include <mini-os/byteswap.h>
+#include <mini-os/endian.h>
+
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+#define be16_to_cpu(v) bswap_16(v)
+#define be32_to_cpu(v) bswap_32(v)
+#define be64_to_cpu(v) bswap_64(v)
+
+#define le16_to_cpu(v) (v)
+#define le32_to_cpu(v) (v)
+#define le64_to_cpu(v) (v)
+
+#else /*__BIG_ENDIAN*/
+#define be16_to_cpu(v) (v)
+#define be32_to_cpu(v) (v)
+#define be64_to_cpu(v) (v)
+
+#define le16_to_cpu(v) bswap_16(v)
+#define le32_to_cpu(v) bswap_32(v)
+#define le64_to_cpu(v) bswap_64(v)
+
+#endif
+
+#define cpu_to_be16(v) be16_to_cpu(v)
+#define cpu_to_be32(v) be32_to_cpu(v)
+#define cpu_to_be64(v) be64_to_cpu(v)
+
+#define cpu_to_le16(v) le16_to_cpu(v)
+#define cpu_to_le32(v) le32_to_cpu(v)
+#define cpu_to_le64(v) le64_to_cpu(v)
+
+
+#endif
diff -r a797d59e1d29 -r 8fdb8d464ece extras/mini-os/include/byteswap.h
--- a/extras/mini-os/include/byteswap.h	Mon Oct 08 14:36:28 2012 +0100
+++ b/extras/mini-os/include/byteswap.h	Mon Oct 08 14:36:29 2012 +0100
@@ -4,30 +4,36 @@
 /* Unfortunately not provided by newlib.  */
 
 #include <mini-os/types.h>
-static inline uint16_t bswap_16(uint16_t x)
-{
-    return
-    ((((x) & 0xff00) >> 8) | (((x) & 0xff) << 8));
-}
 
-static inline uint32_t bswap_32(uint32_t x)
-{
-    return
-    ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >>  8) |
-     (((x) & 0x0000ff00) <<  8) | (((x) & 0x000000ff) << 24));
-}
+#define bswap_16(x) ((uint16_t)(                         \
+	         (((uint16_t)(x) & (uint16_t)0x00ffU) << 8) |                  \
+	         (((uint16_t)(x) & (uint16_t)0xff00U) >> 8)))
 
-static inline uint64_t bswap_64(uint64_t x)
-{
-    return
-    ((((x) & 0xff00000000000000ULL) >> 56) |
-     (((x) & 0x00ff000000000000ULL) >> 40) |
-     (((x) & 0x0000ff0000000000ULL) >> 24) |
-     (((x) & 0x000000ff00000000ULL) >>  8) |
-     (((x) & 0x00000000ff000000ULL) <<  8) |
-     (((x) & 0x0000000000ff0000ULL) << 24) |
-     (((x) & 0x000000000000ff00ULL) << 40) |
-     (((x) & 0x00000000000000ffULL) << 56));
-}
+/* Use gcc optimized versions if they exist */
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+#define bswap_32(v) __builtin_bswap32(v)
+#define bswap_64(v) __builtin_bswap64(v)
+#else
+
+#define bswap_32(x) ((uint32_t)(                         \
+	         (((uint32_t)(x) & (uint32_t)0x000000ffUL) << 24) |            \
+	         (((uint32_t)(x) & (uint32_t)0x0000ff00UL) <<  8) |            \
+	         (((uint32_t)(x) & (uint32_t)0x00ff0000UL) >>  8) |            \
+	         (((uint32_t)(x) & (uint32_t)0xff000000UL) >> 24)))
+
+#define bswap_64(x) ((uint64_t)(                         \
+	         (((uint64_t)(x) & (uint64_t)0x00000000000000ffULL) << 56) |   \
+	         (((uint64_t)(x) & (uint64_t)0x000000000000ff00ULL) << 40) |   \
+	         (((uint64_t)(x) & (uint64_t)0x0000000000ff0000ULL) << 24) |   \
+	         (((uint64_t)(x) & (uint64_t)0x00000000ff000000ULL) <<  8) |   \
+	         (((uint64_t)(x) & (uint64_t)0x000000ff00000000ULL) >>  8) |   \
+	         (((uint64_t)(x) & (uint64_t)0x0000ff0000000000ULL) >> 24) |   \
+	         (((uint64_t)(x) & (uint64_t)0x00ff000000000000ULL) >> 40) |   \
+	         (((uint64_t)(x) & (uint64_t)0xff00000000000000ULL) >> 56)))
+
+#endif
+
+
+
 
 #endif /* _BYTESWAP_H */
diff -r a797d59e1d29 -r 8fdb8d464ece extras/mini-os/include/endian.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/mini-os/include/endian.h	Mon Oct 08 14:36:29 2012 +0100
@@ -0,0 +1,15 @@
+#ifndef	_ENDIAN_H_
+#define	_ENDIAN_H_
+
+#define	__LITTLE_ENDIAN	1234
+#define	__BIG_ENDIAN	4321
+#define	__PDP_ENDIAN	3412
+
+#define ARCH_ENDIAN_H
+/* This will define __BYTE_ORDER for the current arch */
+#include <arch_endian.h>
+#undef ARCH_ENDIAN_H
+
+#include <arch_wordsize.h>
+
+#endif	/* endian.h */
diff -r a797d59e1d29 -r 8fdb8d464ece extras/mini-os/include/x86/arch_endian.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/mini-os/include/x86/arch_endian.h	Mon Oct 08 14:36:29 2012 +0100
@@ -0,0 +1,7 @@
+#ifndef	ARCH_ENDIAN_H
+#error "Do not include arch_endian by itself, include endian.h"
+#else
+
+#define __BYTE_ORDER __LITTLE_ENDIAN
+
+#endif
diff -r a797d59e1d29 -r 8fdb8d464ece extras/mini-os/include/x86/x86_32/arch_wordsize.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/mini-os/include/x86/x86_32/arch_wordsize.h	Mon Oct 08 14:36:29 2012 +0100
@@ -0,0 +1,1 @@
+#define __WORDSIZE 32
diff -r a797d59e1d29 -r 8fdb8d464ece extras/mini-os/include/x86/x86_64/arch_wordsize.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/mini-os/include/x86/x86_64/arch_wordsize.h	Mon Oct 08 14:36:29 2012 +0100
@@ -0,0 +1,2 @@
+#define __WORDSIZE 64
+#define __WORDSIZE_COMPAT32 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 10 22:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4Um-0007lQ-Ly; Wed, 10 Oct 2012 22:11:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ul-0007kD-Lm
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:15 +0000
Received: from [85.158.143.99:42826] by server-2.bemta-4.messagelabs.com id
	B7/6D-25171-382F5705; Wed, 10 Oct 2012 22:11:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-216.messagelabs.com!1349907073!27522425!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2945 invoked from network); 10 Oct 2012 22:11:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uj-0005yU-BW
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uj-0000IP-9w
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:13 +0000
Message-Id: <E1TM4Uj-0000IP-9w@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] minios: Add endian, byteswap,
	and wordsize macros to mini-os
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Matthew Fioravante <matthew.fioravante@jhuapl.edu>
# Date 1349703389 -3600
# Node ID 8fdb8d464eceaa3ae40000523b873c183c5a09d9
# Parent  a797d59e1d2981f892b5d07e8fe87ee27828c10c
minios: Add endian, byteswap, and wordsize macros to mini-os

This patch addes byte swapping macros and endian support to mini-os.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyons.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r a797d59e1d29 -r 8fdb8d464ece extras/mini-os/include/byteorder.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/mini-os/include/byteorder.h	Mon Oct 08 14:36:29 2012 +0100
@@ -0,0 +1,36 @@
+#ifndef MINIOS_BYTEORDER_H
+#define MINIOS_BYTEORDER_H
+
+#include <mini-os/byteswap.h>
+#include <mini-os/endian.h>
+
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+#define be16_to_cpu(v) bswap_16(v)
+#define be32_to_cpu(v) bswap_32(v)
+#define be64_to_cpu(v) bswap_64(v)
+
+#define le16_to_cpu(v) (v)
+#define le32_to_cpu(v) (v)
+#define le64_to_cpu(v) (v)
+
+#else /*__BIG_ENDIAN*/
+#define be16_to_cpu(v) (v)
+#define be32_to_cpu(v) (v)
+#define be64_to_cpu(v) (v)
+
+#define le16_to_cpu(v) bswap_16(v)
+#define le32_to_cpu(v) bswap_32(v)
+#define le64_to_cpu(v) bswap_64(v)
+
+#endif
+
+#define cpu_to_be16(v) be16_to_cpu(v)
+#define cpu_to_be32(v) be32_to_cpu(v)
+#define cpu_to_be64(v) be64_to_cpu(v)
+
+#define cpu_to_le16(v) le16_to_cpu(v)
+#define cpu_to_le32(v) le32_to_cpu(v)
+#define cpu_to_le64(v) le64_to_cpu(v)
+
+
+#endif
diff -r a797d59e1d29 -r 8fdb8d464ece extras/mini-os/include/byteswap.h
--- a/extras/mini-os/include/byteswap.h	Mon Oct 08 14:36:28 2012 +0100
+++ b/extras/mini-os/include/byteswap.h	Mon Oct 08 14:36:29 2012 +0100
@@ -4,30 +4,36 @@
 /* Unfortunately not provided by newlib.  */
 
 #include <mini-os/types.h>
-static inline uint16_t bswap_16(uint16_t x)
-{
-    return
-    ((((x) & 0xff00) >> 8) | (((x) & 0xff) << 8));
-}
 
-static inline uint32_t bswap_32(uint32_t x)
-{
-    return
-    ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >>  8) |
-     (((x) & 0x0000ff00) <<  8) | (((x) & 0x000000ff) << 24));
-}
+#define bswap_16(x) ((uint16_t)(                         \
+	         (((uint16_t)(x) & (uint16_t)0x00ffU) << 8) |                  \
+	         (((uint16_t)(x) & (uint16_t)0xff00U) >> 8)))
 
-static inline uint64_t bswap_64(uint64_t x)
-{
-    return
-    ((((x) & 0xff00000000000000ULL) >> 56) |
-     (((x) & 0x00ff000000000000ULL) >> 40) |
-     (((x) & 0x0000ff0000000000ULL) >> 24) |
-     (((x) & 0x000000ff00000000ULL) >>  8) |
-     (((x) & 0x00000000ff000000ULL) <<  8) |
-     (((x) & 0x0000000000ff0000ULL) << 24) |
-     (((x) & 0x000000000000ff00ULL) << 40) |
-     (((x) & 0x00000000000000ffULL) << 56));
-}
+/* Use gcc optimized versions if they exist */
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+#define bswap_32(v) __builtin_bswap32(v)
+#define bswap_64(v) __builtin_bswap64(v)
+#else
+
+#define bswap_32(x) ((uint32_t)(                         \
+	         (((uint32_t)(x) & (uint32_t)0x000000ffUL) << 24) |            \
+	         (((uint32_t)(x) & (uint32_t)0x0000ff00UL) <<  8) |            \
+	         (((uint32_t)(x) & (uint32_t)0x00ff0000UL) >>  8) |            \
+	         (((uint32_t)(x) & (uint32_t)0xff000000UL) >> 24)))
+
+#define bswap_64(x) ((uint64_t)(                         \
+	         (((uint64_t)(x) & (uint64_t)0x00000000000000ffULL) << 56) |   \
+	         (((uint64_t)(x) & (uint64_t)0x000000000000ff00ULL) << 40) |   \
+	         (((uint64_t)(x) & (uint64_t)0x0000000000ff0000ULL) << 24) |   \
+	         (((uint64_t)(x) & (uint64_t)0x00000000ff000000ULL) <<  8) |   \
+	         (((uint64_t)(x) & (uint64_t)0x000000ff00000000ULL) >>  8) |   \
+	         (((uint64_t)(x) & (uint64_t)0x0000ff0000000000ULL) >> 24) |   \
+	         (((uint64_t)(x) & (uint64_t)0x00ff000000000000ULL) >> 40) |   \
+	         (((uint64_t)(x) & (uint64_t)0xff00000000000000ULL) >> 56)))
+
+#endif
+
+
+
 
 #endif /* _BYTESWAP_H */
diff -r a797d59e1d29 -r 8fdb8d464ece extras/mini-os/include/endian.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/mini-os/include/endian.h	Mon Oct 08 14:36:29 2012 +0100
@@ -0,0 +1,15 @@
+#ifndef	_ENDIAN_H_
+#define	_ENDIAN_H_
+
+#define	__LITTLE_ENDIAN	1234
+#define	__BIG_ENDIAN	4321
+#define	__PDP_ENDIAN	3412
+
+#define ARCH_ENDIAN_H
+/* This will define __BYTE_ORDER for the current arch */
+#include <arch_endian.h>
+#undef ARCH_ENDIAN_H
+
+#include <arch_wordsize.h>
+
+#endif	/* endian.h */
diff -r a797d59e1d29 -r 8fdb8d464ece extras/mini-os/include/x86/arch_endian.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/mini-os/include/x86/arch_endian.h	Mon Oct 08 14:36:29 2012 +0100
@@ -0,0 +1,7 @@
+#ifndef	ARCH_ENDIAN_H
+#error "Do not include arch_endian by itself, include endian.h"
+#else
+
+#define __BYTE_ORDER __LITTLE_ENDIAN
+
+#endif
diff -r a797d59e1d29 -r 8fdb8d464ece extras/mini-os/include/x86/x86_32/arch_wordsize.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/mini-os/include/x86/x86_32/arch_wordsize.h	Mon Oct 08 14:36:29 2012 +0100
@@ -0,0 +1,1 @@
+#define __WORDSIZE 32
diff -r a797d59e1d29 -r 8fdb8d464ece extras/mini-os/include/x86/x86_64/arch_wordsize.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/mini-os/include/x86/x86_64/arch_wordsize.h	Mon Oct 08 14:36:29 2012 +0100
@@ -0,0 +1,2 @@
+#define __WORDSIZE 64
+#define __WORDSIZE_COMPAT32 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 10 22:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4Um-0007lJ-Jd; Wed, 10 Oct 2012 22:11:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uk-0007kD-Vy
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:15 +0000
Received: from [85.158.143.99:42819] by server-2.bemta-4.messagelabs.com id
	07/6D-25171-282F5705; Wed, 10 Oct 2012 22:11:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1349907072!26637903!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3351 invoked from network); 10 Oct 2012 22:11:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uh-0005yL-Va
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uh-0000Hg-O6
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:11 +0000
Message-Id: <E1TM4Uh-0000Hg-O6@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] stubdom: fix parallel build by
	expanding CROSS_MAKE
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1349695114 -3600
# Node ID b6fb4e63b946286fb5fcd1fd618d1a2e319ddeb7
# Parent  cff10030c6ea920a20af07d674bed62ed644dc74
stubdom: fix parallel build by expanding CROSS_MAKE

Recently I changed my rpm xen.spec file from doing
'make -C tools -j N && make stubdom' to 'make -j N stubdom' because
stubdom depends on tools, so both get built.
The result was the failure below.

....
mkdir -p grub-x86_64
CPPFLAGS="-isystem /home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/../extras/mini-os/include -D__MINIOS__ -DHAVE_LIBC -isystem /home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/../extras/mini-os/include/posix -isystem /home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/../tools/xenstore  -isystem /home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/../extras/mini-os/include/x86 -isystem /home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/../extras/mini-os/include/x86/x86_64 -U __linux__ -U __FreeBSD__ -U __sun__ -nostdinc -isystem /home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/../extras/mini-os/include/posix -isystem /home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/cross-root-x86_64/x86_64-xen-elf/include -isystem /usr/lib64/gcc/x86_64-suse-linux/4.7/include -isystem /home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/lwip-x86_64/src/include -isystem /home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/lwip-x86_64/src/include/ipv4 -I/home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/include -I/home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/../xen/include" CFLAGS="-mno-red-zone -O1 -fno-omit-frame-pointer  -m64 -mno-red-zone -fno-reorder-blocks -fno-asynchronous-unwind-tables -m64 -g -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wdeclaration-after-statement -Wno-unused-but-set-variable   -fno-stack-protector -fno-exceptions" make DESTDIR= -C grub OBJ_DIR=/home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/grub-x86_64
make[2]: Entering directory `/home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/grub'
make[2]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
make[2]: *** INTERNAL: readdir: Bad file descriptor
.  Stop.
make[2]: Makefile: Field 'stem' not cached: Makefile

make[2]: Leaving directory `/home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/grub'
make[1]: *** [grub] Error 2
[ -d mini-os-x86_64-xenstore ] || \
for i in $(cd /home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/../extras/mini-os ; find . -type d) ; do \
                mkdir -p mini-os-x86_64-xenstore/$i ; \
done
....

Expanding every occurrence of CROSS_MAKE avoids this error. It also has
the nice side effect of actually enabling parallel build for stubdom.
According to the GNU make documentation $(MAKE) gets its special meaning
only if it appears directly in the recipe:

http://www.gnu.org/software/make/manual/html_node/MAKE-Variable.html

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r cff10030c6ea -r b6fb4e63b946 stubdom/Makefile
--- a/stubdom/Makefile	Mon Oct 08 12:18:33 2012 +0100
+++ b/stubdom/Makefile	Mon Oct 08 12:18:34 2012 +0100
@@ -76,8 +76,6 @@ TARGET_LDFLAGS += -nostdlib -L$(CROSS_PR
 
 TARGETS=ioemu c caml grub xenstore
 
-CROSS_MAKE := $(MAKE) DESTDIR=
-
 .PHONY: all
 all: build
 ifeq ($(STUBDOM_SUPPORTED),1)
@@ -113,8 +111,8 @@ cross-newlib: $(NEWLIB_STAMPFILE)
 	mkdir -p newlib-$(XEN_TARGET_ARCH)
 	( cd newlib-$(XEN_TARGET_ARCH) && \
 	  CC_FOR_TARGET="$(CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(NEWLIB_CFLAGS)" AR_FOR_TARGET=$(AR) LD_FOR_TARGET=$(LD) RANLIB_FOR_TARGET=$(RANLIB) ../newlib-$(NEWLIB_VERSION)/configure --prefix=$(CROSS_PREFIX) --verbose --target=$(GNU_TARGET_ARCH)-xen-elf --enable-newlib-io-long-long --disable-multilib && \
-	  $(CROSS_MAKE) && \
-	  $(CROSS_MAKE) install )
+	  $(MAKE) DESTDIR= && \
+	  $(MAKE) DESTDIR= install )
 
 ############
 # Cross-zlib
@@ -133,8 +131,8 @@ cross-zlib: $(ZLIB_STAMPFILE)
 $(ZLIB_STAMPFILE): zlib-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE)
 	( cd $< && \
 	  CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" CC=$(CC) ./configure --prefix=$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf && \
-	  $(CROSS_MAKE) libz.a && \
-	  $(CROSS_MAKE) install )
+	  $(MAKE) DESTDIR= libz.a && \
+	  $(MAKE) DESTDIR= install )
 
 ##############
 # Cross-libpci
@@ -158,7 +156,7 @@ cross-libpci: $(LIBPCI_STAMPFILE)
 	  chmod u+w lib/config.h && \
 	  echo '#define PCILIB_VERSION "$(LIBPCI_VERSION)"' >> lib/config.h && \
 	  ln -sf ../../libpci.config.mak lib/config.mk && \
-	  $(CROSS_MAKE) CC="$(CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -I$(call realpath,$(MINI_OS)/include)" lib/libpci.a && \
+	  $(MAKE) DESTDIR= CC="$(CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -I$(call realpath,$(MINI_OS)/include)" lib/libpci.a && \
 	  $(INSTALL_DATA) lib/libpci.a $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib/ && \
 	  $(INSTALL_DIR) $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include/pci && \
 	  $(INSTALL_DATA) lib/config.h lib/header.h lib/pci.h lib/types.h $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include/pci/ \
@@ -203,8 +201,8 @@ cross-ocaml: $(OCAML_STAMPFILE)
 		-no-pthread -no-shared-libs -no-tk -no-curses \
 		-cc "$(CC) -U_FORTIFY_SOURCE -fno-stack-protector -mno-red-zone"
 	$(foreach i,$(MINIOS_HASNOT),sed -i 's,^\(#define HAS_$(i)\),//\1,' ocaml-$(XEN_TARGET_ARCH)/config/s.h ; )
-	$(CROSS_MAKE) -C ocaml-$(XEN_TARGET_ARCH) world
-	$(CROSS_MAKE) -C ocaml-$(XEN_TARGET_ARCH) opt
+	$(MAKE) DESTDIR= -C ocaml-$(XEN_TARGET_ARCH) world
+	$(MAKE) DESTDIR= -C ocaml-$(XEN_TARGET_ARCH) opt
 	$(MAKE) -C ocaml-$(XEN_TARGET_ARCH) install
 	touch $@
 
@@ -219,7 +217,7 @@ QEMU_ROOT := $(shell if [ -d "$(CONFIG_Q
 
 ifeq ($(QEMU_ROOT),.)
 $(XEN_ROOT)/tools/qemu-xen-traditional-dir:
-	$(CROSS_MAKE) -C $(XEN_ROOT)/tools qemu-xen-traditional-dir-find
+	$(MAKE) DESTDIR= -C $(XEN_ROOT)/tools qemu-xen-traditional-dir-find
 
 ioemu/linkfarm.stamp: $(XEN_ROOT)/tools/qemu-xen-traditional-dir
 	mkdir -p ioemu
@@ -250,7 +248,7 @@ mk-headers-$(XEN_TARGET_ARCH): ioemu/lin
           ( [ -h include/xen/libelf ] || ln -sf $(XEN_ROOT)/tools/include/xen/libelf include/xen/libelf ) && \
 	  mkdir -p include/xen-foreign && \
 	  ln -sf $(wildcard $(XEN_ROOT)/tools/include/xen-foreign/*) include/xen-foreign/ && \
-	  $(CROSS_MAKE) -C include/xen-foreign/ && \
+	  $(MAKE) DESTDIR= -C include/xen-foreign/ && \
 	  ( [ -h include/xen/foreign ] || ln -sf ../xen-foreign include/xen/foreign )
 	mkdir -p libxc-$(XEN_TARGET_ARCH)
 	[ -h libxc-$(XEN_TARGET_ARCH)/Makefile ] || ( cd libxc-$(XEN_TARGET_ARCH) && \
@@ -267,7 +265,7 @@ mk-headers-$(XEN_TARGET_ARCH): ioemu/lin
 	  ln -sf $(XEN_ROOT)/tools/xenstore/*.c . && \
 	  ln -sf $(XEN_ROOT)/tools/xenstore/*.h . && \
 	  ln -sf $(XEN_ROOT)/tools/xenstore/Makefile . )
-	$(CROSS_MAKE) -C $(MINI_OS) links
+	$(MAKE) DESTDIR= -C $(MINI_OS) links
 	touch mk-headers-$(XEN_TARGET_ARCH)
 
 TARGETS_MINIOS=$(addprefix mini-os-$(XEN_TARGET_ARCH)-,$(TARGETS))
@@ -284,7 +282,7 @@ TARGETS_MINIOS=$(addprefix mini-os-$(XEN
 .PHONY: libxc
 libxc: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a libxc-$(XEN_TARGET_ARCH)/libxenguest.a
 libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: cross-zlib
-	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(CROSS_MAKE) -C libxc-$(XEN_TARGET_ARCH)
+	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libxc-$(XEN_TARGET_ARCH)
 
  libxc-$(XEN_TARGET_ARCH)/libxenguest.a: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a
 
@@ -302,7 +300,7 @@ ioemu: cross-zlib cross-libpci libxc
 	    TARGET_CFLAGS="$(TARGET_CFLAGS)" \
 	    TARGET_LDFLAGS="$(TARGET_LDFLAGS)" \
 	    $(QEMU_ROOT)/xen-setup-stubdom )
-	$(CROSS_MAKE) -C ioemu -f $(QEMU_ROOT)/Makefile
+	$(MAKE) DESTDIR= -C ioemu -f $(QEMU_ROOT)/Makefile
 
 ######
 # caml
@@ -310,7 +308,7 @@ ioemu: cross-zlib cross-libpci libxc
 
 .PHONY: caml
 caml: $(CROSS_ROOT)
-	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(CROSS_MAKE) -C $@ LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) OCAMLC_CROSS_PREFIX=$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/bin/
+	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) OCAMLC_CROSS_PREFIX=$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/bin/
 
 ###
 # C
@@ -318,7 +316,7 @@ caml: $(CROSS_ROOT)
 
 .PHONY: c
 c: $(CROSS_ROOT)
-	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(CROSS_MAKE) -C $@ LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) 
+	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) 
 
 ######
 # Grub
@@ -337,7 +335,7 @@ grub-upstream: grub-$(GRUB_VERSION).tar.
 .PHONY: grub
 grub: grub-upstream $(CROSS_ROOT)
 	mkdir -p grub-$(XEN_TARGET_ARCH)
-	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(CROSS_MAKE) -C $@ OBJ_DIR=$(CURDIR)/grub-$(XEN_TARGET_ARCH)
+	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ OBJ_DIR=$(CURDIR)/grub-$(XEN_TARGET_ARCH)
 
 ##########
 # xenstore
@@ -345,7 +343,7 @@ grub: grub-upstream $(CROSS_ROOT)
 
 .PHONY: xenstore
 xenstore: $(CROSS_ROOT)
-	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(CROSS_MAKE) -C $@ xenstored.a CONFIG_STUBDOM=y
+	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ xenstored.a CONFIG_STUBDOM=y
 
 ########
 # minios
@@ -354,23 +352,23 @@ xenstore: $(CROSS_ROOT)
 .PHONY: ioemu-stubdom
 ioemu-stubdom: APP_OBJS=$(CURDIR)/ioemu/i386-stubdom/qemu.a $(CURDIR)/ioemu/i386-stubdom/libqemu.a $(CURDIR)/ioemu/libqemu_common.a
 ioemu-stubdom: mini-os-$(XEN_TARGET_ARCH)-ioemu lwip-$(XEN_TARGET_ARCH) libxc ioemu
-	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/ioemu-minios.cfg" $(CROSS_MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) APP_OBJS="$(APP_OBJS)"
+	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/ioemu-minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) APP_OBJS="$(APP_OBJS)"
 
 .PHONY: caml-stubdom
 caml-stubdom: mini-os-$(XEN_TARGET_ARCH)-caml lwip-$(XEN_TARGET_ARCH) libxc cross-ocaml caml
-	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/caml/minios.cfg" $(CROSS_MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) APP_OBJS="$(CURDIR)/caml/main-caml.o $(CURDIR)/caml/caml.o $(CAMLLIB)/libasmrun.a"
+	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/caml/minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) APP_OBJS="$(CURDIR)/caml/main-caml.o $(CURDIR)/caml/caml.o $(CAMLLIB)/libasmrun.a"
 
 .PHONY: c-stubdom
 c-stubdom: mini-os-$(XEN_TARGET_ARCH)-c lwip-$(XEN_TARGET_ARCH) libxc c
-	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/c/minios.cfg" $(CROSS_MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) APP_OBJS=$(CURDIR)/c/main.a
+	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/c/minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) APP_OBJS=$(CURDIR)/c/main.a
 
 .PHONY: pv-grub
 pv-grub: mini-os-$(XEN_TARGET_ARCH)-grub libxc grub
-	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/grub/minios.cfg" $(CROSS_MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS=$(CURDIR)/grub-$(XEN_TARGET_ARCH)/main.a
+	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/grub/minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS=$(CURDIR)/grub-$(XEN_TARGET_ARCH)/main.a
 
 .PHONY: xenstore-stubdom
 xenstore-stubdom: mini-os-$(XEN_TARGET_ARCH)-xenstore libxc xenstore
-	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/xenstore-minios.cfg" $(CROSS_MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS=$(CURDIR)/xenstore/xenstored.a
+	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/xenstore-minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS=$(CURDIR)/xenstore/xenstored.a
 
 #########
 # install
@@ -412,13 +410,13 @@ clean:
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-caml
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-grub
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-xenstore
-	$(CROSS_MAKE) -C caml clean
-	$(CROSS_MAKE) -C c clean
+	$(MAKE) DESTDIR= -C caml clean
+	$(MAKE) DESTDIR= -C c clean
 	rm -fr grub-$(XEN_TARGET_ARCH)
 	rm -f $(STUBDOMPATH)
-	[ ! -d libxc-$(XEN_TARGET_ARCH) ] || $(CROSS_MAKE) -C libxc-$(XEN_TARGET_ARCH) clean
-	-[ ! -d ioemu ] || $(CROSS_MAKE) -C ioemu clean
-	-[ ! -d xenstore ] || $(CROSS_MAKE) -C xenstore clean
+	[ ! -d libxc-$(XEN_TARGET_ARCH) ] || $(MAKE) DESTDIR= -C libxc-$(XEN_TARGET_ARCH) clean
+	-[ ! -d ioemu ] || $(MAKE) DESTDIR= -C ioemu clean
+	-[ ! -d xenstore ] || $(MAKE) DESTDIR= -C xenstore clean
 
 # clean the cross-compilation result
 .PHONY: crossclean

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4Um-0007lJ-Jd; Wed, 10 Oct 2012 22:11:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uk-0007kD-Vy
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:15 +0000
Received: from [85.158.143.99:42819] by server-2.bemta-4.messagelabs.com id
	07/6D-25171-282F5705; Wed, 10 Oct 2012 22:11:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1349907072!26637903!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3351 invoked from network); 10 Oct 2012 22:11:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uh-0005yL-Va
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uh-0000Hg-O6
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:11 +0000
Message-Id: <E1TM4Uh-0000Hg-O6@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] stubdom: fix parallel build by
	expanding CROSS_MAKE
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1349695114 -3600
# Node ID b6fb4e63b946286fb5fcd1fd618d1a2e319ddeb7
# Parent  cff10030c6ea920a20af07d674bed62ed644dc74
stubdom: fix parallel build by expanding CROSS_MAKE

Recently I changed my rpm xen.spec file from doing
'make -C tools -j N && make stubdom' to 'make -j N stubdom' because
stubdom depends on tools, so both get built.
The result was the failure below.

....
mkdir -p grub-x86_64
CPPFLAGS="-isystem /home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/../extras/mini-os/include -D__MINIOS__ -DHAVE_LIBC -isystem /home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/../extras/mini-os/include/posix -isystem /home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/../tools/xenstore  -isystem /home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/../extras/mini-os/include/x86 -isystem /home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/../extras/mini-os/include/x86/x86_64 -U __linux__ -U __FreeBSD__ -U __sun__ -nostdinc -isystem /home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/../extras/mini-os/include/posix -isystem /home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/cross-root-x86_64/x86_64-xen-elf/include -isystem /usr/lib64/gcc/x86_64-suse-linux/4.7/include -isystem /home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/lwip-x86_64/src/include -isystem /home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/lwip-x86_64/src/include/ipv4 -I/home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/include -I/home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/../xen/include" CFLAGS="-mno-red-zone -O1 -fno-omit-frame-pointer  -m64 -mno-red-zone -fno-reorder-blocks -fno-asynchronous-unwind-tables -m64 -g -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wdeclaration-after-statement -Wno-unused-but-set-variable   -fno-stack-protector -fno-exceptions" make DESTDIR= -C grub OBJ_DIR=/home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/grub-x86_64
make[2]: Entering directory `/home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/grub'
make[2]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
make[2]: *** INTERNAL: readdir: Bad file descriptor
.  Stop.
make[2]: Makefile: Field 'stem' not cached: Makefile

make[2]: Leaving directory `/home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/grub'
make[1]: *** [grub] Error 2
[ -d mini-os-x86_64-xenstore ] || \
for i in $(cd /home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/../extras/mini-os ; find . -type d) ; do \
                mkdir -p mini-os-x86_64-xenstore/$i ; \
done
....

Expanding every occurrence of CROSS_MAKE avoids this error. It also has
the nice side effect of actually enabling parallel build for stubdom.
According to the GNU make documentation $(MAKE) gets its special meaning
only if it appears directly in the recipe:

http://www.gnu.org/software/make/manual/html_node/MAKE-Variable.html

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r cff10030c6ea -r b6fb4e63b946 stubdom/Makefile
--- a/stubdom/Makefile	Mon Oct 08 12:18:33 2012 +0100
+++ b/stubdom/Makefile	Mon Oct 08 12:18:34 2012 +0100
@@ -76,8 +76,6 @@ TARGET_LDFLAGS += -nostdlib -L$(CROSS_PR
 
 TARGETS=ioemu c caml grub xenstore
 
-CROSS_MAKE := $(MAKE) DESTDIR=
-
 .PHONY: all
 all: build
 ifeq ($(STUBDOM_SUPPORTED),1)
@@ -113,8 +111,8 @@ cross-newlib: $(NEWLIB_STAMPFILE)
 	mkdir -p newlib-$(XEN_TARGET_ARCH)
 	( cd newlib-$(XEN_TARGET_ARCH) && \
 	  CC_FOR_TARGET="$(CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(NEWLIB_CFLAGS)" AR_FOR_TARGET=$(AR) LD_FOR_TARGET=$(LD) RANLIB_FOR_TARGET=$(RANLIB) ../newlib-$(NEWLIB_VERSION)/configure --prefix=$(CROSS_PREFIX) --verbose --target=$(GNU_TARGET_ARCH)-xen-elf --enable-newlib-io-long-long --disable-multilib && \
-	  $(CROSS_MAKE) && \
-	  $(CROSS_MAKE) install )
+	  $(MAKE) DESTDIR= && \
+	  $(MAKE) DESTDIR= install )
 
 ############
 # Cross-zlib
@@ -133,8 +131,8 @@ cross-zlib: $(ZLIB_STAMPFILE)
 $(ZLIB_STAMPFILE): zlib-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE)
 	( cd $< && \
 	  CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" CC=$(CC) ./configure --prefix=$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf && \
-	  $(CROSS_MAKE) libz.a && \
-	  $(CROSS_MAKE) install )
+	  $(MAKE) DESTDIR= libz.a && \
+	  $(MAKE) DESTDIR= install )
 
 ##############
 # Cross-libpci
@@ -158,7 +156,7 @@ cross-libpci: $(LIBPCI_STAMPFILE)
 	  chmod u+w lib/config.h && \
 	  echo '#define PCILIB_VERSION "$(LIBPCI_VERSION)"' >> lib/config.h && \
 	  ln -sf ../../libpci.config.mak lib/config.mk && \
-	  $(CROSS_MAKE) CC="$(CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -I$(call realpath,$(MINI_OS)/include)" lib/libpci.a && \
+	  $(MAKE) DESTDIR= CC="$(CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -I$(call realpath,$(MINI_OS)/include)" lib/libpci.a && \
 	  $(INSTALL_DATA) lib/libpci.a $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib/ && \
 	  $(INSTALL_DIR) $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include/pci && \
 	  $(INSTALL_DATA) lib/config.h lib/header.h lib/pci.h lib/types.h $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include/pci/ \
@@ -203,8 +201,8 @@ cross-ocaml: $(OCAML_STAMPFILE)
 		-no-pthread -no-shared-libs -no-tk -no-curses \
 		-cc "$(CC) -U_FORTIFY_SOURCE -fno-stack-protector -mno-red-zone"
 	$(foreach i,$(MINIOS_HASNOT),sed -i 's,^\(#define HAS_$(i)\),//\1,' ocaml-$(XEN_TARGET_ARCH)/config/s.h ; )
-	$(CROSS_MAKE) -C ocaml-$(XEN_TARGET_ARCH) world
-	$(CROSS_MAKE) -C ocaml-$(XEN_TARGET_ARCH) opt
+	$(MAKE) DESTDIR= -C ocaml-$(XEN_TARGET_ARCH) world
+	$(MAKE) DESTDIR= -C ocaml-$(XEN_TARGET_ARCH) opt
 	$(MAKE) -C ocaml-$(XEN_TARGET_ARCH) install
 	touch $@
 
@@ -219,7 +217,7 @@ QEMU_ROOT := $(shell if [ -d "$(CONFIG_Q
 
 ifeq ($(QEMU_ROOT),.)
 $(XEN_ROOT)/tools/qemu-xen-traditional-dir:
-	$(CROSS_MAKE) -C $(XEN_ROOT)/tools qemu-xen-traditional-dir-find
+	$(MAKE) DESTDIR= -C $(XEN_ROOT)/tools qemu-xen-traditional-dir-find
 
 ioemu/linkfarm.stamp: $(XEN_ROOT)/tools/qemu-xen-traditional-dir
 	mkdir -p ioemu
@@ -250,7 +248,7 @@ mk-headers-$(XEN_TARGET_ARCH): ioemu/lin
           ( [ -h include/xen/libelf ] || ln -sf $(XEN_ROOT)/tools/include/xen/libelf include/xen/libelf ) && \
 	  mkdir -p include/xen-foreign && \
 	  ln -sf $(wildcard $(XEN_ROOT)/tools/include/xen-foreign/*) include/xen-foreign/ && \
-	  $(CROSS_MAKE) -C include/xen-foreign/ && \
+	  $(MAKE) DESTDIR= -C include/xen-foreign/ && \
 	  ( [ -h include/xen/foreign ] || ln -sf ../xen-foreign include/xen/foreign )
 	mkdir -p libxc-$(XEN_TARGET_ARCH)
 	[ -h libxc-$(XEN_TARGET_ARCH)/Makefile ] || ( cd libxc-$(XEN_TARGET_ARCH) && \
@@ -267,7 +265,7 @@ mk-headers-$(XEN_TARGET_ARCH): ioemu/lin
 	  ln -sf $(XEN_ROOT)/tools/xenstore/*.c . && \
 	  ln -sf $(XEN_ROOT)/tools/xenstore/*.h . && \
 	  ln -sf $(XEN_ROOT)/tools/xenstore/Makefile . )
-	$(CROSS_MAKE) -C $(MINI_OS) links
+	$(MAKE) DESTDIR= -C $(MINI_OS) links
 	touch mk-headers-$(XEN_TARGET_ARCH)
 
 TARGETS_MINIOS=$(addprefix mini-os-$(XEN_TARGET_ARCH)-,$(TARGETS))
@@ -284,7 +282,7 @@ TARGETS_MINIOS=$(addprefix mini-os-$(XEN
 .PHONY: libxc
 libxc: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a libxc-$(XEN_TARGET_ARCH)/libxenguest.a
 libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: cross-zlib
-	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(CROSS_MAKE) -C libxc-$(XEN_TARGET_ARCH)
+	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libxc-$(XEN_TARGET_ARCH)
 
  libxc-$(XEN_TARGET_ARCH)/libxenguest.a: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a
 
@@ -302,7 +300,7 @@ ioemu: cross-zlib cross-libpci libxc
 	    TARGET_CFLAGS="$(TARGET_CFLAGS)" \
 	    TARGET_LDFLAGS="$(TARGET_LDFLAGS)" \
 	    $(QEMU_ROOT)/xen-setup-stubdom )
-	$(CROSS_MAKE) -C ioemu -f $(QEMU_ROOT)/Makefile
+	$(MAKE) DESTDIR= -C ioemu -f $(QEMU_ROOT)/Makefile
 
 ######
 # caml
@@ -310,7 +308,7 @@ ioemu: cross-zlib cross-libpci libxc
 
 .PHONY: caml
 caml: $(CROSS_ROOT)
-	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(CROSS_MAKE) -C $@ LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) OCAMLC_CROSS_PREFIX=$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/bin/
+	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) OCAMLC_CROSS_PREFIX=$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/bin/
 
 ###
 # C
@@ -318,7 +316,7 @@ caml: $(CROSS_ROOT)
 
 .PHONY: c
 c: $(CROSS_ROOT)
-	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(CROSS_MAKE) -C $@ LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) 
+	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) 
 
 ######
 # Grub
@@ -337,7 +335,7 @@ grub-upstream: grub-$(GRUB_VERSION).tar.
 .PHONY: grub
 grub: grub-upstream $(CROSS_ROOT)
 	mkdir -p grub-$(XEN_TARGET_ARCH)
-	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(CROSS_MAKE) -C $@ OBJ_DIR=$(CURDIR)/grub-$(XEN_TARGET_ARCH)
+	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ OBJ_DIR=$(CURDIR)/grub-$(XEN_TARGET_ARCH)
 
 ##########
 # xenstore
@@ -345,7 +343,7 @@ grub: grub-upstream $(CROSS_ROOT)
 
 .PHONY: xenstore
 xenstore: $(CROSS_ROOT)
-	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(CROSS_MAKE) -C $@ xenstored.a CONFIG_STUBDOM=y
+	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ xenstored.a CONFIG_STUBDOM=y
 
 ########
 # minios
@@ -354,23 +352,23 @@ xenstore: $(CROSS_ROOT)
 .PHONY: ioemu-stubdom
 ioemu-stubdom: APP_OBJS=$(CURDIR)/ioemu/i386-stubdom/qemu.a $(CURDIR)/ioemu/i386-stubdom/libqemu.a $(CURDIR)/ioemu/libqemu_common.a
 ioemu-stubdom: mini-os-$(XEN_TARGET_ARCH)-ioemu lwip-$(XEN_TARGET_ARCH) libxc ioemu
-	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/ioemu-minios.cfg" $(CROSS_MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) APP_OBJS="$(APP_OBJS)"
+	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/ioemu-minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) APP_OBJS="$(APP_OBJS)"
 
 .PHONY: caml-stubdom
 caml-stubdom: mini-os-$(XEN_TARGET_ARCH)-caml lwip-$(XEN_TARGET_ARCH) libxc cross-ocaml caml
-	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/caml/minios.cfg" $(CROSS_MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) APP_OBJS="$(CURDIR)/caml/main-caml.o $(CURDIR)/caml/caml.o $(CAMLLIB)/libasmrun.a"
+	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/caml/minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) APP_OBJS="$(CURDIR)/caml/main-caml.o $(CURDIR)/caml/caml.o $(CAMLLIB)/libasmrun.a"
 
 .PHONY: c-stubdom
 c-stubdom: mini-os-$(XEN_TARGET_ARCH)-c lwip-$(XEN_TARGET_ARCH) libxc c
-	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/c/minios.cfg" $(CROSS_MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) APP_OBJS=$(CURDIR)/c/main.a
+	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/c/minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) APP_OBJS=$(CURDIR)/c/main.a
 
 .PHONY: pv-grub
 pv-grub: mini-os-$(XEN_TARGET_ARCH)-grub libxc grub
-	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/grub/minios.cfg" $(CROSS_MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS=$(CURDIR)/grub-$(XEN_TARGET_ARCH)/main.a
+	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/grub/minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS=$(CURDIR)/grub-$(XEN_TARGET_ARCH)/main.a
 
 .PHONY: xenstore-stubdom
 xenstore-stubdom: mini-os-$(XEN_TARGET_ARCH)-xenstore libxc xenstore
-	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/xenstore-minios.cfg" $(CROSS_MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS=$(CURDIR)/xenstore/xenstored.a
+	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/xenstore-minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS=$(CURDIR)/xenstore/xenstored.a
 
 #########
 # install
@@ -412,13 +410,13 @@ clean:
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-caml
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-grub
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-xenstore
-	$(CROSS_MAKE) -C caml clean
-	$(CROSS_MAKE) -C c clean
+	$(MAKE) DESTDIR= -C caml clean
+	$(MAKE) DESTDIR= -C c clean
 	rm -fr grub-$(XEN_TARGET_ARCH)
 	rm -f $(STUBDOMPATH)
-	[ ! -d libxc-$(XEN_TARGET_ARCH) ] || $(CROSS_MAKE) -C libxc-$(XEN_TARGET_ARCH) clean
-	-[ ! -d ioemu ] || $(CROSS_MAKE) -C ioemu clean
-	-[ ! -d xenstore ] || $(CROSS_MAKE) -C xenstore clean
+	[ ! -d libxc-$(XEN_TARGET_ARCH) ] || $(MAKE) DESTDIR= -C libxc-$(XEN_TARGET_ARCH) clean
+	-[ ! -d ioemu ] || $(MAKE) DESTDIR= -C ioemu clean
+	-[ ! -d xenstore ] || $(MAKE) DESTDIR= -C xenstore clean
 
 # clean the cross-compilation result
 .PHONY: crossclean

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22: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 1TM4Uq-0007oL-0s; Wed, 10 Oct 2012 22:11:20 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uo-0007la-PD
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:18 +0000
Received: from [85.158.137.99:8830] by server-4.bemta-3.messagelabs.com id
	9B/D9-01405-482F5705; Wed, 10 Oct 2012 22:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-217.messagelabs.com!1349907075!16355458!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15461 invoked from network); 10 Oct 2012 22:11:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uk-0005yd-Ts
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uk-0000J8-Sd
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:14 +0000
Message-Id: <E1TM4Uk-0000J8-Sd@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] minios: setup fpu and sse in mini-os
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Matthew Fioravante <matthew.fioravante@jhuapl.edu>
# Date 1349703391 -3600
# Node ID c9f621893a05e3e447ba6770f8ae912721712569
# Parent  865626fc700457613e9049d9c19bf25b43bfa019
minios: setup fpu and sse in mini-os

This patch adds floating point and sse support to mini-os by
initializing the floating point unit and the see unit during
domain boot up.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyons.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 865626fc7004 -r c9f621893a05 extras/mini-os/arch/x86/setup.c
--- a/extras/mini-os/arch/x86/setup.c	Mon Oct 08 14:36:31 2012 +0100
+++ b/extras/mini-os/arch/x86/setup.c	Mon Oct 08 14:36:31 2012 +0100
@@ -74,9 +74,28 @@ shared_info_t *map_shared_info(unsigned 
 	return (shared_info_t *)shared_info;
 }
 
+static inline void fpu_init(void) {
+	asm volatile("fninit");
+}
+
+#ifdef __SSE__
+static inline void sse_init(void) {
+	unsigned long status = 0x1f80;
+	asm volatile("ldmxcsr %0" : : "m" (status));
+}
+#else
+#define sse_init()
+#endif
+
 void
 arch_init(start_info_t *si)
 {
+	/*Initialize floating point unit */
+        fpu_init();
+
+        /* Initialize SSE */
+        sse_init();
+
 	/* Copy the start_info struct to a globally-accessible area. */
 	/* WARN: don't do printk before here, it uses information from
 	   shared_info. Use xprintk instead. */
@@ -99,6 +118,7 @@ arch_init(start_info_t *si)
 		(unsigned long)failsafe_callback, 0);
 #endif
 
+
 }
 
 void

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22: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 1TM4Uq-0007oL-0s; Wed, 10 Oct 2012 22:11:20 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uo-0007la-PD
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:18 +0000
Received: from [85.158.137.99:8830] by server-4.bemta-3.messagelabs.com id
	9B/D9-01405-482F5705; Wed, 10 Oct 2012 22:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-217.messagelabs.com!1349907075!16355458!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15461 invoked from network); 10 Oct 2012 22:11:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uk-0005yd-Ts
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uk-0000J8-Sd
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:14 +0000
Message-Id: <E1TM4Uk-0000J8-Sd@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] minios: setup fpu and sse in mini-os
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Matthew Fioravante <matthew.fioravante@jhuapl.edu>
# Date 1349703391 -3600
# Node ID c9f621893a05e3e447ba6770f8ae912721712569
# Parent  865626fc700457613e9049d9c19bf25b43bfa019
minios: setup fpu and sse in mini-os

This patch adds floating point and sse support to mini-os by
initializing the floating point unit and the see unit during
domain boot up.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyons.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 865626fc7004 -r c9f621893a05 extras/mini-os/arch/x86/setup.c
--- a/extras/mini-os/arch/x86/setup.c	Mon Oct 08 14:36:31 2012 +0100
+++ b/extras/mini-os/arch/x86/setup.c	Mon Oct 08 14:36:31 2012 +0100
@@ -74,9 +74,28 @@ shared_info_t *map_shared_info(unsigned 
 	return (shared_info_t *)shared_info;
 }
 
+static inline void fpu_init(void) {
+	asm volatile("fninit");
+}
+
+#ifdef __SSE__
+static inline void sse_init(void) {
+	unsigned long status = 0x1f80;
+	asm volatile("ldmxcsr %0" : : "m" (status));
+}
+#else
+#define sse_init()
+#endif
+
 void
 arch_init(start_info_t *si)
 {
+	/*Initialize floating point unit */
+        fpu_init();
+
+        /* Initialize SSE */
+        sse_init();
+
 	/* Copy the start_info struct to a globally-accessible area. */
 	/* WARN: don't do printk before here, it uses information from
 	   shared_info. Use xprintk instead. */
@@ -99,6 +118,7 @@ arch_init(start_info_t *si)
 		(unsigned long)failsafe_callback, 0);
 #endif
 
+
 }
 
 void

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 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 1TM4Ur-0007pY-7m; Wed, 10 Oct 2012 22:11:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Up-0007nS-Oh
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:20 +0000
Received: from [85.158.138.51:33717] by server-5.bemta-3.messagelabs.com id
	6F/40-12440-782F5705; Wed, 10 Oct 2012 22:11:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1349907077!33813932!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8921 invoked from network); 10 Oct 2012 22:11:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Un-0005yp-2z
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Un-0000Kc-1c
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:17 +0000
Message-Id: <E1TM4Un-0000Kc-1c@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl_qmp: Introduce
	libxl__qmp_insert_cdrom.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Anthony PERARD <anthony.perard@citrix.com>
# Date 1349777299 -3600
# Node ID 694f997be9bfc63a3efe27329c7266dbdf0bf352
# Parent  dbd1e837cb5485c0961082b5f6464e01a2d9979d
libxl_qmp: Introduce libxl__qmp_insert_cdrom.

This function can eject or change the CDROM for a guest that use qemu-xen as a
device-model.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r dbd1e837cb54 -r 694f997be9bf tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Tue Oct 09 10:39:09 2012 +0100
+++ b/tools/libxl/libxl_internal.h	Tue Oct 09 11:08:19 2012 +0100
@@ -1406,6 +1406,7 @@ _hidden int libxl__qmp_resume(libxl__gc 
 _hidden int libxl__qmp_save(libxl__gc *gc, int domid, const char *filename);
 /* Set dirty bitmap logging status */
 _hidden int libxl__qmp_set_global_dirty_log(libxl__gc *gc, int domid, bool enable);
+_hidden int libxl__qmp_insert_cdrom(libxl__gc *gc, int domid, const libxl_device_disk *disk);
 /* close and free the QMP handler */
 _hidden void libxl__qmp_close(libxl__qmp_handler *qmp);
 /* remove the socket file, if the file has already been removed,
diff -r dbd1e837cb54 -r 694f997be9bf tools/libxl/libxl_qmp.c
--- a/tools/libxl/libxl_qmp.c	Tue Oct 09 10:39:09 2012 +0100
+++ b/tools/libxl/libxl_qmp.c	Tue Oct 09 11:08:19 2012 +0100
@@ -913,6 +913,22 @@ int libxl__qmp_set_global_dirty_log(libx
                            NULL, NULL);
 }
 
+int libxl__qmp_insert_cdrom(libxl__gc *gc, int domid,
+                            const libxl_device_disk *disk)
+{
+    libxl__json_object *args = NULL;
+    int dev_number = libxl__device_disk_dev_number(disk->vdev, NULL, NULL);
+
+    QMP_PARAMETERS_SPRINTF(&args, "device", "ide-%i", dev_number);
+
+    if (disk->format == LIBXL_DISK_FORMAT_EMPTY) {
+        return qmp_run_command(gc, domid, "eject", args, NULL, NULL);
+    } else {
+        qmp_parameters_add_string(gc, &args, "target", disk->pdev_path);
+        return qmp_run_command(gc, domid, "change", args, NULL, NULL);
+    }
+}
+
 int libxl__qmp_initializations(libxl__gc *gc, uint32_t domid,
                                const libxl_domain_config *guest_config)
 {

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 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 1TM4Ur-0007pY-7m; Wed, 10 Oct 2012 22:11:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Up-0007nS-Oh
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:20 +0000
Received: from [85.158.138.51:33717] by server-5.bemta-3.messagelabs.com id
	6F/40-12440-782F5705; Wed, 10 Oct 2012 22:11:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1349907077!33813932!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8921 invoked from network); 10 Oct 2012 22:11:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Un-0005yp-2z
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Un-0000Kc-1c
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:17 +0000
Message-Id: <E1TM4Un-0000Kc-1c@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl_qmp: Introduce
	libxl__qmp_insert_cdrom.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Anthony PERARD <anthony.perard@citrix.com>
# Date 1349777299 -3600
# Node ID 694f997be9bfc63a3efe27329c7266dbdf0bf352
# Parent  dbd1e837cb5485c0961082b5f6464e01a2d9979d
libxl_qmp: Introduce libxl__qmp_insert_cdrom.

This function can eject or change the CDROM for a guest that use qemu-xen as a
device-model.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r dbd1e837cb54 -r 694f997be9bf tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Tue Oct 09 10:39:09 2012 +0100
+++ b/tools/libxl/libxl_internal.h	Tue Oct 09 11:08:19 2012 +0100
@@ -1406,6 +1406,7 @@ _hidden int libxl__qmp_resume(libxl__gc 
 _hidden int libxl__qmp_save(libxl__gc *gc, int domid, const char *filename);
 /* Set dirty bitmap logging status */
 _hidden int libxl__qmp_set_global_dirty_log(libxl__gc *gc, int domid, bool enable);
+_hidden int libxl__qmp_insert_cdrom(libxl__gc *gc, int domid, const libxl_device_disk *disk);
 /* close and free the QMP handler */
 _hidden void libxl__qmp_close(libxl__qmp_handler *qmp);
 /* remove the socket file, if the file has already been removed,
diff -r dbd1e837cb54 -r 694f997be9bf tools/libxl/libxl_qmp.c
--- a/tools/libxl/libxl_qmp.c	Tue Oct 09 10:39:09 2012 +0100
+++ b/tools/libxl/libxl_qmp.c	Tue Oct 09 11:08:19 2012 +0100
@@ -913,6 +913,22 @@ int libxl__qmp_set_global_dirty_log(libx
                            NULL, NULL);
 }
 
+int libxl__qmp_insert_cdrom(libxl__gc *gc, int domid,
+                            const libxl_device_disk *disk)
+{
+    libxl__json_object *args = NULL;
+    int dev_number = libxl__device_disk_dev_number(disk->vdev, NULL, NULL);
+
+    QMP_PARAMETERS_SPRINTF(&args, "device", "ide-%i", dev_number);
+
+    if (disk->format == LIBXL_DISK_FORMAT_EMPTY) {
+        return qmp_run_command(gc, domid, "eject", args, NULL, NULL);
+    } else {
+        qmp_parameters_add_string(gc, &args, "target", disk->pdev_path);
+        return qmp_run_command(gc, domid, "change", args, NULL, NULL);
+    }
+}
+
 int libxl__qmp_initializations(libxl__gc *gc, uint32_t domid,
                                const libxl_domain_config *guest_config)
 {

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 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 1TM4Uo-0007n8-Tt; Wed, 10 Oct 2012 22:11:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Un-0007lO-66
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:17 +0000
Received: from [85.158.138.51:34533] by server-10.bemta-3.messagelabs.com id
	93/6A-27386-482F5705; Wed, 10 Oct 2012 22:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-174.messagelabs.com!1349907074!25966383!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1893 invoked from network); 10 Oct 2012 22:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uk-0005ya-GA
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uk-0000It-Bn
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:14 +0000
Message-Id: <E1TM4Uk-0000It-Bn@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] minios: add CONFIG_XC conditional
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Matthew Fioravante <matthew.fioravante@jhuapl.edu>
# Date 1349703391 -3600
# Node ID 865626fc700457613e9049d9c19bf25b43bfa019
# Parent  42ca0ed31aa68293ba9b13e6a3ce9b4c3da97deb
minios: add CONFIG_XC conditional

This patch adds a CONFIG_XC option to mini-os, to allow conditional
support for libxc for mini-os domains.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyons.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 42ca0ed31aa6 -r 865626fc7004 extras/mini-os/Makefile
--- a/extras/mini-os/Makefile	Mon Oct 08 14:36:30 2012 +0100
+++ b/extras/mini-os/Makefile	Mon Oct 08 14:36:31 2012 +0100
@@ -27,6 +27,7 @@ CONFIG_FBFRONT ?= y
 CONFIG_KBDFRONT ?= y
 CONFIG_CONSFRONT ?= y
 CONFIG_XENBUS ?= y
+CONFIG_XC ?=y
 CONFIG_LWIP ?= $(lwip)
 
 # Export config items as compiler directives
@@ -144,7 +145,9 @@ endif
 OBJS := $(filter-out $(OBJ_DIR)/lwip%.o $(LWO), $(OBJS))
 
 ifeq ($(libc),y)
+ifeq ($(CONFIG_XC),y)
 APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libxc-$(XEN_TARGET_ARCH) -whole-archive -lxenguest -lxenctrl -no-whole-archive
+endif
 APP_LDLIBS += -lpci
 APP_LDLIBS += -lz
 APP_LDLIBS += -lm
diff -r 42ca0ed31aa6 -r 865626fc7004 extras/mini-os/lib/sys.c
--- a/extras/mini-os/lib/sys.c	Mon Oct 08 14:36:30 2012 +0100
+++ b/extras/mini-os/lib/sys.c	Mon Oct 08 14:36:31 2012 +0100
@@ -359,6 +359,7 @@ int close(int fd)
 	    return res;
 	}
 #endif
+#ifdef CONFIG_XC
 	case FTYPE_XC:
 	    minios_interface_close_fd(fd);
 	    return 0;
@@ -368,6 +369,7 @@ int close(int fd)
 	case FTYPE_GNTMAP:
 	    minios_gnttab_close_fd(fd);
 	    return 0;
+#endif
 #ifdef CONFIG_NETFRONT
 	case FTYPE_TAP:
 	    shutdown_netfront(files[fd].tap.dev);
@@ -1153,10 +1155,13 @@ void *mmap(void *start, size_t length, i
 
     if (fd == -1)
         return map_zero(n, 1);
+#ifdef CONFIG_XC
     else if (files[fd].type == FTYPE_XC) {
         unsigned long zero = 0;
         return map_frames_ex(&zero, n, 0, 0, 1, DOMID_SELF, NULL, 0);
-    } else if (files[fd].type == FTYPE_MEM) {
+    }
+#endif
+    else if (files[fd].type == FTYPE_MEM) {
         unsigned long first_mfn = offset >> PAGE_SHIFT;
         return map_frames_ex(&first_mfn, n, 0, 1, 1, DOMID_IO, NULL, _PAGE_PRESENT|_PAGE_RW);
     } else ASSERT(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 10 22:11:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 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 1TM4Uo-0007n8-Tt; Wed, 10 Oct 2012 22:11:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Un-0007lO-66
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:17 +0000
Received: from [85.158.138.51:34533] by server-10.bemta-3.messagelabs.com id
	93/6A-27386-482F5705; Wed, 10 Oct 2012 22:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-174.messagelabs.com!1349907074!25966383!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1893 invoked from network); 10 Oct 2012 22:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uk-0005ya-GA
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uk-0000It-Bn
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:14 +0000
Message-Id: <E1TM4Uk-0000It-Bn@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] minios: add CONFIG_XC conditional
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Matthew Fioravante <matthew.fioravante@jhuapl.edu>
# Date 1349703391 -3600
# Node ID 865626fc700457613e9049d9c19bf25b43bfa019
# Parent  42ca0ed31aa68293ba9b13e6a3ce9b4c3da97deb
minios: add CONFIG_XC conditional

This patch adds a CONFIG_XC option to mini-os, to allow conditional
support for libxc for mini-os domains.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyons.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 42ca0ed31aa6 -r 865626fc7004 extras/mini-os/Makefile
--- a/extras/mini-os/Makefile	Mon Oct 08 14:36:30 2012 +0100
+++ b/extras/mini-os/Makefile	Mon Oct 08 14:36:31 2012 +0100
@@ -27,6 +27,7 @@ CONFIG_FBFRONT ?= y
 CONFIG_KBDFRONT ?= y
 CONFIG_CONSFRONT ?= y
 CONFIG_XENBUS ?= y
+CONFIG_XC ?=y
 CONFIG_LWIP ?= $(lwip)
 
 # Export config items as compiler directives
@@ -144,7 +145,9 @@ endif
 OBJS := $(filter-out $(OBJ_DIR)/lwip%.o $(LWO), $(OBJS))
 
 ifeq ($(libc),y)
+ifeq ($(CONFIG_XC),y)
 APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libxc-$(XEN_TARGET_ARCH) -whole-archive -lxenguest -lxenctrl -no-whole-archive
+endif
 APP_LDLIBS += -lpci
 APP_LDLIBS += -lz
 APP_LDLIBS += -lm
diff -r 42ca0ed31aa6 -r 865626fc7004 extras/mini-os/lib/sys.c
--- a/extras/mini-os/lib/sys.c	Mon Oct 08 14:36:30 2012 +0100
+++ b/extras/mini-os/lib/sys.c	Mon Oct 08 14:36:31 2012 +0100
@@ -359,6 +359,7 @@ int close(int fd)
 	    return res;
 	}
 #endif
+#ifdef CONFIG_XC
 	case FTYPE_XC:
 	    minios_interface_close_fd(fd);
 	    return 0;
@@ -368,6 +369,7 @@ int close(int fd)
 	case FTYPE_GNTMAP:
 	    minios_gnttab_close_fd(fd);
 	    return 0;
+#endif
 #ifdef CONFIG_NETFRONT
 	case FTYPE_TAP:
 	    shutdown_netfront(files[fd].tap.dev);
@@ -1153,10 +1155,13 @@ void *mmap(void *start, size_t length, i
 
     if (fd == -1)
         return map_zero(n, 1);
+#ifdef CONFIG_XC
     else if (files[fd].type == FTYPE_XC) {
         unsigned long zero = 0;
         return map_frames_ex(&zero, n, 0, 0, 1, DOMID_SELF, NULL, 0);
-    } else if (files[fd].type == FTYPE_MEM) {
+    }
+#endif
+    else if (files[fd].type == FTYPE_MEM) {
         unsigned long first_mfn = offset >> PAGE_SHIFT;
         return map_frames_ex(&first_mfn, n, 0, 1, 1, DOMID_IO, NULL, _PAGE_PRESENT|_PAGE_RW);
     } else ASSERT(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 10 22:11:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4Ur-0007pH-4I; Wed, 10 Oct 2012 22:11:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Up-0007mg-6q
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:19 +0000
Received: from [85.158.138.51:34583] by server-7.bemta-3.messagelabs.com id
	1D/EC-06991-682F5705; Wed, 10 Oct 2012 22:11:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-174.messagelabs.com!1349907076!27561462!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6701 invoked from network); 10 Oct 2012 22:11:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Um-0005ym-I5
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Um-0000KN-Gk
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:16 +0000
Message-Id: <E1TM4Um-0000KN-Gk@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] minios: add select definition to
	sys/time.h when HAVE_LIBC is defined
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Matthew Fioravante <matthew.fioravante@jhuapl.edu>
# Date 1349775549 -3600
# Node ID dbd1e837cb5485c0961082b5f6464e01a2d9979d
# Parent  566061fefa47f16acf6b134520a160a832240a5c
minios: add select definition to sys/time.h when HAVE_LIBC is defined

This patch adds the select function to sys/time.h when HAVE_LIBC is
defined, which is according to standard (see the select() manpage).
It also removes a redudant lwip include from posix/sys/select.h.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 566061fefa47 -r dbd1e837cb54 extras/mini-os/include/posix/sys/select.h
--- a/extras/mini-os/include/posix/sys/select.h	Tue Oct 09 10:39:08 2012 +0100
+++ b/extras/mini-os/include/posix/sys/select.h	Tue Oct 09 10:39:09 2012 +0100
@@ -2,7 +2,6 @@
 #define _POSIX_SELECT_H
 
 #include <sys/time.h>
-#include <lwip/sockets.h>
 int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);
 
 #endif /* _POSIX_SELECT_H */
diff -r 566061fefa47 -r dbd1e837cb54 extras/mini-os/include/sys/time.h
--- a/extras/mini-os/include/sys/time.h	Tue Oct 09 10:39:08 2012 +0100
+++ b/extras/mini-os/include/sys/time.h	Tue Oct 09 10:39:09 2012 +0100
@@ -22,6 +22,7 @@
 
 #ifdef HAVE_LIBC
 #include_next <sys/time.h>
+
 #else
 struct timespec {
     time_t      tv_sec;
@@ -37,6 +38,10 @@ struct timeval {
 };
 
 int      gettimeofday(struct timeval *tv, void *tz);
+
+#endif
+#ifdef HAVE_LIBC
+#include <sys/select.h>
 #endif
 
 #endif /* _MINIOS_SYS_TIME_H_ */

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4Ur-0007pH-4I; Wed, 10 Oct 2012 22:11:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Up-0007mg-6q
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:19 +0000
Received: from [85.158.138.51:34583] by server-7.bemta-3.messagelabs.com id
	1D/EC-06991-682F5705; Wed, 10 Oct 2012 22:11:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-174.messagelabs.com!1349907076!27561462!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6701 invoked from network); 10 Oct 2012 22:11:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Um-0005ym-I5
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Um-0000KN-Gk
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:16 +0000
Message-Id: <E1TM4Um-0000KN-Gk@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] minios: add select definition to
	sys/time.h when HAVE_LIBC is defined
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Matthew Fioravante <matthew.fioravante@jhuapl.edu>
# Date 1349775549 -3600
# Node ID dbd1e837cb5485c0961082b5f6464e01a2d9979d
# Parent  566061fefa47f16acf6b134520a160a832240a5c
minios: add select definition to sys/time.h when HAVE_LIBC is defined

This patch adds the select function to sys/time.h when HAVE_LIBC is
defined, which is according to standard (see the select() manpage).
It also removes a redudant lwip include from posix/sys/select.h.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 566061fefa47 -r dbd1e837cb54 extras/mini-os/include/posix/sys/select.h
--- a/extras/mini-os/include/posix/sys/select.h	Tue Oct 09 10:39:08 2012 +0100
+++ b/extras/mini-os/include/posix/sys/select.h	Tue Oct 09 10:39:09 2012 +0100
@@ -2,7 +2,6 @@
 #define _POSIX_SELECT_H
 
 #include <sys/time.h>
-#include <lwip/sockets.h>
 int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);
 
 #endif /* _POSIX_SELECT_H */
diff -r 566061fefa47 -r dbd1e837cb54 extras/mini-os/include/sys/time.h
--- a/extras/mini-os/include/sys/time.h	Tue Oct 09 10:39:08 2012 +0100
+++ b/extras/mini-os/include/sys/time.h	Tue Oct 09 10:39:09 2012 +0100
@@ -22,6 +22,7 @@
 
 #ifdef HAVE_LIBC
 #include_next <sys/time.h>
+
 #else
 struct timespec {
     time_t      tv_sec;
@@ -37,6 +38,10 @@ struct timeval {
 };
 
 int      gettimeofday(struct timeval *tv, void *tz);
+
+#endif
+#ifdef HAVE_LIBC
+#include <sys/select.h>
 #endif
 
 #endif /* _MINIOS_SYS_TIME_H_ */

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4Us-0007qt-Fo; Wed, 10 Oct 2012 22:11:22 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ur-0007os-6A
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:21 +0000
Received: from [85.158.139.211:32771] by server-13.bemta-5.messagelabs.com id
	EE/70-29905-882F5705; Wed, 10 Oct 2012 22:11:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-206.messagelabs.com!1349907078!21874106!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31400 invoked from network); 10 Oct 2012 22:11:19 -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;
	10 Oct 2012 22:11:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uo-0005yy-Pl
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uo-0000LL-LU
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:18 +0000
Message-Id: <E1TM4Uo-0000LL-LU@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] build: Fix build when using
	-fno-inline
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Andrew Cooper <andrew.cooper3@citrix.com>
# Date 1349782906 -3600
# Node ID c8472a11078424e1e43f957b09e260d8002c9dfc
# Parent  d0b03667c922b306e06d5d524ef2c99a95a1f030
build: Fix build when using -fno-inline

struct task_slice.migrated is not initialised by this function, and
subsequently returned by value, leading to the error:

sched_sedf.c: In function ?sedf_do_extra_schedule?:
sched_sedf.c:711: error: ?ret.migrated? may be used uninitialised in
this function

for both gcc 4.1.2 and 4.4.3 (which are the two I have easily to hand)
when combined with the -fno-inline compile option.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r d0b03667c922 -r c8472a110784 xen/common/sched_sedf.c
--- a/xen/common/sched_sedf.c	Tue Oct 09 11:08:21 2012 +0100
+++ b/xen/common/sched_sedf.c	Tue Oct 09 12:41:46 2012 +0100
@@ -667,7 +667,7 @@ static void desched_extra_dom(s_time_t n
 static struct task_slice sedf_do_extra_schedule(
     s_time_t now, s_time_t end_xt, struct list_head *extraq[], int cpu)
 {
-    struct task_slice   ret;
+    struct task_slice   ret = { 0 };
     struct sedf_vcpu_info *runinf;
     ASSERT(end_xt > now);
 

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4Us-0007qt-Fo; Wed, 10 Oct 2012 22:11:22 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ur-0007os-6A
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:21 +0000
Received: from [85.158.139.211:32771] by server-13.bemta-5.messagelabs.com id
	EE/70-29905-882F5705; Wed, 10 Oct 2012 22:11:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-206.messagelabs.com!1349907078!21874106!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31400 invoked from network); 10 Oct 2012 22:11:19 -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;
	10 Oct 2012 22:11:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uo-0005yy-Pl
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uo-0000LL-LU
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:18 +0000
Message-Id: <E1TM4Uo-0000LL-LU@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] build: Fix build when using
	-fno-inline
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Andrew Cooper <andrew.cooper3@citrix.com>
# Date 1349782906 -3600
# Node ID c8472a11078424e1e43f957b09e260d8002c9dfc
# Parent  d0b03667c922b306e06d5d524ef2c99a95a1f030
build: Fix build when using -fno-inline

struct task_slice.migrated is not initialised by this function, and
subsequently returned by value, leading to the error:

sched_sedf.c: In function ?sedf_do_extra_schedule?:
sched_sedf.c:711: error: ?ret.migrated? may be used uninitialised in
this function

for both gcc 4.1.2 and 4.4.3 (which are the two I have easily to hand)
when combined with the -fno-inline compile option.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r d0b03667c922 -r c8472a110784 xen/common/sched_sedf.c
--- a/xen/common/sched_sedf.c	Tue Oct 09 11:08:21 2012 +0100
+++ b/xen/common/sched_sedf.c	Tue Oct 09 12:41:46 2012 +0100
@@ -667,7 +667,7 @@ static void desched_extra_dom(s_time_t n
 static struct task_slice sedf_do_extra_schedule(
     s_time_t now, s_time_t end_xt, struct list_head *extraq[], int cpu)
 {
-    struct task_slice   ret;
+    struct task_slice   ret = { 0 };
     struct sedf_vcpu_info *runinf;
     ASSERT(end_xt > now);
 

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22: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 1TM4Ur-0007pf-AT; Wed, 10 Oct 2012 22:11:21 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uq-0007o5-48
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:20 +0000
Received: from [85.158.143.99:42883] by server-3.bemta-4.messagelabs.com id
	07/A9-10075-782F5705; Wed, 10 Oct 2012 22:11:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1349907077!28351476!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31237 invoked from network); 10 Oct 2012 22:11:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Un-0005ys-K1
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Un-0000Kr-Ih
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:17 +0000
Message-Id: <E1TM4Un-0000Kr-Ih@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl_dm: Set an id to cdrom drives
	with qemuu.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Anthony PERARD <anthony.perard@citrix.com>
# Date 1349777300 -3600
# Node ID 754e059217ecc3334c4eb72ca6df851662e942ac
# Parent  694f997be9bfc63a3efe27329c7266dbdf0bf352
libxl_dm: Set an id to cdrom drives with qemuu.

In order to eject and change a cdrom when using qemu-xen, this patch adds an id
the cdrom driver when starting the device model.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 694f997be9bf -r 754e059217ec tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Tue Oct 09 11:08:19 2012 +0100
+++ b/tools/libxl/libxl_dm.c	Tue Oct 09 11:08:20 2012 +0100
@@ -544,11 +544,12 @@ static char ** libxl__build_device_model
             if (disks[i].is_cdrom) {
                 if (disks[i].format == LIBXL_DISK_FORMAT_EMPTY)
                     drive = libxl__sprintf
-                        (gc, "if=ide,index=%d,media=cdrom,cache=writeback", disk);
+                        (gc, "if=ide,index=%d,media=cdrom,cache=writeback,id=ide-%i",
+                         disk, dev_number);
                 else
                     drive = libxl__sprintf
-                        (gc, "file=%s,if=ide,index=%d,media=cdrom,format=%s,cache=writeback",
-                         disks[i].pdev_path, disk, format);
+                        (gc, "file=%s,if=ide,index=%d,media=cdrom,format=%s,cache=writeback,id=ide-%i",
+                         disks[i].pdev_path, disk, format, dev_number);
             } else {
                 if (disks[i].format == LIBXL_DISK_FORMAT_EMPTY) {
                     LIBXL__LOG(ctx, LIBXL__LOG_WARNING, "cannot support"

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22: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 1TM4Ur-0007pf-AT; Wed, 10 Oct 2012 22:11:21 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uq-0007o5-48
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:20 +0000
Received: from [85.158.143.99:42883] by server-3.bemta-4.messagelabs.com id
	07/A9-10075-782F5705; Wed, 10 Oct 2012 22:11:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1349907077!28351476!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31237 invoked from network); 10 Oct 2012 22:11:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Un-0005ys-K1
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Un-0000Kr-Ih
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:17 +0000
Message-Id: <E1TM4Un-0000Kr-Ih@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl_dm: Set an id to cdrom drives
	with qemuu.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Anthony PERARD <anthony.perard@citrix.com>
# Date 1349777300 -3600
# Node ID 754e059217ecc3334c4eb72ca6df851662e942ac
# Parent  694f997be9bfc63a3efe27329c7266dbdf0bf352
libxl_dm: Set an id to cdrom drives with qemuu.

In order to eject and change a cdrom when using qemu-xen, this patch adds an id
the cdrom driver when starting the device model.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 694f997be9bf -r 754e059217ec tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Tue Oct 09 11:08:19 2012 +0100
+++ b/tools/libxl/libxl_dm.c	Tue Oct 09 11:08:20 2012 +0100
@@ -544,11 +544,12 @@ static char ** libxl__build_device_model
             if (disks[i].is_cdrom) {
                 if (disks[i].format == LIBXL_DISK_FORMAT_EMPTY)
                     drive = libxl__sprintf
-                        (gc, "if=ide,index=%d,media=cdrom,cache=writeback", disk);
+                        (gc, "if=ide,index=%d,media=cdrom,cache=writeback,id=ide-%i",
+                         disk, dev_number);
                 else
                     drive = libxl__sprintf
-                        (gc, "file=%s,if=ide,index=%d,media=cdrom,format=%s,cache=writeback",
-                         disks[i].pdev_path, disk, format);
+                        (gc, "file=%s,if=ide,index=%d,media=cdrom,format=%s,cache=writeback,id=ide-%i",
+                         disks[i].pdev_path, disk, format, dev_number);
             } else {
                 if (disks[i].format == LIBXL_DISK_FORMAT_EMPTY) {
                     LIBXL__LOG(ctx, LIBXL__LOG_WARNING, "cannot support"

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22: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 1TM4Us-0007ql-DE; Wed, 10 Oct 2012 22:11:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uq-0007oh-TD
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:21 +0000
Received: from [85.158.138.51:34638] by server-3.bemta-3.messagelabs.com id
	E6/1A-09368-882F5705; Wed, 10 Oct 2012 22:11:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1349907078!33806936!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12392 invoked from network); 10 Oct 2012 22:11:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uo-0005yv-5e
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uo-0000L6-4N
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:18 +0000
Message-Id: <E1TM4Uo-0000L6-4N@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Fix cd-insert with qemu-xen.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Anthony PERARD <anthony.perard@citrix.com>
# Date 1349777301 -3600
# Node ID d0b03667c922b306e06d5d524ef2c99a95a1f030
# Parent  754e059217ecc3334c4eb72ca6df851662e942ac
libxl: Fix cd-insert with qemu-xen.

If qemu-xen is used as a device model, the command to insert, change or eject a
cdrom will go through QMP. XenStore is still updated even if QEMU will not read
from it.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 754e059217ec -r d0b03667c922 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Tue Oct 09 11:08:20 2012 +0100
+++ b/tools/libxl/libxl.c	Tue Oct 09 11:08:21 2012 +0100
@@ -2141,12 +2141,6 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u
         rc = ERROR_FAIL;
         goto out;
     }
-    if (dm_ver != LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL) {
-        LOG(ERROR, "cdrom-insert does not work with %s",
-            libxl_device_model_version_to_string(dm_ver));
-        rc = ERROR_INVAL;
-        goto out;
-    }
 
     disks = libxl_device_disk_list(ctx, domid, &num);
     for (i = 0; i < num; i++) {
@@ -2170,6 +2164,12 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u
 
     rc = libxl__device_from_disk(gc, domid, disk, &device);
     if (rc) goto out;
+
+    if (dm_ver == LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) {
+        rc = libxl__qmp_insert_cdrom(gc, domid, disk);
+        if (rc) goto out;
+    }
+
     path = libxl__device_backend_path(gc, &device);
 
     insert = flexarray_make(gc, 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 10 22:11:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22: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 1TM4Us-0007ql-DE; Wed, 10 Oct 2012 22:11:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uq-0007oh-TD
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:21 +0000
Received: from [85.158.138.51:34638] by server-3.bemta-3.messagelabs.com id
	E6/1A-09368-882F5705; Wed, 10 Oct 2012 22:11:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1349907078!33806936!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12392 invoked from network); 10 Oct 2012 22:11:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uo-0005yv-5e
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uo-0000L6-4N
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:18 +0000
Message-Id: <E1TM4Uo-0000L6-4N@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Fix cd-insert with qemu-xen.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Anthony PERARD <anthony.perard@citrix.com>
# Date 1349777301 -3600
# Node ID d0b03667c922b306e06d5d524ef2c99a95a1f030
# Parent  754e059217ecc3334c4eb72ca6df851662e942ac
libxl: Fix cd-insert with qemu-xen.

If qemu-xen is used as a device model, the command to insert, change or eject a
cdrom will go through QMP. XenStore is still updated even if QEMU will not read
from it.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 754e059217ec -r d0b03667c922 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Tue Oct 09 11:08:20 2012 +0100
+++ b/tools/libxl/libxl.c	Tue Oct 09 11:08:21 2012 +0100
@@ -2141,12 +2141,6 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u
         rc = ERROR_FAIL;
         goto out;
     }
-    if (dm_ver != LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL) {
-        LOG(ERROR, "cdrom-insert does not work with %s",
-            libxl_device_model_version_to_string(dm_ver));
-        rc = ERROR_INVAL;
-        goto out;
-    }
 
     disks = libxl_device_disk_list(ctx, domid, &num);
     for (i = 0; i < num; i++) {
@@ -2170,6 +2164,12 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u
 
     rc = libxl__device_from_disk(gc, domid, disk, &device);
     if (rc) goto out;
+
+    if (dm_ver == LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) {
+        rc = libxl__qmp_insert_cdrom(gc, domid, disk);
+        if (rc) goto out;
+    }
+
     path = libxl__device_backend_path(gc, &device);
 
     insert = flexarray_make(gc, 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 10 22:11:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 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 1TM4Ut-0007sX-Kg; Wed, 10 Oct 2012 22:11:23 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ur-0007l7-Di
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-27.messagelabs.com!1349907072!829880!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6952 invoked from network); 10 Oct 2012 22:11:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ui-0005yO-DZ
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ui-0000Hv-9I
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:12 +0000
Message-Id: <E1TM4Ui-0000Hv-9I@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools/configure.ac: fill
	PACKAGE_TARNAME in AC_INIT
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1349695115 -3600
# Node ID 02e744da52c997de70ebde8d1baaf45dc4399866
# Parent  b6fb4e63b946286fb5fcd1fd618d1a2e319ddeb7
tools/configure.ac: fill PACKAGE_TARNAME in AC_INIT

Upcoming changes may move DOCDIR from Config.mk to config/Tools.mk. To
preserve the currently used path, which ends with /xen, specify a value
for PACKAGE_TARNAME. Without this change the path would end with
/xen-hypervisor.

Please rerun autoconf after applying this.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r b6fb4e63b946 -r 02e744da52c9 tools/configure
--- a/tools/configure	Mon Oct 08 12:18:34 2012 +0100
+++ b/tools/configure	Mon Oct 08 12:18:35 2012 +0100
@@ -551,11 +551,11 @@ MAKEFLAGS=
 
 # Identity of this package.
 PACKAGE_NAME='Xen Hypervisor'
-PACKAGE_TARNAME='xen-hypervisor'
+PACKAGE_TARNAME='xen'
 PACKAGE_VERSION='4.3'
 PACKAGE_STRING='Xen Hypervisor 4.3'
 PACKAGE_BUGREPORT='xen-devel@lists.xen.org'
-PACKAGE_URL=''
+PACKAGE_URL='http://www.xen.org/'
 
 ac_unique_file="libxl/libxl.c"
 ac_default_prefix=/usr
@@ -1349,7 +1349,7 @@ Fine tuning of the installation director
   --infodir=DIR           info documentation [DATAROOTDIR/info]
   --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
   --mandir=DIR            man documentation [DATAROOTDIR/man]
-  --docdir=DIR            documentation root [DATAROOTDIR/doc/xen-hypervisor]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/xen]
   --htmldir=DIR           html documentation [DOCDIR]
   --dvidir=DIR            dvi documentation [DOCDIR]
   --pdfdir=DIR            pdf documentation [DOCDIR]
@@ -1428,6 +1428,7 @@ Use these variables to override the choi
 it to find libraries and programs with nonstandard names/locations.
 
 Report bugs to <xen-devel@lists.xen.org>.
+Xen Hypervisor home page: <http://www.xen.org/>.
 _ACEOF
 ac_status=$?
 fi
@@ -7321,7 +7322,8 @@ Configuration files:
 Configuration headers:
 $config_headers
 
-Report bugs to <xen-devel@lists.xen.org>."
+Report bugs to <xen-devel@lists.xen.org>.
+Xen Hypervisor home page: <http://www.xen.org/>."
 
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
diff -r b6fb4e63b946 -r 02e744da52c9 tools/configure.ac
--- a/tools/configure.ac	Mon Oct 08 12:18:34 2012 +0100
+++ b/tools/configure.ac	Mon Oct 08 12:18:35 2012 +0100
@@ -3,7 +3,7 @@
 
 AC_PREREQ([2.67])
 AC_INIT([Xen Hypervisor], m4_esyscmd([../version.sh ../xen/Makefile]),
-    [xen-devel@lists.xen.org])
+    [xen-devel@lists.xen.org], [xen], [http://www.xen.org/])
 AC_CONFIG_SRCDIR([libxl/libxl.c])
 AC_CONFIG_FILES([../config/Tools.mk])
 AC_CONFIG_HEADERS([config.h])

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 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 1TM4Ut-0007sr-QI; Wed, 10 Oct 2012 22:11:23 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ur-0007pP-MY
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:21 +0000
Received: from [85.158.139.211:32790] by server-10.bemta-5.messagelabs.com id
	27/49-06995-882F5705; Wed, 10 Oct 2012 22:11:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-206.messagelabs.com!1349907079!21892571!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22011 invoked from network); 10 Oct 2012 22:11:20 -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;
	10 Oct 2012 22:11:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Up-0005z1-7K
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Up-0000La-64
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:19 +0000
Message-Id: <E1TM4Up-0000La-64@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] trace: rename trace_hypercall() to
	__trace_hypercall_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

# HG changeset patch
# User David Vrabel <david.vrabel@citrix.com>
# Date 1349783187 -3600
# Node ID cb1382bdaad9e11683a0329d18cef60ee85360c1
# Parent  c8472a11078424e1e43f957b09e260d8002c9dfc
trace: rename trace_hypercall() to __trace_hypercall_entry()

Tracing functions that don't check tb_init_done are (by convention)
prefixed with __.

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


diff -r c8472a110784 -r cb1382bdaad9 xen/arch/x86/trace.c
--- a/xen/arch/x86/trace.c	Tue Oct 09 12:41:46 2012 +0100
+++ b/xen/arch/x86/trace.c	Tue Oct 09 12:46:27 2012 +0100
@@ -6,7 +6,7 @@
 #include <xen/sched.h>
 #include <xen/trace.h>
 
-void trace_hypercall(void)
+void __trace_hypercall_entry(void)
 {
     struct cpu_user_regs *regs = guest_cpu_user_regs();
     unsigned long args[6];
diff -r c8472a110784 -r cb1382bdaad9 xen/arch/x86/x86_64/compat/entry.S
--- a/xen/arch/x86/x86_64/compat/entry.S	Tue Oct 09 12:41:46 2012 +0100
+++ b/xen/arch/x86/x86_64/compat/entry.S	Tue Oct 09 12:46:27 2012 +0100
@@ -59,8 +59,8 @@ UNLIKELY_END(msi_check)
 #endif
         cmpb  $0,tb_init_done(%rip)
 UNLIKELY_START(ne, compat_trace)
-        call  trace_hypercall
-        /* Now restore all the registers that trace_hypercall clobbered */
+        call  __trace_hypercall_entry
+        /* Restore the registers that __trace_hypercall_entry clobbered. */
         movl  UREGS_rax+SHADOW_BYTES(%rsp),%eax   /* Hypercall #  */
         movl  UREGS_rbx+SHADOW_BYTES(%rsp),%edi   /* Arg 1        */
         movl  UREGS_rcx+SHADOW_BYTES(%rsp),%esi   /* Arg 2        */
diff -r c8472a110784 -r cb1382bdaad9 xen/arch/x86/x86_64/entry.S
--- a/xen/arch/x86/x86_64/entry.S	Tue Oct 09 12:41:46 2012 +0100
+++ b/xen/arch/x86/x86_64/entry.S	Tue Oct 09 12:46:27 2012 +0100
@@ -159,8 +159,8 @@ ENTRY(syscall_enter)
 #endif
         cmpb  $0,tb_init_done(%rip)
 UNLIKELY_START(ne, trace)
-        call  trace_hypercall
-        /* Now restore all the registers that trace_hypercall clobbered */
+        call  __trace_hypercall_entry
+        /* Restore the registers that __trace_hypercall_entry clobbered. */
         movq  UREGS_rax+SHADOW_BYTES(%rsp),%rax   /* Hypercall #  */
         movq  UREGS_rdi+SHADOW_BYTES(%rsp),%rdi   /* Arg 1        */
         movq  UREGS_rsi+SHADOW_BYTES(%rsp),%rsi   /* Arg 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 10 22:11:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 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 1TM4Ut-0007sr-QI; Wed, 10 Oct 2012 22:11:23 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ur-0007pP-MY
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:21 +0000
Received: from [85.158.139.211:32790] by server-10.bemta-5.messagelabs.com id
	27/49-06995-882F5705; Wed, 10 Oct 2012 22:11:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-206.messagelabs.com!1349907079!21892571!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22011 invoked from network); 10 Oct 2012 22:11:20 -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;
	10 Oct 2012 22:11:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Up-0005z1-7K
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Up-0000La-64
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:19 +0000
Message-Id: <E1TM4Up-0000La-64@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] trace: rename trace_hypercall() to
	__trace_hypercall_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

# HG changeset patch
# User David Vrabel <david.vrabel@citrix.com>
# Date 1349783187 -3600
# Node ID cb1382bdaad9e11683a0329d18cef60ee85360c1
# Parent  c8472a11078424e1e43f957b09e260d8002c9dfc
trace: rename trace_hypercall() to __trace_hypercall_entry()

Tracing functions that don't check tb_init_done are (by convention)
prefixed with __.

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


diff -r c8472a110784 -r cb1382bdaad9 xen/arch/x86/trace.c
--- a/xen/arch/x86/trace.c	Tue Oct 09 12:41:46 2012 +0100
+++ b/xen/arch/x86/trace.c	Tue Oct 09 12:46:27 2012 +0100
@@ -6,7 +6,7 @@
 #include <xen/sched.h>
 #include <xen/trace.h>
 
-void trace_hypercall(void)
+void __trace_hypercall_entry(void)
 {
     struct cpu_user_regs *regs = guest_cpu_user_regs();
     unsigned long args[6];
diff -r c8472a110784 -r cb1382bdaad9 xen/arch/x86/x86_64/compat/entry.S
--- a/xen/arch/x86/x86_64/compat/entry.S	Tue Oct 09 12:41:46 2012 +0100
+++ b/xen/arch/x86/x86_64/compat/entry.S	Tue Oct 09 12:46:27 2012 +0100
@@ -59,8 +59,8 @@ UNLIKELY_END(msi_check)
 #endif
         cmpb  $0,tb_init_done(%rip)
 UNLIKELY_START(ne, compat_trace)
-        call  trace_hypercall
-        /* Now restore all the registers that trace_hypercall clobbered */
+        call  __trace_hypercall_entry
+        /* Restore the registers that __trace_hypercall_entry clobbered. */
         movl  UREGS_rax+SHADOW_BYTES(%rsp),%eax   /* Hypercall #  */
         movl  UREGS_rbx+SHADOW_BYTES(%rsp),%edi   /* Arg 1        */
         movl  UREGS_rcx+SHADOW_BYTES(%rsp),%esi   /* Arg 2        */
diff -r c8472a110784 -r cb1382bdaad9 xen/arch/x86/x86_64/entry.S
--- a/xen/arch/x86/x86_64/entry.S	Tue Oct 09 12:41:46 2012 +0100
+++ b/xen/arch/x86/x86_64/entry.S	Tue Oct 09 12:46:27 2012 +0100
@@ -159,8 +159,8 @@ ENTRY(syscall_enter)
 #endif
         cmpb  $0,tb_init_done(%rip)
 UNLIKELY_START(ne, trace)
-        call  trace_hypercall
-        /* Now restore all the registers that trace_hypercall clobbered */
+        call  __trace_hypercall_entry
+        /* Restore the registers that __trace_hypercall_entry clobbered. */
         movq  UREGS_rax+SHADOW_BYTES(%rsp),%rax   /* Hypercall #  */
         movq  UREGS_rdi+SHADOW_BYTES(%rsp),%rdi   /* Arg 1        */
         movq  UREGS_rsi+SHADOW_BYTES(%rsp),%rsi   /* Arg 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 10 22:11:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 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 1TM4Ut-0007sX-Kg; Wed, 10 Oct 2012 22:11:23 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ur-0007l7-Di
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-27.messagelabs.com!1349907072!829880!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6952 invoked from network); 10 Oct 2012 22:11:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ui-0005yO-DZ
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ui-0000Hv-9I
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:12 +0000
Message-Id: <E1TM4Ui-0000Hv-9I@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools/configure.ac: fill
	PACKAGE_TARNAME in AC_INIT
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1349695115 -3600
# Node ID 02e744da52c997de70ebde8d1baaf45dc4399866
# Parent  b6fb4e63b946286fb5fcd1fd618d1a2e319ddeb7
tools/configure.ac: fill PACKAGE_TARNAME in AC_INIT

Upcoming changes may move DOCDIR from Config.mk to config/Tools.mk. To
preserve the currently used path, which ends with /xen, specify a value
for PACKAGE_TARNAME. Without this change the path would end with
/xen-hypervisor.

Please rerun autoconf after applying this.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r b6fb4e63b946 -r 02e744da52c9 tools/configure
--- a/tools/configure	Mon Oct 08 12:18:34 2012 +0100
+++ b/tools/configure	Mon Oct 08 12:18:35 2012 +0100
@@ -551,11 +551,11 @@ MAKEFLAGS=
 
 # Identity of this package.
 PACKAGE_NAME='Xen Hypervisor'
-PACKAGE_TARNAME='xen-hypervisor'
+PACKAGE_TARNAME='xen'
 PACKAGE_VERSION='4.3'
 PACKAGE_STRING='Xen Hypervisor 4.3'
 PACKAGE_BUGREPORT='xen-devel@lists.xen.org'
-PACKAGE_URL=''
+PACKAGE_URL='http://www.xen.org/'
 
 ac_unique_file="libxl/libxl.c"
 ac_default_prefix=/usr
@@ -1349,7 +1349,7 @@ Fine tuning of the installation director
   --infodir=DIR           info documentation [DATAROOTDIR/info]
   --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
   --mandir=DIR            man documentation [DATAROOTDIR/man]
-  --docdir=DIR            documentation root [DATAROOTDIR/doc/xen-hypervisor]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/xen]
   --htmldir=DIR           html documentation [DOCDIR]
   --dvidir=DIR            dvi documentation [DOCDIR]
   --pdfdir=DIR            pdf documentation [DOCDIR]
@@ -1428,6 +1428,7 @@ Use these variables to override the choi
 it to find libraries and programs with nonstandard names/locations.
 
 Report bugs to <xen-devel@lists.xen.org>.
+Xen Hypervisor home page: <http://www.xen.org/>.
 _ACEOF
 ac_status=$?
 fi
@@ -7321,7 +7322,8 @@ Configuration files:
 Configuration headers:
 $config_headers
 
-Report bugs to <xen-devel@lists.xen.org>."
+Report bugs to <xen-devel@lists.xen.org>.
+Xen Hypervisor home page: <http://www.xen.org/>."
 
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
diff -r b6fb4e63b946 -r 02e744da52c9 tools/configure.ac
--- a/tools/configure.ac	Mon Oct 08 12:18:34 2012 +0100
+++ b/tools/configure.ac	Mon Oct 08 12:18:35 2012 +0100
@@ -3,7 +3,7 @@
 
 AC_PREREQ([2.67])
 AC_INIT([Xen Hypervisor], m4_esyscmd([../version.sh ../xen/Makefile]),
-    [xen-devel@lists.xen.org])
+    [xen-devel@lists.xen.org], [xen], [http://www.xen.org/])
 AC_CONFIG_SRCDIR([libxl/libxl.c])
 AC_CONFIG_FILES([../config/Tools.mk])
 AC_CONFIG_HEADERS([config.h])

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 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 1TM4Ut-0007sk-No; Wed, 10 Oct 2012 22:11:23 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ur-0007lB-Et
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-27.messagelabs.com!1349907074!12242755!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1952 invoked from network); 10 Oct 2012 22:11:15 -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 2012 22:11:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uj-0005yX-TX
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uj-0000Ie-RA
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:13 +0000
Message-Id: <E1TM4Uj-0000Ie-RA@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] minios: Disable the mfn_is_ram()
	check, it doesn't work correctly on all systems
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Matthew Fioravante <matthew.fioravante@jhuapl.edu>
# Date 1349703390 -3600
# Node ID 42ca0ed31aa68293ba9b13e6a3ce9b4c3da97deb
# Parent  8fdb8d464eceaa3ae40000523b873c183c5a09d9
minios: Disable the mfn_is_ram() check, it doesn't work correctly on all systems

This patch disables the mfn_is_ram check in mini-os. The current check
is insufficient and fails on some systems with larger than 4gb memory.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyons.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 8fdb8d464ece -r 42ca0ed31aa6 extras/mini-os/arch/x86/ioremap.c
--- a/extras/mini-os/arch/x86/ioremap.c	Mon Oct 08 14:36:29 2012 +0100
+++ b/extras/mini-os/arch/x86/ioremap.c	Mon Oct 08 14:36:30 2012 +0100
@@ -35,7 +35,6 @@ static void *__do_ioremap(unsigned long 
     unsigned long va;
     unsigned long mfns, mfn;
     unsigned long num_pages, offset;
-    int i;
 
     /* allow non page aligned addresses but for mapping we need to align them */
     offset = (phys_addr & ~PAGE_MASK);
@@ -43,21 +42,9 @@ static void *__do_ioremap(unsigned long 
     phys_addr &= PAGE_MASK;
     mfns = mfn = phys_addr >> PAGE_SHIFT;
     
-    /* sanity checks on list of MFNs */
-    for ( i = 0; i < num_pages; i++, mfn++ )
-    {
-        if ( mfn_is_ram(mfn) )
-        {
-            printk("ioremap: mfn 0x%ulx is RAM\n", mfn);
-            goto mfn_invalid;
-        }
-    }   
     va = (unsigned long)map_frames_ex(&mfns, num_pages, 0, 1, 1,
                                       DOMID_IO, NULL, prot);
     return (void *)(va + offset);
-    
-mfn_invalid:
-    return NULL;
 }
 
 void *ioremap(unsigned long phys_addr, unsigned long size)
diff -r 8fdb8d464ece -r 42ca0ed31aa6 extras/mini-os/arch/x86/mm.c
--- a/extras/mini-os/arch/x86/mm.c	Mon Oct 08 14:36:29 2012 +0100
+++ b/extras/mini-os/arch/x86/mm.c	Mon Oct 08 14:36:30 2012 +0100
@@ -845,18 +845,6 @@ unsigned long alloc_contig_pages(int ord
 }
 
 /*
- * Check if a given MFN refers to real memory
- */
-static long system_ram_end_mfn;
-int mfn_is_ram(unsigned long mfn)
-{
-    /* very crude check if a given MFN is memory or not. Probably should
-     * make this a little more sophisticated ;) */
-    return (mfn <= system_ram_end_mfn) ? 1 : 0;
-}
-
-
-/*
  * Clear some of the bootstrap memory
  */
 static void clear_bootstrap(void)
@@ -951,10 +939,6 @@ void arch_init_mm(unsigned long* start_p
     clear_bootstrap();
     set_readonly(&_text, &_erodata);
 
-    /* get the number of physical pages the system has. Used to check for
-     * system memory. */
-    system_ram_end_mfn = HYPERVISOR_memory_op(XENMEM_maximum_ram_page, NULL);
-
     *start_pfn_p = start_pfn;
     *max_pfn_p = max_pfn;
 }
diff -r 8fdb8d464ece -r 42ca0ed31aa6 extras/mini-os/include/x86/arch_mm.h
--- a/extras/mini-os/include/x86/arch_mm.h	Mon Oct 08 14:36:29 2012 +0100
+++ b/extras/mini-os/include/x86/arch_mm.h	Mon Oct 08 14:36:30 2012 +0100
@@ -229,6 +229,5 @@ static __inline__ paddr_t machine_to_phy
 #define do_map_zero(start, n) do_map_frames(start, &mfn_zero, n, 0, 0, DOMID_SELF, NULL, L1_PROT_RO)
 
 pgentry_t *need_pgt(unsigned long addr);
-int mfn_is_ram(unsigned long mfn);
 
 #endif /* _ARCH_MM_H_ */

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 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 1TM4Uu-0007tC-0M; Wed, 10 Oct 2012 22:11:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Us-0007pP-Mc
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:22 +0000
Received: from [85.158.139.211:28223] by server-10.bemta-5.messagelabs.com id
	9A/49-06995-A82F5705; Wed, 10 Oct 2012 22:11:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-206.messagelabs.com!1349907081!21832327!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20169 invoked from network); 10 Oct 2012 22:11:21 -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 2012 22:11:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uq-0005zG-Ql
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uq-0000MJ-PS
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:20 +0000
Message-Id: <E1TM4Uq-0000MJ-PS@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: implement VGCF_online
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1349791531 -3600
# Node ID ea1e095a6032ac10b96492b6b6a6904e2bb5a0d6
# Parent  034ea69233fe5f8d35c91ce77920e3f397bd93f4
arm: implement VGCF_online

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


diff -r 034ea69233fe -r ea1e095a6032 tools/libxc/xc_dom_arm.c
--- a/tools/libxc/xc_dom_arm.c	Tue Oct 09 15:05:30 2012 +0100
+++ b/tools/libxc/xc_dom_arm.c	Tue Oct 09 15:05:31 2012 +0100
@@ -101,6 +101,8 @@ static int vcpu_arm(struct xc_dom_image 
 
     ctxt->user_regs.cpsr = PSR_ABT_MASK|PSR_FIQ_MASK|PSR_IRQ_MASK|PSR_MODE_SVC;
 
+    ctxt->flags = VGCF_online;
+
     DOMPRINTF("Initial state CPSR %#"PRIx32" PC %#"PRIx32,
            ctxt->user_regs.cpsr, ctxt->user_regs.pc);
 
diff -r 034ea69233fe -r ea1e095a6032 xen/arch/arm/domain.c
--- a/xen/arch/arm/domain.c	Tue Oct 09 15:05:30 2012 +0100
+++ b/xen/arch/arm/domain.c	Tue Oct 09 15:05:31 2012 +0100
@@ -503,7 +503,10 @@ int arch_set_info_guest(
     v->arch.ttbr1 = ctxt->ttbr1;
     v->arch.ttbcr = ctxt->ttbcr;
 
-    clear_bit(_VPF_down, &v->pause_flags);
+    if ( ctxt->flags & VGCF_online )
+        clear_bit(_VPF_down, &v->pause_flags);
+    else
+        set_bit(_VPF_down, &v->pause_flags);
 
     return 0;
 }
diff -r 034ea69233fe -r ea1e095a6032 xen/include/public/arch-arm.h
--- a/xen/include/public/arch-arm.h	Tue Oct 09 15:05:30 2012 +0100
+++ b/xen/include/public/arch-arm.h	Tue Oct 09 15:05:31 2012 +0100
@@ -125,6 +125,10 @@ typedef uint64_t xen_pfn_t;
 typedef uint32_t xen_ulong_t;
 
 struct vcpu_guest_context {
+#define _VGCF_online                   0
+#define VGCF_online                    (1<<_VGCF_online)
+    uint32_t flags;                         /* VGCF_* */
+
     struct cpu_user_regs user_regs;         /* User-level CPU registers     */
 
     uint32_t sctlr;

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 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 1TM4Ut-0007sk-No; Wed, 10 Oct 2012 22:11:23 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ur-0007lB-Et
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-27.messagelabs.com!1349907074!12242755!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1952 invoked from network); 10 Oct 2012 22:11:15 -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 2012 22:11:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uj-0005yX-TX
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uj-0000Ie-RA
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:13 +0000
Message-Id: <E1TM4Uj-0000Ie-RA@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] minios: Disable the mfn_is_ram()
	check, it doesn't work correctly on all systems
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Matthew Fioravante <matthew.fioravante@jhuapl.edu>
# Date 1349703390 -3600
# Node ID 42ca0ed31aa68293ba9b13e6a3ce9b4c3da97deb
# Parent  8fdb8d464eceaa3ae40000523b873c183c5a09d9
minios: Disable the mfn_is_ram() check, it doesn't work correctly on all systems

This patch disables the mfn_is_ram check in mini-os. The current check
is insufficient and fails on some systems with larger than 4gb memory.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyons.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 8fdb8d464ece -r 42ca0ed31aa6 extras/mini-os/arch/x86/ioremap.c
--- a/extras/mini-os/arch/x86/ioremap.c	Mon Oct 08 14:36:29 2012 +0100
+++ b/extras/mini-os/arch/x86/ioremap.c	Mon Oct 08 14:36:30 2012 +0100
@@ -35,7 +35,6 @@ static void *__do_ioremap(unsigned long 
     unsigned long va;
     unsigned long mfns, mfn;
     unsigned long num_pages, offset;
-    int i;
 
     /* allow non page aligned addresses but for mapping we need to align them */
     offset = (phys_addr & ~PAGE_MASK);
@@ -43,21 +42,9 @@ static void *__do_ioremap(unsigned long 
     phys_addr &= PAGE_MASK;
     mfns = mfn = phys_addr >> PAGE_SHIFT;
     
-    /* sanity checks on list of MFNs */
-    for ( i = 0; i < num_pages; i++, mfn++ )
-    {
-        if ( mfn_is_ram(mfn) )
-        {
-            printk("ioremap: mfn 0x%ulx is RAM\n", mfn);
-            goto mfn_invalid;
-        }
-    }   
     va = (unsigned long)map_frames_ex(&mfns, num_pages, 0, 1, 1,
                                       DOMID_IO, NULL, prot);
     return (void *)(va + offset);
-    
-mfn_invalid:
-    return NULL;
 }
 
 void *ioremap(unsigned long phys_addr, unsigned long size)
diff -r 8fdb8d464ece -r 42ca0ed31aa6 extras/mini-os/arch/x86/mm.c
--- a/extras/mini-os/arch/x86/mm.c	Mon Oct 08 14:36:29 2012 +0100
+++ b/extras/mini-os/arch/x86/mm.c	Mon Oct 08 14:36:30 2012 +0100
@@ -845,18 +845,6 @@ unsigned long alloc_contig_pages(int ord
 }
 
 /*
- * Check if a given MFN refers to real memory
- */
-static long system_ram_end_mfn;
-int mfn_is_ram(unsigned long mfn)
-{
-    /* very crude check if a given MFN is memory or not. Probably should
-     * make this a little more sophisticated ;) */
-    return (mfn <= system_ram_end_mfn) ? 1 : 0;
-}
-
-
-/*
  * Clear some of the bootstrap memory
  */
 static void clear_bootstrap(void)
@@ -951,10 +939,6 @@ void arch_init_mm(unsigned long* start_p
     clear_bootstrap();
     set_readonly(&_text, &_erodata);
 
-    /* get the number of physical pages the system has. Used to check for
-     * system memory. */
-    system_ram_end_mfn = HYPERVISOR_memory_op(XENMEM_maximum_ram_page, NULL);
-
     *start_pfn_p = start_pfn;
     *max_pfn_p = max_pfn;
 }
diff -r 8fdb8d464ece -r 42ca0ed31aa6 extras/mini-os/include/x86/arch_mm.h
--- a/extras/mini-os/include/x86/arch_mm.h	Mon Oct 08 14:36:29 2012 +0100
+++ b/extras/mini-os/include/x86/arch_mm.h	Mon Oct 08 14:36:30 2012 +0100
@@ -229,6 +229,5 @@ static __inline__ paddr_t machine_to_phy
 #define do_map_zero(start, n) do_map_frames(start, &mfn_zero, n, 0, 0, DOMID_SELF, NULL, L1_PROT_RO)
 
 pgentry_t *need_pgt(unsigned long addr);
-int mfn_is_ram(unsigned long mfn);
 
 #endif /* _ARCH_MM_H_ */

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 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 1TM4Ut-0007sz-Sy; Wed, 10 Oct 2012 22:11:23 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Us-0007lM-0T
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1349907073!10466586!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14200 invoked from network); 10 Oct 2012 22:11:14 -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;
	10 Oct 2012 22:11:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ui-0005yR-RJ
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ui-0000IA-Pw
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:12 +0000
Message-Id: <E1TM4Ui-0000IA-Pw@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] minios: Add ioread/iowrite functions
	to mini-os
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Matthew Fioravante <matthew.fioravante@jhuapl.edu>
# Date 1349703388 -3600
# Node ID a797d59e1d2981f892b5d07e8fe87ee27828c10c
# Parent  02e744da52c997de70ebde8d1baaf45dc4399866
minios: Add ioread/iowrite functions to mini-os

This patch adds iowritexx() and ioreadxx() functions for interacting
with hardware memory to mini-os. The functions are available in a header
iorw.h

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyons.org>
Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 02e744da52c9 -r a797d59e1d29 extras/mini-os/arch/x86/iorw.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/mini-os/arch/x86/iorw.c	Mon Oct 08 14:36:28 2012 +0100
@@ -0,0 +1,35 @@
+#include <mini-os/iorw.h>
+
+void iowrite8(volatile void* addr, uint8_t val)
+{
+   *((volatile uint8_t*)addr) = val;
+}
+void iowrite16(volatile void* addr, uint16_t val)
+{
+   *((volatile uint16_t*)addr) = val;
+}
+void iowrite32(volatile void* addr, uint32_t val)
+{
+   *((volatile uint32_t*)addr) = val;
+}
+void iowrite64(volatile void* addr, uint64_t val)
+{
+   *((volatile uint64_t*)addr) = val;
+}
+
+uint8_t ioread8(volatile void* addr)
+{
+   return *((volatile uint8_t*) addr);
+}
+uint16_t ioread16(volatile void* addr)
+{
+   return *((volatile uint16_t*) addr);
+}
+uint32_t ioread32(volatile void* addr)
+{
+   return *((volatile uint32_t*) addr);
+}
+uint64_t ioread64(volatile void* addr)
+{
+   return *((volatile uint64_t*) addr);
+}
diff -r 02e744da52c9 -r a797d59e1d29 extras/mini-os/include/iorw.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/mini-os/include/iorw.h	Mon Oct 08 14:36:28 2012 +0100
@@ -0,0 +1,16 @@
+#ifndef MINIOS_IORW_H
+#define MINIOS_IORW_H
+
+#include <mini-os/types.h>
+
+void iowrite8(volatile void* addr, uint8_t val);
+void iowrite16(volatile void* addr, uint16_t val);
+void iowrite32(volatile void* addr, uint32_t val);
+void iowrite64(volatile void* addr, uint64_t val);
+
+uint8_t ioread8(volatile void* addr);
+uint16_t ioread16(volatile void* addr);
+uint32_t ioread32(volatile void* addr);
+uint64_t ioread64(volatile void* addr);
+
+#endif

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 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 1TM4Uu-0007tC-0M; Wed, 10 Oct 2012 22:11:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Us-0007pP-Mc
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:22 +0000
Received: from [85.158.139.211:28223] by server-10.bemta-5.messagelabs.com id
	9A/49-06995-A82F5705; Wed, 10 Oct 2012 22:11:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-206.messagelabs.com!1349907081!21832327!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20169 invoked from network); 10 Oct 2012 22:11:21 -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 2012 22:11:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uq-0005zG-Ql
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uq-0000MJ-PS
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:20 +0000
Message-Id: <E1TM4Uq-0000MJ-PS@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: implement VGCF_online
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1349791531 -3600
# Node ID ea1e095a6032ac10b96492b6b6a6904e2bb5a0d6
# Parent  034ea69233fe5f8d35c91ce77920e3f397bd93f4
arm: implement VGCF_online

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


diff -r 034ea69233fe -r ea1e095a6032 tools/libxc/xc_dom_arm.c
--- a/tools/libxc/xc_dom_arm.c	Tue Oct 09 15:05:30 2012 +0100
+++ b/tools/libxc/xc_dom_arm.c	Tue Oct 09 15:05:31 2012 +0100
@@ -101,6 +101,8 @@ static int vcpu_arm(struct xc_dom_image 
 
     ctxt->user_regs.cpsr = PSR_ABT_MASK|PSR_FIQ_MASK|PSR_IRQ_MASK|PSR_MODE_SVC;
 
+    ctxt->flags = VGCF_online;
+
     DOMPRINTF("Initial state CPSR %#"PRIx32" PC %#"PRIx32,
            ctxt->user_regs.cpsr, ctxt->user_regs.pc);
 
diff -r 034ea69233fe -r ea1e095a6032 xen/arch/arm/domain.c
--- a/xen/arch/arm/domain.c	Tue Oct 09 15:05:30 2012 +0100
+++ b/xen/arch/arm/domain.c	Tue Oct 09 15:05:31 2012 +0100
@@ -503,7 +503,10 @@ int arch_set_info_guest(
     v->arch.ttbr1 = ctxt->ttbr1;
     v->arch.ttbcr = ctxt->ttbcr;
 
-    clear_bit(_VPF_down, &v->pause_flags);
+    if ( ctxt->flags & VGCF_online )
+        clear_bit(_VPF_down, &v->pause_flags);
+    else
+        set_bit(_VPF_down, &v->pause_flags);
 
     return 0;
 }
diff -r 034ea69233fe -r ea1e095a6032 xen/include/public/arch-arm.h
--- a/xen/include/public/arch-arm.h	Tue Oct 09 15:05:30 2012 +0100
+++ b/xen/include/public/arch-arm.h	Tue Oct 09 15:05:31 2012 +0100
@@ -125,6 +125,10 @@ typedef uint64_t xen_pfn_t;
 typedef uint32_t xen_ulong_t;
 
 struct vcpu_guest_context {
+#define _VGCF_online                   0
+#define VGCF_online                    (1<<_VGCF_online)
+    uint32_t flags;                         /* VGCF_* */
+
     struct cpu_user_regs user_regs;         /* User-level CPU registers     */
 
     uint32_t sctlr;

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 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 1TM4Ut-0007sz-Sy; Wed, 10 Oct 2012 22:11:23 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Us-0007lM-0T
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1349907073!10466586!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14200 invoked from network); 10 Oct 2012 22:11:14 -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;
	10 Oct 2012 22:11:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ui-0005yR-RJ
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ui-0000IA-Pw
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:12 +0000
Message-Id: <E1TM4Ui-0000IA-Pw@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] minios: Add ioread/iowrite functions
	to mini-os
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Matthew Fioravante <matthew.fioravante@jhuapl.edu>
# Date 1349703388 -3600
# Node ID a797d59e1d2981f892b5d07e8fe87ee27828c10c
# Parent  02e744da52c997de70ebde8d1baaf45dc4399866
minios: Add ioread/iowrite functions to mini-os

This patch adds iowritexx() and ioreadxx() functions for interacting
with hardware memory to mini-os. The functions are available in a header
iorw.h

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyons.org>
Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 02e744da52c9 -r a797d59e1d29 extras/mini-os/arch/x86/iorw.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/mini-os/arch/x86/iorw.c	Mon Oct 08 14:36:28 2012 +0100
@@ -0,0 +1,35 @@
+#include <mini-os/iorw.h>
+
+void iowrite8(volatile void* addr, uint8_t val)
+{
+   *((volatile uint8_t*)addr) = val;
+}
+void iowrite16(volatile void* addr, uint16_t val)
+{
+   *((volatile uint16_t*)addr) = val;
+}
+void iowrite32(volatile void* addr, uint32_t val)
+{
+   *((volatile uint32_t*)addr) = val;
+}
+void iowrite64(volatile void* addr, uint64_t val)
+{
+   *((volatile uint64_t*)addr) = val;
+}
+
+uint8_t ioread8(volatile void* addr)
+{
+   return *((volatile uint8_t*) addr);
+}
+uint16_t ioread16(volatile void* addr)
+{
+   return *((volatile uint16_t*) addr);
+}
+uint32_t ioread32(volatile void* addr)
+{
+   return *((volatile uint32_t*) addr);
+}
+uint64_t ioread64(volatile void* addr)
+{
+   return *((volatile uint64_t*) addr);
+}
diff -r 02e744da52c9 -r a797d59e1d29 extras/mini-os/include/iorw.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/mini-os/include/iorw.h	Mon Oct 08 14:36:28 2012 +0100
@@ -0,0 +1,16 @@
+#ifndef MINIOS_IORW_H
+#define MINIOS_IORW_H
+
+#include <mini-os/types.h>
+
+void iowrite8(volatile void* addr, uint8_t val);
+void iowrite16(volatile void* addr, uint16_t val);
+void iowrite32(volatile void* addr, uint32_t val);
+void iowrite64(volatile void* addr, uint64_t val);
+
+uint8_t ioread8(volatile void* addr);
+uint16_t ioread16(volatile void* addr);
+uint32_t ioread32(volatile void* addr);
+uint64_t ioread64(volatile void* addr);
+
+#endif

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 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 1TM4Uu-0007tL-4q; Wed, 10 Oct 2012 22:11:24 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ut-0007ln-BI
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-27.messagelabs.com!1349907075!4913363!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4749 invoked from network); 10 Oct 2012 22:11: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;
	10 Oct 2012 22:11:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ul-0005yg-Ew
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ul-0000JN-CZ
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:15 +0000
Message-Id: <E1TM4Ul-0000JN-CZ@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] pygrub: correct typo in --args
	assignment
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1349770722 -3600
# Node ID ecc7627ca6d76a068341c7a115fe8e8acc7a9217
# Parent  c9f621893a05e3e447ba6770f8ae912721712569
pygrub: correct typo in --args assignment

If pygrub was called with --args="some thing", then this string should
be append to the kernel command line.  But the last changeset
25941:795c493fe561 contained a typo, it assigns 'args' instead of 'arg'.

Rename the local variable which holds the string from the domain config
file to avoid further confusion.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r c9f621893a05 -r ecc7627ca6d7 tools/pygrub/src/pygrub
--- a/tools/pygrub/src/pygrub	Mon Oct 08 14:36:31 2012 +0100
+++ b/tools/pygrub/src/pygrub	Tue Oct 09 09:18:42 2012 +0100
@@ -585,7 +585,7 @@ def get_entry_idx(cf, entry):
 
     return None
 
-def run_grub(file, entry, fs, arg):
+def run_grub(file, entry, fs, cfg_args):
     global g
     global sel
 
@@ -622,8 +622,8 @@ def run_grub(file, entry, fs, arg):
         grubcfg["ramdisk"] = img.initrd[1]
     if img.args:
         grubcfg["args"] += img.args
-    if arg:
-        grubcfg["args"] += " " + args
+    if cfg_args:
+        grubcfg["args"] += " " + cfg_args
 
     return grubcfg
 

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 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 1TM4Uu-0007tL-4q; Wed, 10 Oct 2012 22:11:24 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ut-0007ln-BI
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-27.messagelabs.com!1349907075!4913363!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4749 invoked from network); 10 Oct 2012 22:11: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;
	10 Oct 2012 22:11:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ul-0005yg-Ew
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ul-0000JN-CZ
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:15 +0000
Message-Id: <E1TM4Ul-0000JN-CZ@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] pygrub: correct typo in --args
	assignment
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1349770722 -3600
# Node ID ecc7627ca6d76a068341c7a115fe8e8acc7a9217
# Parent  c9f621893a05e3e447ba6770f8ae912721712569
pygrub: correct typo in --args assignment

If pygrub was called with --args="some thing", then this string should
be append to the kernel command line.  But the last changeset
25941:795c493fe561 contained a typo, it assigns 'args' instead of 'arg'.

Rename the local variable which holds the string from the domain config
file to avoid further confusion.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r c9f621893a05 -r ecc7627ca6d7 tools/pygrub/src/pygrub
--- a/tools/pygrub/src/pygrub	Mon Oct 08 14:36:31 2012 +0100
+++ b/tools/pygrub/src/pygrub	Tue Oct 09 09:18:42 2012 +0100
@@ -585,7 +585,7 @@ def get_entry_idx(cf, entry):
 
     return None
 
-def run_grub(file, entry, fs, arg):
+def run_grub(file, entry, fs, cfg_args):
     global g
     global sel
 
@@ -622,8 +622,8 @@ def run_grub(file, entry, fs, arg):
         grubcfg["ramdisk"] = img.initrd[1]
     if img.args:
         grubcfg["args"] += img.args
-    if arg:
-        grubcfg["args"] += " " + args
+    if cfg_args:
+        grubcfg["args"] += " " + cfg_args
 
     return grubcfg
 

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22: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 1TM4Uv-0007vi-7u; Wed, 10 Oct 2012 22:11:25 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ut-0007o5-RH
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:23 +0000
Received: from [85.158.143.99:42948] by server-3.bemta-4.messagelabs.com id
	EC/A9-10075-B82F5705; Wed, 10 Oct 2012 22:11:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-216.messagelabs.com!1349907082!25456379!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27186 invoked from network); 10 Oct 2012 22:11:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ur-0005zX-Rw
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ur-0000Mn-QO
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:21 +0000
Message-Id: <E1TM4Ur-0000Mn-QO@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen/arm: implement get/put_page_type
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1349791533 -3600
# Node ID b98da9b014141929a02a2ea679bf7f5c6edcf7f4
# Parent  e6806ba46527ea2f163808ec4a7e17fad29bc550
xen/arm: implement get/put_page_type

Add a basic get_page_type and put_page_type implementation: we don't
care about typecounts so just return success.

Also remove PGT_shared_page, that is unused.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r e6806ba46527 -r b98da9b01414 xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Tue Oct 09 15:05:32 2012 +0100
+++ b/xen/arch/arm/dummy.S	Tue Oct 09 15:05:33 2012 +0100
@@ -22,10 +22,6 @@ DUMMY(arch_get_info_guest);
 DUMMY(arch_vcpu_reset);
 NOP(update_vcpu_system_time);
 
-/* Page Reference & Type Maintenance */
-DUMMY(get_page_type);
-DUMMY(put_page_type);
-
 /* Grant Tables */
 DUMMY(steal_page);
 
diff -r e6806ba46527 -r b98da9b01414 xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c	Tue Oct 09 15:05:32 2012 +0100
+++ b/xen/arch/arm/mm.c	Tue Oct 09 15:05:33 2012 +0100
@@ -574,6 +574,19 @@ int get_page(struct page_info *page, str
     return 0;
 }
 
+/* Common code requires get_page_type and put_page_type.
+ * We don't care about typecounts so we just do the minimum to make it
+ * happy. */
+int get_page_type(struct page_info *page, unsigned long type)
+{
+    return 1;
+}
+
+void put_page_type(struct page_info *page)
+{
+    return;
+}
+
 void gnttab_clear_flag(unsigned long nr, uint16_t *addr)
 {
     /*
diff -r e6806ba46527 -r b98da9b01414 xen/include/asm-arm/mm.h
--- a/xen/include/asm-arm/mm.h	Tue Oct 09 15:05:32 2012 +0100
+++ b/xen/include/asm-arm/mm.h	Tue Oct 09 15:05:33 2012 +0100
@@ -71,7 +71,6 @@ struct page_info
 
 #define PGT_none          PG_mask(0, 4)  /* no special uses of this page   */
 #define PGT_writable_page PG_mask(7, 4)  /* has writable mappings?         */
-#define PGT_shared_page   PG_mask(8, 4)  /* CoW sharable page              */
 #define PGT_type_mask     PG_mask(15, 4) /* Bits 28-31 or 60-63.           */
 
  /* Owning guest has pinned this page to its current type? */

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22: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 1TM4Uv-0007vi-7u; Wed, 10 Oct 2012 22:11:25 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ut-0007o5-RH
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:23 +0000
Received: from [85.158.143.99:42948] by server-3.bemta-4.messagelabs.com id
	EC/A9-10075-B82F5705; Wed, 10 Oct 2012 22:11:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-216.messagelabs.com!1349907082!25456379!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27186 invoked from network); 10 Oct 2012 22:11:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ur-0005zX-Rw
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ur-0000Mn-QO
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:21 +0000
Message-Id: <E1TM4Ur-0000Mn-QO@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen/arm: implement get/put_page_type
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1349791533 -3600
# Node ID b98da9b014141929a02a2ea679bf7f5c6edcf7f4
# Parent  e6806ba46527ea2f163808ec4a7e17fad29bc550
xen/arm: implement get/put_page_type

Add a basic get_page_type and put_page_type implementation: we don't
care about typecounts so just return success.

Also remove PGT_shared_page, that is unused.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r e6806ba46527 -r b98da9b01414 xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Tue Oct 09 15:05:32 2012 +0100
+++ b/xen/arch/arm/dummy.S	Tue Oct 09 15:05:33 2012 +0100
@@ -22,10 +22,6 @@ DUMMY(arch_get_info_guest);
 DUMMY(arch_vcpu_reset);
 NOP(update_vcpu_system_time);
 
-/* Page Reference & Type Maintenance */
-DUMMY(get_page_type);
-DUMMY(put_page_type);
-
 /* Grant Tables */
 DUMMY(steal_page);
 
diff -r e6806ba46527 -r b98da9b01414 xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c	Tue Oct 09 15:05:32 2012 +0100
+++ b/xen/arch/arm/mm.c	Tue Oct 09 15:05:33 2012 +0100
@@ -574,6 +574,19 @@ int get_page(struct page_info *page, str
     return 0;
 }
 
+/* Common code requires get_page_type and put_page_type.
+ * We don't care about typecounts so we just do the minimum to make it
+ * happy. */
+int get_page_type(struct page_info *page, unsigned long type)
+{
+    return 1;
+}
+
+void put_page_type(struct page_info *page)
+{
+    return;
+}
+
 void gnttab_clear_flag(unsigned long nr, uint16_t *addr)
 {
     /*
diff -r e6806ba46527 -r b98da9b01414 xen/include/asm-arm/mm.h
--- a/xen/include/asm-arm/mm.h	Tue Oct 09 15:05:32 2012 +0100
+++ b/xen/include/asm-arm/mm.h	Tue Oct 09 15:05:33 2012 +0100
@@ -71,7 +71,6 @@ struct page_info
 
 #define PGT_none          PG_mask(0, 4)  /* no special uses of this page   */
 #define PGT_writable_page PG_mask(7, 4)  /* has writable mappings?         */
-#define PGT_shared_page   PG_mask(8, 4)  /* CoW sharable page              */
 #define PGT_type_mask     PG_mask(15, 4) /* Bits 28-31 or 60-63.           */
 
  /* Owning guest has pinned this page to its current type? */

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22: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 1TM4Uv-0007vx-Bm; Wed, 10 Oct 2012 22:11:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uu-0007sY-4S
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:24 +0000
Received: from [85.158.139.211:28255] by server-15.bemta-5.messagelabs.com id
	38/76-27811-B82F5705; Wed, 10 Oct 2012 22:11:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-206.messagelabs.com!1349907081!21833135!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23382 invoked from network); 10 Oct 2012 22:11:22 -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;
	10 Oct 2012 22:11:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ur-0005zO-Be
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ur-0000MY-AH
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:21 +0000
Message-Id: <E1TM4Ur-0000MY-AH@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen/arm: implement page reference
	and gnttab functions needed by grant_table.c
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1349791532 -3600
# Node ID e6806ba46527ea2f163808ec4a7e17fad29bc550
# Parent  ea1e095a6032ac10b96492b6b6a6904e2bb5a0d6
xen/arm: implement page reference and gnttab functions needed by grant_table.c

The implementation is strongly "inspired" by their x86 counterparts,
except that we assume paging_mode_external and paging_mode_translate.

TODO: read_only mappings and gnttab_mark_dirty.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r ea1e095a6032 -r e6806ba46527 xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Tue Oct 09 15:05:31 2012 +0100
+++ b/xen/arch/arm/dummy.S	Tue Oct 09 15:05:32 2012 +0100
@@ -23,18 +23,10 @@ DUMMY(arch_vcpu_reset);
 NOP(update_vcpu_system_time);
 
 /* Page Reference & Type Maintenance */
-DUMMY(get_page);
 DUMMY(get_page_type);
-DUMMY(page_get_owner_and_reference);
-DUMMY(put_page);
 DUMMY(put_page_type);
 
 /* Grant Tables */
-DUMMY(create_grant_host_mapping);
-DUMMY(gnttab_clear_flag);
-DUMMY(gnttab_mark_dirty);
-DUMMY(is_iomem_page);
-DUMMY(replace_grant_host_mapping);
 DUMMY(steal_page);
 
 /* Page Offlining */
@@ -45,7 +37,6 @@ DUMMY(domain_get_maximum_gpfn);
 DUMMY(domain_relinquish_resources);
 DUMMY(domain_set_time_offset);
 DUMMY(dom_cow);
-DUMMY(gmfn_to_mfn);
 DUMMY(send_timer_event);
 DUMMY(share_xen_page_with_privileged_guests);
 DUMMY(wallclock_time);
diff -r ea1e095a6032 -r e6806ba46527 xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c	Tue Oct 09 15:05:31 2012 +0100
+++ b/xen/arch/arm/mm.c	Tue Oct 09 15:05:32 2012 +0100
@@ -525,6 +525,121 @@ long arch_memory_op(int op, XEN_GUEST_HA
 
     return 0;
 }
+
+struct domain *page_get_owner_and_reference(struct page_info *page)
+{
+    unsigned long x, y = page->count_info;
+
+    do {
+        x = y;
+        /*
+         * Count ==  0: Page is not allocated, so we cannot take a reference.
+         * Count == -1: Reference count would wrap, which is invalid.
+         */
+        if ( unlikely(((x + 1) & PGC_count_mask) <= 1) )
+            return NULL;
+    }
+    while ( (y = cmpxchg(&page->count_info, x, x + 1)) != x );
+
+    return page_get_owner(page);
+}
+
+void put_page(struct page_info *page)
+{
+    unsigned long nx, x, y = page->count_info;
+
+    do {
+        ASSERT((y & PGC_count_mask) != 0);
+        x  = y;
+        nx = x - 1;
+    }
+    while ( unlikely((y = cmpxchg(&page->count_info, x, nx)) != x) );
+
+    if ( unlikely((nx & PGC_count_mask) == 0) )
+    {
+        free_domheap_page(page);
+    }
+}
+
+int get_page(struct page_info *page, struct domain *domain)
+{
+    struct domain *owner = page_get_owner_and_reference(page);
+
+    if ( likely(owner == domain) )
+        return 1;
+
+    if ( owner != NULL )
+        put_page(page);
+
+    return 0;
+}
+
+void gnttab_clear_flag(unsigned long nr, uint16_t *addr)
+{
+    /*
+     * Note that this cannot be clear_bit(), as the access must be
+     * confined to the specified 2 bytes.
+     */
+    uint16_t mask = ~(1 << nr), old;
+
+    do {
+        old = *addr;
+    } while (cmpxchg(addr, old, old & mask) != old);
+}
+
+void gnttab_mark_dirty(struct domain *d, unsigned long l)
+{
+    /* XXX: mark dirty */
+    static int warning;
+    if (!warning) {
+        gdprintk(XENLOG_WARNING, "gnttab_mark_dirty not implemented yet\n");
+        warning = 1;
+    }
+}
+
+int create_grant_host_mapping(unsigned long addr, unsigned long frame,
+                              unsigned int flags, unsigned int cache_flags)
+{
+    int rc;
+
+    if ( cache_flags  || (flags & ~GNTMAP_readonly) != GNTMAP_host_map )
+        return GNTST_general_error;
+
+    /* XXX: read only mappings */
+    if ( flags & GNTMAP_readonly )
+    {
+        gdprintk(XENLOG_WARNING, "read only mappings not implemented yet\n");
+        return GNTST_general_error;
+    }
+
+    rc = guest_physmap_add_page(current->domain,
+                                 addr >> PAGE_SHIFT, frame, 0);
+    if ( rc )
+        return GNTST_general_error;
+    else
+        return GNTST_okay;
+}
+
+int replace_grant_host_mapping(unsigned long addr, unsigned long mfn,
+        unsigned long new_addr, unsigned int flags)
+{
+    unsigned long gfn = (unsigned long)(addr >> PAGE_SHIFT);
+    struct domain *d = current->domain;
+
+    if ( new_addr != 0 || (flags & GNTMAP_contains_pte) )
+        return GNTST_general_error;
+
+    guest_physmap_remove_page(d, gfn, mfn, 0);
+
+    return GNTST_okay;
+}
+
+int is_iomem_page(unsigned long mfn)
+{
+    if ( !mfn_valid(mfn) )
+        return 1;
+    return 0;
+}
 /*
  * Local variables:
  * mode: C
diff -r ea1e095a6032 -r e6806ba46527 xen/arch/arm/p2m.c
--- a/xen/arch/arm/p2m.c	Tue Oct 09 15:05:31 2012 +0100
+++ b/xen/arch/arm/p2m.c	Tue Oct 09 15:05:32 2012 +0100
@@ -120,8 +120,14 @@ static int p2m_create_table(struct domai
     return 0;
 }
 
+enum p2m_operation {
+    INSERT,
+    ALLOCATE,
+    REMOVE
+};
+
 static int create_p2m_entries(struct domain *d,
-                     int alloc,
+                     enum p2m_operation op,
                      paddr_t start_gpaddr,
                      paddr_t end_gpaddr,
                      paddr_t maddr,
@@ -191,25 +197,39 @@ static int create_p2m_entries(struct dom
         }
 
         /* Allocate a new RAM page and attach */
-        if (alloc)
-        {
-            struct page_info *page;
-            lpae_t pte;
+        switch (op) {
+            case ALLOCATE:
+                {
+                    struct page_info *page;
+                    lpae_t pte;
 
-            rc = -ENOMEM;
-            page = alloc_domheap_page(d, 0);
-            if ( page == NULL ) {
-                printk("p2m_populate_ram: failed to allocate page\n");
-                goto out;
-            }
+                    rc = -ENOMEM;
+                    page = alloc_domheap_page(d, 0);
+                    if ( page == NULL ) {
+                        printk("p2m_populate_ram: failed to allocate page\n");
+                        goto out;
+                    }
 
-            pte = mfn_to_p2m_entry(page_to_mfn(page), mattr);
+                    pte = mfn_to_p2m_entry(page_to_mfn(page), mattr);
 
-            write_pte(&third[third_table_offset(addr)], pte);
-        } else {
-            lpae_t pte = mfn_to_p2m_entry(maddr >> PAGE_SHIFT, mattr);
-            write_pte(&third[third_table_offset(addr)], pte);
-            maddr += PAGE_SIZE;
+                    write_pte(&third[third_table_offset(addr)], pte);
+                }
+                break;
+            case INSERT:
+                {
+                    lpae_t pte = mfn_to_p2m_entry(maddr >> PAGE_SHIFT, mattr);
+                    write_pte(&third[third_table_offset(addr)], pte);
+                    maddr += PAGE_SIZE;
+                }
+                break;
+            case REMOVE:
+                {
+                    lpae_t pte;
+                    memset(&pte, 0x00, sizeof(pte));
+                    write_pte(&third[third_table_offset(addr)], pte);
+                    maddr += PAGE_SIZE;
+                }
+                break;
         }
     }
 
@@ -229,7 +249,7 @@ int p2m_populate_ram(struct domain *d,
                      paddr_t start,
                      paddr_t end)
 {
-    return create_p2m_entries(d, 1, start, end, 0, MATTR_MEM);
+    return create_p2m_entries(d, ALLOCATE, start, end, 0, MATTR_MEM);
 }
 
 int map_mmio_regions(struct domain *d,
@@ -237,7 +257,7 @@ int map_mmio_regions(struct domain *d,
                      paddr_t end_gaddr,
                      paddr_t maddr)
 {
-    return create_p2m_entries(d, 0, start_gaddr, end_gaddr, maddr, MATTR_DEV);
+    return create_p2m_entries(d, INSERT, start_gaddr, end_gaddr, maddr, MATTR_DEV);
 }
 
 int guest_physmap_add_page(struct domain *d,
@@ -245,7 +265,7 @@ int guest_physmap_add_page(struct domain
                            unsigned long mfn,
                            unsigned int page_order)
 {
-    return create_p2m_entries(d, 0, gpfn << PAGE_SHIFT,
+    return create_p2m_entries(d, INSERT, gpfn << PAGE_SHIFT,
                               (gpfn + (1<<page_order)) << PAGE_SHIFT,
                               mfn << PAGE_SHIFT, MATTR_MEM);
 }
@@ -254,7 +274,9 @@ void guest_physmap_remove_page(struct do
                                unsigned long gpfn,
                                unsigned long mfn, unsigned int page_order)
 {
-    ASSERT(0);
+    create_p2m_entries(d, REMOVE, gpfn << PAGE_SHIFT,
+                       (gpfn + (1<<page_order)) << PAGE_SHIFT,
+                       mfn << PAGE_SHIFT, MATTR_MEM);
 }
 
 int p2m_alloc_table(struct domain *d)
@@ -318,6 +340,13 @@ int p2m_init(struct domain *d)
 
     return 0;
 }
+
+unsigned long gmfn_to_mfn(struct domain *d, unsigned long gpfn)
+{
+    paddr_t p = p2m_lookup(d, gpfn << PAGE_SHIFT);
+    return p >> PAGE_SHIFT;
+}
+
 /*
  * Local variables:
  * mode: C

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22: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 1TM4Uv-0007vx-Bm; Wed, 10 Oct 2012 22:11:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uu-0007sY-4S
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:24 +0000
Received: from [85.158.139.211:28255] by server-15.bemta-5.messagelabs.com id
	38/76-27811-B82F5705; Wed, 10 Oct 2012 22:11:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-206.messagelabs.com!1349907081!21833135!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23382 invoked from network); 10 Oct 2012 22:11:22 -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;
	10 Oct 2012 22:11:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ur-0005zO-Be
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ur-0000MY-AH
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:21 +0000
Message-Id: <E1TM4Ur-0000MY-AH@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen/arm: implement page reference
	and gnttab functions needed by grant_table.c
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1349791532 -3600
# Node ID e6806ba46527ea2f163808ec4a7e17fad29bc550
# Parent  ea1e095a6032ac10b96492b6b6a6904e2bb5a0d6
xen/arm: implement page reference and gnttab functions needed by grant_table.c

The implementation is strongly "inspired" by their x86 counterparts,
except that we assume paging_mode_external and paging_mode_translate.

TODO: read_only mappings and gnttab_mark_dirty.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r ea1e095a6032 -r e6806ba46527 xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Tue Oct 09 15:05:31 2012 +0100
+++ b/xen/arch/arm/dummy.S	Tue Oct 09 15:05:32 2012 +0100
@@ -23,18 +23,10 @@ DUMMY(arch_vcpu_reset);
 NOP(update_vcpu_system_time);
 
 /* Page Reference & Type Maintenance */
-DUMMY(get_page);
 DUMMY(get_page_type);
-DUMMY(page_get_owner_and_reference);
-DUMMY(put_page);
 DUMMY(put_page_type);
 
 /* Grant Tables */
-DUMMY(create_grant_host_mapping);
-DUMMY(gnttab_clear_flag);
-DUMMY(gnttab_mark_dirty);
-DUMMY(is_iomem_page);
-DUMMY(replace_grant_host_mapping);
 DUMMY(steal_page);
 
 /* Page Offlining */
@@ -45,7 +37,6 @@ DUMMY(domain_get_maximum_gpfn);
 DUMMY(domain_relinquish_resources);
 DUMMY(domain_set_time_offset);
 DUMMY(dom_cow);
-DUMMY(gmfn_to_mfn);
 DUMMY(send_timer_event);
 DUMMY(share_xen_page_with_privileged_guests);
 DUMMY(wallclock_time);
diff -r ea1e095a6032 -r e6806ba46527 xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c	Tue Oct 09 15:05:31 2012 +0100
+++ b/xen/arch/arm/mm.c	Tue Oct 09 15:05:32 2012 +0100
@@ -525,6 +525,121 @@ long arch_memory_op(int op, XEN_GUEST_HA
 
     return 0;
 }
+
+struct domain *page_get_owner_and_reference(struct page_info *page)
+{
+    unsigned long x, y = page->count_info;
+
+    do {
+        x = y;
+        /*
+         * Count ==  0: Page is not allocated, so we cannot take a reference.
+         * Count == -1: Reference count would wrap, which is invalid.
+         */
+        if ( unlikely(((x + 1) & PGC_count_mask) <= 1) )
+            return NULL;
+    }
+    while ( (y = cmpxchg(&page->count_info, x, x + 1)) != x );
+
+    return page_get_owner(page);
+}
+
+void put_page(struct page_info *page)
+{
+    unsigned long nx, x, y = page->count_info;
+
+    do {
+        ASSERT((y & PGC_count_mask) != 0);
+        x  = y;
+        nx = x - 1;
+    }
+    while ( unlikely((y = cmpxchg(&page->count_info, x, nx)) != x) );
+
+    if ( unlikely((nx & PGC_count_mask) == 0) )
+    {
+        free_domheap_page(page);
+    }
+}
+
+int get_page(struct page_info *page, struct domain *domain)
+{
+    struct domain *owner = page_get_owner_and_reference(page);
+
+    if ( likely(owner == domain) )
+        return 1;
+
+    if ( owner != NULL )
+        put_page(page);
+
+    return 0;
+}
+
+void gnttab_clear_flag(unsigned long nr, uint16_t *addr)
+{
+    /*
+     * Note that this cannot be clear_bit(), as the access must be
+     * confined to the specified 2 bytes.
+     */
+    uint16_t mask = ~(1 << nr), old;
+
+    do {
+        old = *addr;
+    } while (cmpxchg(addr, old, old & mask) != old);
+}
+
+void gnttab_mark_dirty(struct domain *d, unsigned long l)
+{
+    /* XXX: mark dirty */
+    static int warning;
+    if (!warning) {
+        gdprintk(XENLOG_WARNING, "gnttab_mark_dirty not implemented yet\n");
+        warning = 1;
+    }
+}
+
+int create_grant_host_mapping(unsigned long addr, unsigned long frame,
+                              unsigned int flags, unsigned int cache_flags)
+{
+    int rc;
+
+    if ( cache_flags  || (flags & ~GNTMAP_readonly) != GNTMAP_host_map )
+        return GNTST_general_error;
+
+    /* XXX: read only mappings */
+    if ( flags & GNTMAP_readonly )
+    {
+        gdprintk(XENLOG_WARNING, "read only mappings not implemented yet\n");
+        return GNTST_general_error;
+    }
+
+    rc = guest_physmap_add_page(current->domain,
+                                 addr >> PAGE_SHIFT, frame, 0);
+    if ( rc )
+        return GNTST_general_error;
+    else
+        return GNTST_okay;
+}
+
+int replace_grant_host_mapping(unsigned long addr, unsigned long mfn,
+        unsigned long new_addr, unsigned int flags)
+{
+    unsigned long gfn = (unsigned long)(addr >> PAGE_SHIFT);
+    struct domain *d = current->domain;
+
+    if ( new_addr != 0 || (flags & GNTMAP_contains_pte) )
+        return GNTST_general_error;
+
+    guest_physmap_remove_page(d, gfn, mfn, 0);
+
+    return GNTST_okay;
+}
+
+int is_iomem_page(unsigned long mfn)
+{
+    if ( !mfn_valid(mfn) )
+        return 1;
+    return 0;
+}
 /*
  * Local variables:
  * mode: C
diff -r ea1e095a6032 -r e6806ba46527 xen/arch/arm/p2m.c
--- a/xen/arch/arm/p2m.c	Tue Oct 09 15:05:31 2012 +0100
+++ b/xen/arch/arm/p2m.c	Tue Oct 09 15:05:32 2012 +0100
@@ -120,8 +120,14 @@ static int p2m_create_table(struct domai
     return 0;
 }
 
+enum p2m_operation {
+    INSERT,
+    ALLOCATE,
+    REMOVE
+};
+
 static int create_p2m_entries(struct domain *d,
-                     int alloc,
+                     enum p2m_operation op,
                      paddr_t start_gpaddr,
                      paddr_t end_gpaddr,
                      paddr_t maddr,
@@ -191,25 +197,39 @@ static int create_p2m_entries(struct dom
         }
 
         /* Allocate a new RAM page and attach */
-        if (alloc)
-        {
-            struct page_info *page;
-            lpae_t pte;
+        switch (op) {
+            case ALLOCATE:
+                {
+                    struct page_info *page;
+                    lpae_t pte;
 
-            rc = -ENOMEM;
-            page = alloc_domheap_page(d, 0);
-            if ( page == NULL ) {
-                printk("p2m_populate_ram: failed to allocate page\n");
-                goto out;
-            }
+                    rc = -ENOMEM;
+                    page = alloc_domheap_page(d, 0);
+                    if ( page == NULL ) {
+                        printk("p2m_populate_ram: failed to allocate page\n");
+                        goto out;
+                    }
 
-            pte = mfn_to_p2m_entry(page_to_mfn(page), mattr);
+                    pte = mfn_to_p2m_entry(page_to_mfn(page), mattr);
 
-            write_pte(&third[third_table_offset(addr)], pte);
-        } else {
-            lpae_t pte = mfn_to_p2m_entry(maddr >> PAGE_SHIFT, mattr);
-            write_pte(&third[third_table_offset(addr)], pte);
-            maddr += PAGE_SIZE;
+                    write_pte(&third[third_table_offset(addr)], pte);
+                }
+                break;
+            case INSERT:
+                {
+                    lpae_t pte = mfn_to_p2m_entry(maddr >> PAGE_SHIFT, mattr);
+                    write_pte(&third[third_table_offset(addr)], pte);
+                    maddr += PAGE_SIZE;
+                }
+                break;
+            case REMOVE:
+                {
+                    lpae_t pte;
+                    memset(&pte, 0x00, sizeof(pte));
+                    write_pte(&third[third_table_offset(addr)], pte);
+                    maddr += PAGE_SIZE;
+                }
+                break;
         }
     }
 
@@ -229,7 +249,7 @@ int p2m_populate_ram(struct domain *d,
                      paddr_t start,
                      paddr_t end)
 {
-    return create_p2m_entries(d, 1, start, end, 0, MATTR_MEM);
+    return create_p2m_entries(d, ALLOCATE, start, end, 0, MATTR_MEM);
 }
 
 int map_mmio_regions(struct domain *d,
@@ -237,7 +257,7 @@ int map_mmio_regions(struct domain *d,
                      paddr_t end_gaddr,
                      paddr_t maddr)
 {
-    return create_p2m_entries(d, 0, start_gaddr, end_gaddr, maddr, MATTR_DEV);
+    return create_p2m_entries(d, INSERT, start_gaddr, end_gaddr, maddr, MATTR_DEV);
 }
 
 int guest_physmap_add_page(struct domain *d,
@@ -245,7 +265,7 @@ int guest_physmap_add_page(struct domain
                            unsigned long mfn,
                            unsigned int page_order)
 {
-    return create_p2m_entries(d, 0, gpfn << PAGE_SHIFT,
+    return create_p2m_entries(d, INSERT, gpfn << PAGE_SHIFT,
                               (gpfn + (1<<page_order)) << PAGE_SHIFT,
                               mfn << PAGE_SHIFT, MATTR_MEM);
 }
@@ -254,7 +274,9 @@ void guest_physmap_remove_page(struct do
                                unsigned long gpfn,
                                unsigned long mfn, unsigned int page_order)
 {
-    ASSERT(0);
+    create_p2m_entries(d, REMOVE, gpfn << PAGE_SHIFT,
+                       (gpfn + (1<<page_order)) << PAGE_SHIFT,
+                       mfn << PAGE_SHIFT, MATTR_MEM);
 }
 
 int p2m_alloc_table(struct domain *d)
@@ -318,6 +340,13 @@ int p2m_init(struct domain *d)
 
     return 0;
 }
+
+unsigned long gmfn_to_mfn(struct domain *d, unsigned long gpfn)
+{
+    paddr_t p = p2m_lookup(d, gpfn << PAGE_SHIFT);
+    return p >> PAGE_SHIFT;
+}
+
 /*
  * Local variables:
  * mode: C

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4Uw-0007xo-IX; Wed, 10 Oct 2012 22:11:26 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uu-0007nx-Va
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-27.messagelabs.com!1349907076!1748942!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.4 required=7.0 tests=INFO_TLD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23967 invoked from network); 10 Oct 2012 22:11:17 -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;
	10 Oct 2012 22:11:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ul-0005yj-Vo
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ul-0000Jy-U9
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:15 +0000
Message-Id: <E1TM4Ul-0000Jy-U9@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] minios: add posix io for blkfront
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Matthew Fioravante <matthew.fioravante@jhuapl.edu>
# Date 1349775548 -3600
# Node ID 566061fefa47f16acf6b134520a160a832240a5c
# Parent  ecc7627ca6d76a068341c7a115fe8e8acc7a9217
minios: add posix io for blkfront

This patch adds posix io support (read,write,lseek) to block devices
using blkfront.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyons.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r ecc7627ca6d7 -r 566061fefa47 extras/mini-os/blkfront.c
--- a/extras/mini-os/blkfront.c	Tue Oct 09 09:18:42 2012 +0100
+++ b/extras/mini-os/blkfront.c	Tue Oct 09 10:39:08 2012 +0100
@@ -392,6 +392,7 @@ void blkfront_aio(struct blkfront_aiocb 
 static void blkfront_aio_cb(struct blkfront_aiocb *aiocbp, int ret)
 {
     aiocbp->data = (void*) 1;
+    aiocbp->aio_cb = NULL;
 }
 
 void blkfront_io(struct blkfront_aiocb *aiocbp, int write)
@@ -547,9 +548,177 @@ moretodo:
 #ifdef HAVE_LIBC
 int blkfront_open(struct blkfront_dev *dev)
 {
+    /* Silently prevent multiple opens */
+    if(dev->fd != -1) {
+       return dev->fd;
+    }
     dev->fd = alloc_fd(FTYPE_BLK);
     printk("blk_open(%s) -> %d\n", dev->nodename, dev->fd);
     files[dev->fd].blk.dev = dev;
+    files[dev->fd].blk.offset = 0;
     return dev->fd;
 }
+
+int blkfront_posix_rwop(int fd, uint8_t* buf, size_t count, int write)
+{
+   struct blkfront_dev* dev = files[fd].blk.dev;
+   off_t offset = files[fd].blk.offset;
+   struct blkfront_aiocb aiocb;
+   unsigned long long disksize = dev->info.sectors * dev->info.sector_size;
+   unsigned int blocksize = dev->info.sector_size;
+
+   int blknum;
+   int blkoff;
+   size_t bytes;
+   int rc = 0;
+   int alignedbuf = 0;
+   uint8_t* copybuf = NULL;
+
+   /* RW 0 bytes is just a NOP */
+   if(count == 0) {
+      return 0;
+   }
+   /* Check for NULL buffer */
+   if( buf == NULL ) {
+      errno = EFAULT;
+      return -1;
+   }
+
+   /* Write mode checks */
+   if(write) {
+      /*Make sure we have write permission */
+      if(dev->info.info & VDISK_READONLY 
+            || (dev->info.mode != O_RDWR  && dev->info.mode !=  O_WRONLY)) {
+         errno = EACCES;
+         return -1;
+      }
+      /*Make sure disk is big enough for this write */
+      if(offset + count > disksize) {
+         errno = ENOSPC;
+         return -1;
+      }
+   }
+   /* Read mode checks */
+   else
+   {
+      /* Reading past the disk? Just return 0 */
+      if(offset >= disksize) {
+         return 0;
+      }
+
+      /*If the requested read is bigger than the disk, just
+       * read as much as we can until the end */
+      if(offset + count > disksize) {
+         count = disksize - offset;
+      }
+   }
+   /* Determine which block to start at and at which offset inside of it */
+   blknum = offset / blocksize;
+   blkoff = offset % blocksize;
+
+   /* Optimization: We need to check if buf is aligned to the sector size.
+    * This is somewhat tricky code. We have to add the blocksize - block offset
+    * because the first block may be a partial block and then for every subsequent
+    * block rw the buffer will be offset.*/
+   if(!((uintptr_t) (buf +(blocksize -  blkoff)) & (dev->info.sector_size-1))) {
+      alignedbuf = 1;
+   }
+
+   /* Setup aiocb block object */
+   aiocb.aio_dev = dev;
+   aiocb.aio_offset = blknum * blocksize;
+   aiocb.aio_cb = NULL;
+   aiocb.data = NULL;
+
+   /* If our buffer is unaligned or its aligned but we will need to rw a partial block
+    * then a copy will have to be done */
+   if(!alignedbuf || blkoff != 0 || count % blocksize != 0) {
+      copybuf = _xmalloc(blocksize, dev->info.sector_size);
+   }
+
+   rc = count;
+   while(count > 0) {
+      /* determine how many bytes to read/write from/to the current block buffer */
+      if(!alignedbuf || blkoff != 0 || count < blocksize) {
+         /* This is the case for unaligned R/W or partial block */
+         bytes = count < blocksize - blkoff ? count : blocksize - blkoff;
+         aiocb.aio_nbytes = blocksize;
+      } else {
+         /* We can optimize further if buffer is page aligned */
+         int not_page_aligned = 0;
+         if(((uintptr_t)buf) & (PAGE_SIZE -1)) {
+            not_page_aligned = 1;
+         }
+
+         /* For an aligned R/W we can read up to the maximum transfer size */
+         bytes = count > (BLKIF_MAX_SEGMENTS_PER_REQUEST-not_page_aligned)*PAGE_SIZE 
+            ? (BLKIF_MAX_SEGMENTS_PER_REQUEST-not_page_aligned)*PAGE_SIZE
+            : count & ~(blocksize -1);
+         aiocb.aio_nbytes = bytes;
+      }
+
+      /* read operation */
+      if(!write) {
+         if (alignedbuf && bytes >= blocksize) {
+            /* If aligned and were reading a whole block, just read right into buf */
+            aiocb.aio_buf = buf;
+            blkfront_read(&aiocb);
+         } else {
+            /* If not then we have to do a copy */
+            aiocb.aio_buf = copybuf;
+            blkfront_read(&aiocb);
+            memcpy(buf, &copybuf[blkoff], bytes);
+         }
+      }
+      /* Write operation */
+      else {
+         if(alignedbuf && bytes >= blocksize) {
+            /* If aligned and were writing a whole block, just write directly from buf */
+            aiocb.aio_buf = buf;
+            blkfront_write(&aiocb);
+         } else {
+            /* If not then we have to do a copy. */
+            aiocb.aio_buf = copybuf;
+            /* If we're writing a partial block, we need to read the current contents first
+             * so we don't overwrite the extra bits with garbage */
+            if(blkoff != 0 || bytes < blocksize) {
+               blkfront_read(&aiocb);
+            }
+            memcpy(&copybuf[blkoff], buf, bytes);
+            blkfront_write(&aiocb);
+         }
+      }
+      /* Will start at beginning of all remaining blocks */
+      blkoff = 0;
+
+      /* Increment counters and continue */
+      count -= bytes;
+      buf += bytes;
+      if(bytes < blocksize) {
+         //At minimum we read one block
+         aiocb.aio_offset += blocksize;
+      } else {
+         //If we read more than a block, was a multiple of blocksize
+         aiocb.aio_offset += bytes;
+      }
+   }
+
+   free(copybuf);
+   files[fd].blk.offset += rc;
+   return rc;
+
+}
+
+int blkfront_posix_fstat(int fd, struct stat* buf)
+{
+   struct blkfront_dev* dev = files[fd].blk.dev;
+
+   buf->st_mode = dev->info.mode;
+   buf->st_uid = 0;
+   buf->st_gid = 0;
+   buf->st_size = dev->info.sectors * dev->info.sector_size;
+   buf->st_atime = buf->st_mtime = buf->st_ctime = time(NULL);
+
+   return 0;
+}
 #endif
diff -r ecc7627ca6d7 -r 566061fefa47 extras/mini-os/include/blkfront.h
--- a/extras/mini-os/include/blkfront.h	Tue Oct 09 09:18:42 2012 +0100
+++ b/extras/mini-os/include/blkfront.h	Tue Oct 09 10:39:08 2012 +0100
@@ -28,7 +28,17 @@ struct blkfront_info
 };
 struct blkfront_dev *init_blkfront(char *nodename, struct blkfront_info *info);
 #ifdef HAVE_LIBC
+#include <sys/stat.h>
+/* POSIX IO functions:
+ * use blkfront_open() to get a file descriptor to the block device
+ * Don't use the other blkfront posix functions here directly, instead use
+ * read(), write(), lseek() and fstat() on the file descriptor
+ */
 int blkfront_open(struct blkfront_dev *dev);
+int blkfront_posix_rwop(int fd, uint8_t* buf, size_t count, int write);
+#define blkfront_posix_write(fd, buf, count) blkfront_posix_rwop(fd, (uint8_t*)buf, count, 1)
+#define blkfront_posix_read(fd, buf, count) blkfront_posix_rwop(fd, (uint8_t*)buf, count, 0)
+int blkfront_posix_fstat(int fd, struct stat* buf);
 #endif
 void blkfront_aio(struct blkfront_aiocb *aiocbp, int write);
 #define blkfront_aio_read(aiocbp) blkfront_aio(aiocbp, 0)
diff -r ecc7627ca6d7 -r 566061fefa47 extras/mini-os/include/lib.h
--- a/extras/mini-os/include/lib.h	Tue Oct 09 09:18:42 2012 +0100
+++ b/extras/mini-os/include/lib.h	Tue Oct 09 10:39:08 2012 +0100
@@ -174,6 +174,7 @@ extern struct file {
 	} tap;
 	struct {
 	    struct blkfront_dev *dev;
+            off_t offset;
 	} blk;
 	struct {
 	    struct kbdfront_dev *dev;
diff -r ecc7627ca6d7 -r 566061fefa47 extras/mini-os/lib/sys.c
--- a/extras/mini-os/lib/sys.c	Tue Oct 09 09:18:42 2012 +0100
+++ b/extras/mini-os/lib/sys.c	Tue Oct 09 10:39:08 2012 +0100
@@ -289,6 +289,11 @@ int read(int fd, void *buf, size_t nbyte
 	    return ret * sizeof(union xenfb_in_event);
         }
 #endif
+#ifdef CONFIG_BLKFRONT
+        case FTYPE_BLK: {
+	    return blkfront_posix_read(fd, buf, nbytes);
+        }
+#endif
 	default:
 	    break;
     }
@@ -321,6 +326,10 @@ int write(int fd, const void *buf, size_
 	    netfront_xmit(files[fd].tap.dev, (void*) buf, nbytes);
 	    return nbytes;
 #endif
+#ifdef CONFIG_BLKFRONT
+	case FTYPE_BLK:
+	    return blkfront_posix_write(fd, buf, nbytes);
+#endif
 	default:
 	    break;
     }
@@ -331,8 +340,37 @@ int write(int fd, const void *buf, size_
 
 off_t lseek(int fd, off_t offset, int whence)
 {
-    errno = ESPIPE;
-    return (off_t) -1;
+    switch(files[fd].type) {
+#ifdef CONFIG_BLKFRONT
+       case FTYPE_BLK:
+	  switch (whence) {
+	     case SEEK_SET:
+		files[fd].file.offset = offset;
+		break;
+	     case SEEK_CUR:
+		files[fd].file.offset += offset;
+		break;
+	     case SEEK_END:
+		{
+		   struct stat st;
+		   int ret;
+		   ret = fstat(fd, &st);
+		   if (ret)
+		      return -1;
+		   files[fd].file.offset = st.st_size + offset;
+		   break;
+		}
+	     default:
+		errno = EINVAL;
+		return -1;
+	  }
+	  return files[fd].file.offset;
+	  break;
+#endif
+       default: /* Not implemented on this FTYPE */
+	  errno = ESPIPE;
+	  return (off_t) -1;
+    }
 }
 
 int fsync(int fd) {
@@ -447,6 +485,10 @@ int fstat(int fd, struct stat *buf)
 	    buf->st_ctime = time(NULL);
 	    return 0;
 	}
+#ifdef CONFIG_BLKFRONT
+	case FTYPE_BLK:
+	   return blkfront_posix_fstat(fd, buf);
+#endif
 	default:
 	    break;
     }

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4Uw-0007xo-IX; Wed, 10 Oct 2012 22:11:26 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uu-0007nx-Va
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-27.messagelabs.com!1349907076!1748942!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.4 required=7.0 tests=INFO_TLD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23967 invoked from network); 10 Oct 2012 22:11:17 -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;
	10 Oct 2012 22:11:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ul-0005yj-Vo
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ul-0000Jy-U9
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:15 +0000
Message-Id: <E1TM4Ul-0000Jy-U9@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] minios: add posix io for blkfront
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Matthew Fioravante <matthew.fioravante@jhuapl.edu>
# Date 1349775548 -3600
# Node ID 566061fefa47f16acf6b134520a160a832240a5c
# Parent  ecc7627ca6d76a068341c7a115fe8e8acc7a9217
minios: add posix io for blkfront

This patch adds posix io support (read,write,lseek) to block devices
using blkfront.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyons.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r ecc7627ca6d7 -r 566061fefa47 extras/mini-os/blkfront.c
--- a/extras/mini-os/blkfront.c	Tue Oct 09 09:18:42 2012 +0100
+++ b/extras/mini-os/blkfront.c	Tue Oct 09 10:39:08 2012 +0100
@@ -392,6 +392,7 @@ void blkfront_aio(struct blkfront_aiocb 
 static void blkfront_aio_cb(struct blkfront_aiocb *aiocbp, int ret)
 {
     aiocbp->data = (void*) 1;
+    aiocbp->aio_cb = NULL;
 }
 
 void blkfront_io(struct blkfront_aiocb *aiocbp, int write)
@@ -547,9 +548,177 @@ moretodo:
 #ifdef HAVE_LIBC
 int blkfront_open(struct blkfront_dev *dev)
 {
+    /* Silently prevent multiple opens */
+    if(dev->fd != -1) {
+       return dev->fd;
+    }
     dev->fd = alloc_fd(FTYPE_BLK);
     printk("blk_open(%s) -> %d\n", dev->nodename, dev->fd);
     files[dev->fd].blk.dev = dev;
+    files[dev->fd].blk.offset = 0;
     return dev->fd;
 }
+
+int blkfront_posix_rwop(int fd, uint8_t* buf, size_t count, int write)
+{
+   struct blkfront_dev* dev = files[fd].blk.dev;
+   off_t offset = files[fd].blk.offset;
+   struct blkfront_aiocb aiocb;
+   unsigned long long disksize = dev->info.sectors * dev->info.sector_size;
+   unsigned int blocksize = dev->info.sector_size;
+
+   int blknum;
+   int blkoff;
+   size_t bytes;
+   int rc = 0;
+   int alignedbuf = 0;
+   uint8_t* copybuf = NULL;
+
+   /* RW 0 bytes is just a NOP */
+   if(count == 0) {
+      return 0;
+   }
+   /* Check for NULL buffer */
+   if( buf == NULL ) {
+      errno = EFAULT;
+      return -1;
+   }
+
+   /* Write mode checks */
+   if(write) {
+      /*Make sure we have write permission */
+      if(dev->info.info & VDISK_READONLY 
+            || (dev->info.mode != O_RDWR  && dev->info.mode !=  O_WRONLY)) {
+         errno = EACCES;
+         return -1;
+      }
+      /*Make sure disk is big enough for this write */
+      if(offset + count > disksize) {
+         errno = ENOSPC;
+         return -1;
+      }
+   }
+   /* Read mode checks */
+   else
+   {
+      /* Reading past the disk? Just return 0 */
+      if(offset >= disksize) {
+         return 0;
+      }
+
+      /*If the requested read is bigger than the disk, just
+       * read as much as we can until the end */
+      if(offset + count > disksize) {
+         count = disksize - offset;
+      }
+   }
+   /* Determine which block to start at and at which offset inside of it */
+   blknum = offset / blocksize;
+   blkoff = offset % blocksize;
+
+   /* Optimization: We need to check if buf is aligned to the sector size.
+    * This is somewhat tricky code. We have to add the blocksize - block offset
+    * because the first block may be a partial block and then for every subsequent
+    * block rw the buffer will be offset.*/
+   if(!((uintptr_t) (buf +(blocksize -  blkoff)) & (dev->info.sector_size-1))) {
+      alignedbuf = 1;
+   }
+
+   /* Setup aiocb block object */
+   aiocb.aio_dev = dev;
+   aiocb.aio_offset = blknum * blocksize;
+   aiocb.aio_cb = NULL;
+   aiocb.data = NULL;
+
+   /* If our buffer is unaligned or its aligned but we will need to rw a partial block
+    * then a copy will have to be done */
+   if(!alignedbuf || blkoff != 0 || count % blocksize != 0) {
+      copybuf = _xmalloc(blocksize, dev->info.sector_size);
+   }
+
+   rc = count;
+   while(count > 0) {
+      /* determine how many bytes to read/write from/to the current block buffer */
+      if(!alignedbuf || blkoff != 0 || count < blocksize) {
+         /* This is the case for unaligned R/W or partial block */
+         bytes = count < blocksize - blkoff ? count : blocksize - blkoff;
+         aiocb.aio_nbytes = blocksize;
+      } else {
+         /* We can optimize further if buffer is page aligned */
+         int not_page_aligned = 0;
+         if(((uintptr_t)buf) & (PAGE_SIZE -1)) {
+            not_page_aligned = 1;
+         }
+
+         /* For an aligned R/W we can read up to the maximum transfer size */
+         bytes = count > (BLKIF_MAX_SEGMENTS_PER_REQUEST-not_page_aligned)*PAGE_SIZE 
+            ? (BLKIF_MAX_SEGMENTS_PER_REQUEST-not_page_aligned)*PAGE_SIZE
+            : count & ~(blocksize -1);
+         aiocb.aio_nbytes = bytes;
+      }
+
+      /* read operation */
+      if(!write) {
+         if (alignedbuf && bytes >= blocksize) {
+            /* If aligned and were reading a whole block, just read right into buf */
+            aiocb.aio_buf = buf;
+            blkfront_read(&aiocb);
+         } else {
+            /* If not then we have to do a copy */
+            aiocb.aio_buf = copybuf;
+            blkfront_read(&aiocb);
+            memcpy(buf, &copybuf[blkoff], bytes);
+         }
+      }
+      /* Write operation */
+      else {
+         if(alignedbuf && bytes >= blocksize) {
+            /* If aligned and were writing a whole block, just write directly from buf */
+            aiocb.aio_buf = buf;
+            blkfront_write(&aiocb);
+         } else {
+            /* If not then we have to do a copy. */
+            aiocb.aio_buf = copybuf;
+            /* If we're writing a partial block, we need to read the current contents first
+             * so we don't overwrite the extra bits with garbage */
+            if(blkoff != 0 || bytes < blocksize) {
+               blkfront_read(&aiocb);
+            }
+            memcpy(&copybuf[blkoff], buf, bytes);
+            blkfront_write(&aiocb);
+         }
+      }
+      /* Will start at beginning of all remaining blocks */
+      blkoff = 0;
+
+      /* Increment counters and continue */
+      count -= bytes;
+      buf += bytes;
+      if(bytes < blocksize) {
+         //At minimum we read one block
+         aiocb.aio_offset += blocksize;
+      } else {
+         //If we read more than a block, was a multiple of blocksize
+         aiocb.aio_offset += bytes;
+      }
+   }
+
+   free(copybuf);
+   files[fd].blk.offset += rc;
+   return rc;
+
+}
+
+int blkfront_posix_fstat(int fd, struct stat* buf)
+{
+   struct blkfront_dev* dev = files[fd].blk.dev;
+
+   buf->st_mode = dev->info.mode;
+   buf->st_uid = 0;
+   buf->st_gid = 0;
+   buf->st_size = dev->info.sectors * dev->info.sector_size;
+   buf->st_atime = buf->st_mtime = buf->st_ctime = time(NULL);
+
+   return 0;
+}
 #endif
diff -r ecc7627ca6d7 -r 566061fefa47 extras/mini-os/include/blkfront.h
--- a/extras/mini-os/include/blkfront.h	Tue Oct 09 09:18:42 2012 +0100
+++ b/extras/mini-os/include/blkfront.h	Tue Oct 09 10:39:08 2012 +0100
@@ -28,7 +28,17 @@ struct blkfront_info
 };
 struct blkfront_dev *init_blkfront(char *nodename, struct blkfront_info *info);
 #ifdef HAVE_LIBC
+#include <sys/stat.h>
+/* POSIX IO functions:
+ * use blkfront_open() to get a file descriptor to the block device
+ * Don't use the other blkfront posix functions here directly, instead use
+ * read(), write(), lseek() and fstat() on the file descriptor
+ */
 int blkfront_open(struct blkfront_dev *dev);
+int blkfront_posix_rwop(int fd, uint8_t* buf, size_t count, int write);
+#define blkfront_posix_write(fd, buf, count) blkfront_posix_rwop(fd, (uint8_t*)buf, count, 1)
+#define blkfront_posix_read(fd, buf, count) blkfront_posix_rwop(fd, (uint8_t*)buf, count, 0)
+int blkfront_posix_fstat(int fd, struct stat* buf);
 #endif
 void blkfront_aio(struct blkfront_aiocb *aiocbp, int write);
 #define blkfront_aio_read(aiocbp) blkfront_aio(aiocbp, 0)
diff -r ecc7627ca6d7 -r 566061fefa47 extras/mini-os/include/lib.h
--- a/extras/mini-os/include/lib.h	Tue Oct 09 09:18:42 2012 +0100
+++ b/extras/mini-os/include/lib.h	Tue Oct 09 10:39:08 2012 +0100
@@ -174,6 +174,7 @@ extern struct file {
 	} tap;
 	struct {
 	    struct blkfront_dev *dev;
+            off_t offset;
 	} blk;
 	struct {
 	    struct kbdfront_dev *dev;
diff -r ecc7627ca6d7 -r 566061fefa47 extras/mini-os/lib/sys.c
--- a/extras/mini-os/lib/sys.c	Tue Oct 09 09:18:42 2012 +0100
+++ b/extras/mini-os/lib/sys.c	Tue Oct 09 10:39:08 2012 +0100
@@ -289,6 +289,11 @@ int read(int fd, void *buf, size_t nbyte
 	    return ret * sizeof(union xenfb_in_event);
         }
 #endif
+#ifdef CONFIG_BLKFRONT
+        case FTYPE_BLK: {
+	    return blkfront_posix_read(fd, buf, nbytes);
+        }
+#endif
 	default:
 	    break;
     }
@@ -321,6 +326,10 @@ int write(int fd, const void *buf, size_
 	    netfront_xmit(files[fd].tap.dev, (void*) buf, nbytes);
 	    return nbytes;
 #endif
+#ifdef CONFIG_BLKFRONT
+	case FTYPE_BLK:
+	    return blkfront_posix_write(fd, buf, nbytes);
+#endif
 	default:
 	    break;
     }
@@ -331,8 +340,37 @@ int write(int fd, const void *buf, size_
 
 off_t lseek(int fd, off_t offset, int whence)
 {
-    errno = ESPIPE;
-    return (off_t) -1;
+    switch(files[fd].type) {
+#ifdef CONFIG_BLKFRONT
+       case FTYPE_BLK:
+	  switch (whence) {
+	     case SEEK_SET:
+		files[fd].file.offset = offset;
+		break;
+	     case SEEK_CUR:
+		files[fd].file.offset += offset;
+		break;
+	     case SEEK_END:
+		{
+		   struct stat st;
+		   int ret;
+		   ret = fstat(fd, &st);
+		   if (ret)
+		      return -1;
+		   files[fd].file.offset = st.st_size + offset;
+		   break;
+		}
+	     default:
+		errno = EINVAL;
+		return -1;
+	  }
+	  return files[fd].file.offset;
+	  break;
+#endif
+       default: /* Not implemented on this FTYPE */
+	  errno = ESPIPE;
+	  return (off_t) -1;
+    }
 }
 
 int fsync(int fd) {
@@ -447,6 +485,10 @@ int fstat(int fd, struct stat *buf)
 	    buf->st_ctime = time(NULL);
 	    return 0;
 	}
+#ifdef CONFIG_BLKFRONT
+	case FTYPE_BLK:
+	   return blkfront_posix_fstat(fd, buf);
+#endif
 	default:
 	    break;
     }

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4Uw-0007y6-Lt; Wed, 10 Oct 2012 22:11:26 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uv-0007vb-IR
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:25 +0000
Received: from [85.158.138.51:37781] by server-15.bemta-3.messagelabs.com id
	8C/A8-10261-C82F5705; Wed, 10 Oct 2012 22:11:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-174.messagelabs.com!1349907083!15199421!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22120 invoked from network); 10 Oct 2012 22:11:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Us-0005zh-Tk
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Us-0000NH-SG
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:22 +0000
Message-Id: <E1TM4Us-0000NH-SG@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: kill a guest which uses hvc
	with an immediate operand != XEN_HYPERCALL_TAG
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1349791534 -3600
# Node ID 478830e5d80abc9678dc5287738406e73a8bd087
# Parent  f91b841ff95caaaf0cb8f333f5a95f7b562cab76
arm: kill a guest which uses hvc with an immediate operand != XEN_HYPERCALL_TAG

At best these guests are confused/broken and at worse they are malicious. In
any case we don't know that they are expecting to handle a -errno style error.

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


diff -r f91b841ff95c -r 478830e5d80a xen/arch/arm/traps.c
--- a/xen/arch/arm/traps.c	Tue Oct 09 15:05:34 2012 +0100
+++ b/xen/arch/arm/traps.c	Tue Oct 09 15:05:34 2012 +0100
@@ -475,12 +475,7 @@ static void do_trap_hypercall(struct cpu
 #endif
 
     if ( iss != XEN_HYPERCALL_TAG )
-    {
-        printk("%s %d: received an alien hypercall iss=%lx\n", __func__ ,
-                __LINE__ , iss);
-        regs->r0 = -EINVAL;
-        return;
-    }
+        domain_crash_synchronous();
 
     if ( regs->r12 >= ARRAY_SIZE(arm_hypercall_table) )
     {

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4Uw-0007y6-Lt; Wed, 10 Oct 2012 22:11:26 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uv-0007vb-IR
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:25 +0000
Received: from [85.158.138.51:37781] by server-15.bemta-3.messagelabs.com id
	8C/A8-10261-C82F5705; Wed, 10 Oct 2012 22:11:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-174.messagelabs.com!1349907083!15199421!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22120 invoked from network); 10 Oct 2012 22:11:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Us-0005zh-Tk
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Us-0000NH-SG
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:22 +0000
Message-Id: <E1TM4Us-0000NH-SG@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: kill a guest which uses hvc
	with an immediate operand != XEN_HYPERCALL_TAG
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1349791534 -3600
# Node ID 478830e5d80abc9678dc5287738406e73a8bd087
# Parent  f91b841ff95caaaf0cb8f333f5a95f7b562cab76
arm: kill a guest which uses hvc with an immediate operand != XEN_HYPERCALL_TAG

At best these guests are confused/broken and at worse they are malicious. In
any case we don't know that they are expecting to handle a -errno style error.

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


diff -r f91b841ff95c -r 478830e5d80a xen/arch/arm/traps.c
--- a/xen/arch/arm/traps.c	Tue Oct 09 15:05:34 2012 +0100
+++ b/xen/arch/arm/traps.c	Tue Oct 09 15:05:34 2012 +0100
@@ -475,12 +475,7 @@ static void do_trap_hypercall(struct cpu
 #endif
 
     if ( iss != XEN_HYPERCALL_TAG )
-    {
-        printk("%s %d: received an alien hypercall iss=%lx\n", __func__ ,
-                __LINE__ , iss);
-        regs->r0 = -EINVAL;
-        return;
-    }
+        domain_crash_synchronous();
 
     if ( regs->r12 >= ARRAY_SIZE(arm_hypercall_table) )
     {

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:28 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4Ux-0007zv-Ol; Wed, 10 Oct 2012 22:11:27 +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 1TM4Uw-0007xJ-LS
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:26 +0000
Received: from [85.158.139.211:32894] by server-7.bemta-5.messagelabs.com id
	DC/28-20187-D82F5705; Wed, 10 Oct 2012 22:11:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-206.messagelabs.com!1349907084!21800045!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16258 invoked from network); 10 Oct 2012 22:11:25 -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;
	10 Oct 2012 22:11:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uu-0005zs-0I
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ut-0000Nl-VJ
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:23 +0000
Message-Id: <E1TM4Ut-0000Nl-VJ@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:23 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: disable distributor delivery on
	boot CPU only
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1349791536 -3600
# Node ID c5cb51bde9f05ae81f40d81647dc449981214979
# Parent  e222ecc2f61fca6a2975ceef851b0330db38227f
arm: disable distributor delivery on boot CPU only

The secondary processors do not call enter_hyp_mode until the boot CPU
has brought most of the system up, including enabling delivery via the
distributor. This means that bringing up secondary CPUs unexpectedly
disables the GICD again, meaning we get no further interrupts on any
CPU.

For completeness also disable the GICC (CPU interface) on all CPUs
too.

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


diff -r e222ecc2f61f -r c5cb51bde9f0 xen/arch/arm/mode_switch.S
--- a/xen/arch/arm/mode_switch.S	Tue Oct 09 15:05:35 2012 +0100
+++ b/xen/arch/arm/mode_switch.S	Tue Oct 09 15:05:36 2012 +0100
@@ -23,6 +23,8 @@
 
 /* Get up a CPU into Hyp mode.  Clobbers r0-r3.
  *
+ * Expects r12 == CPU number
+ *
  * This code is specific to the VE model, and not intended to be used
  * on production systems.  As such it's a bit hackier than the main
  * boot code in head.S.  In future it will be replaced by better
@@ -46,19 +48,28 @@ enter_hyp_mode:
 	mcr   CP32(r0, CNTFRQ)
 	ldr   r0, =0x40c00           /* SMP, c11, c10 in non-secure mode */
 	mcr   CP32(r0, NSACR)
-	/* Continuing ugliness: Set up the GIC so NS state owns interrupts */
 	mov   r0, #GIC_BASE_ADDRESS
 	add   r0, r0, #GIC_DR_OFFSET
+	/* Disable the GIC distributor, on the boot CPU only */
 	mov   r1, #0
-	str   r1, [r0]               /* Disable delivery in the distributor */
+	teq   r12, #0                /* Is this the boot CPU? */
+	streq r1, [r0]
+	/* Continuing ugliness: Set up the GIC so NS state owns interrupts,
+	 * The first 32 interrupts (SGIs & PPIs) must be configured on all
+	 * CPUs while the remainder are SPIs and only need to be done one, on
+	 * the boot CPU. */
 	add   r0, r0, #0x80          /* GICD_IGROUP0 */
 	mov   r2, #0xffffffff        /* All interrupts to group 1 */
-	str   r2, [r0]
-	str   r2, [r0, #4]
-	str   r2, [r0, #8]
-	/* Must drop priority mask below 0x80 before entering NS state */
+	teq   r12, #0                /* Boot CPU? */
+	str   r2, [r0]               /* Interrupts  0-31 (SGI & PPI) */
+	streq r2, [r0, #4]           /* Interrupts 32-63 (SPI) */
+	streq r2, [r0, #8]           /* Interrupts 64-95 (SPI) */
+	/* Disable the GIC CPU interface on all processors */
 	mov   r0, #GIC_BASE_ADDRESS
 	add   r0, r0, #GIC_CR_OFFSET
+	mov   r1, #0
+	str   r1, [r0]
+	/* Must drop priority mask below 0x80 before entering NS state */
 	ldr   r1, =0xff
 	str   r1, [r0, #0x4]         /* -> GICC_PMR */
 	/* Reset a few config registers */

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:28 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4Ux-0007zv-Ol; Wed, 10 Oct 2012 22:11:27 +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 1TM4Uw-0007xJ-LS
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:26 +0000
Received: from [85.158.139.211:32894] by server-7.bemta-5.messagelabs.com id
	DC/28-20187-D82F5705; Wed, 10 Oct 2012 22:11:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-206.messagelabs.com!1349907084!21800045!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16258 invoked from network); 10 Oct 2012 22:11:25 -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;
	10 Oct 2012 22:11:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uu-0005zs-0I
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ut-0000Nl-VJ
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:23 +0000
Message-Id: <E1TM4Ut-0000Nl-VJ@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:23 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: disable distributor delivery on
	boot CPU only
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1349791536 -3600
# Node ID c5cb51bde9f05ae81f40d81647dc449981214979
# Parent  e222ecc2f61fca6a2975ceef851b0330db38227f
arm: disable distributor delivery on boot CPU only

The secondary processors do not call enter_hyp_mode until the boot CPU
has brought most of the system up, including enabling delivery via the
distributor. This means that bringing up secondary CPUs unexpectedly
disables the GICD again, meaning we get no further interrupts on any
CPU.

For completeness also disable the GICC (CPU interface) on all CPUs
too.

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


diff -r e222ecc2f61f -r c5cb51bde9f0 xen/arch/arm/mode_switch.S
--- a/xen/arch/arm/mode_switch.S	Tue Oct 09 15:05:35 2012 +0100
+++ b/xen/arch/arm/mode_switch.S	Tue Oct 09 15:05:36 2012 +0100
@@ -23,6 +23,8 @@
 
 /* Get up a CPU into Hyp mode.  Clobbers r0-r3.
  *
+ * Expects r12 == CPU number
+ *
  * This code is specific to the VE model, and not intended to be used
  * on production systems.  As such it's a bit hackier than the main
  * boot code in head.S.  In future it will be replaced by better
@@ -46,19 +48,28 @@ enter_hyp_mode:
 	mcr   CP32(r0, CNTFRQ)
 	ldr   r0, =0x40c00           /* SMP, c11, c10 in non-secure mode */
 	mcr   CP32(r0, NSACR)
-	/* Continuing ugliness: Set up the GIC so NS state owns interrupts */
 	mov   r0, #GIC_BASE_ADDRESS
 	add   r0, r0, #GIC_DR_OFFSET
+	/* Disable the GIC distributor, on the boot CPU only */
 	mov   r1, #0
-	str   r1, [r0]               /* Disable delivery in the distributor */
+	teq   r12, #0                /* Is this the boot CPU? */
+	streq r1, [r0]
+	/* Continuing ugliness: Set up the GIC so NS state owns interrupts,
+	 * The first 32 interrupts (SGIs & PPIs) must be configured on all
+	 * CPUs while the remainder are SPIs and only need to be done one, on
+	 * the boot CPU. */
 	add   r0, r0, #0x80          /* GICD_IGROUP0 */
 	mov   r2, #0xffffffff        /* All interrupts to group 1 */
-	str   r2, [r0]
-	str   r2, [r0, #4]
-	str   r2, [r0, #8]
-	/* Must drop priority mask below 0x80 before entering NS state */
+	teq   r12, #0                /* Boot CPU? */
+	str   r2, [r0]               /* Interrupts  0-31 (SGI & PPI) */
+	streq r2, [r0, #4]           /* Interrupts 32-63 (SPI) */
+	streq r2, [r0, #8]           /* Interrupts 64-95 (SPI) */
+	/* Disable the GIC CPU interface on all processors */
 	mov   r0, #GIC_BASE_ADDRESS
 	add   r0, r0, #GIC_CR_OFFSET
+	mov   r1, #0
+	str   r1, [r0]
+	/* Must drop priority mask below 0x80 before entering NS state */
 	ldr   r1, =0xff
 	str   r1, [r0, #0x4]         /* -> GICC_PMR */
 	/* Reset a few config registers */

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:30 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4Uz-00082v-TV; Wed, 10 Oct 2012 22:11:29 +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 1TM4Ux-0007z8-QG
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:28 +0000
Received: from [85.158.139.211:58673] by server-4.bemta-5.messagelabs.com id
	A9/57-18688-E82F5705; Wed, 10 Oct 2012 22:11:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-206.messagelabs.com!1349907085!21852193!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31879 invoked from network); 10 Oct 2012 22:11:26 -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;
	10 Oct 2012 22:11:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uv-000604-25
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uv-0000OF-0n
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:25 +0000
Message-Id: <E1TM4Uv-0000OF-0n@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:24 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen/arm: introduce __lshrdi3 and
	__aeabi_llsr
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1349791538 -3600
# Node ID c22ecf8daa6971acc57769aa999ab93354f4913f
# Parent  3dc453705b8810a2de95ae03cfda8576169c2ead
xen/arm: introduce __lshrdi3 and __aeabi_llsr

Taken from Linux.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 3dc453705b88 -r c22ecf8daa69 xen/arch/arm/lib/Makefile
--- a/xen/arch/arm/lib/Makefile	Tue Oct 09 15:05:37 2012 +0100
+++ b/xen/arch/arm/lib/Makefile	Tue Oct 09 15:05:38 2012 +0100
@@ -2,4 +2,4 @@ obj-y += memcpy.o memmove.o memset.o mem
 obj-y += findbit.o setbit.o
 obj-y += setbit.o clearbit.o changebit.o
 obj-y += testsetbit.o testclearbit.o testchangebit.o
-obj-y += lib1funcs.o div64.o
+obj-y += lib1funcs.o lshrdi3.o div64.o
diff -r 3dc453705b88 -r c22ecf8daa69 xen/arch/arm/lib/lshrdi3.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/lib/lshrdi3.S	Tue Oct 09 15:05:38 2012 +0100
@@ -0,0 +1,54 @@
+/* Copyright 1995, 1996, 1998, 1999, 2000, 2003, 2004, 2005
+   Free Software Foundation, Inc.
+
+This file is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file.  (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+This file is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; see the file COPYING.  If not, write to
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA.  */
+
+
+#include <xen/config.h>
+#include "assembler.h"
+
+#ifdef __ARMEB__
+#define al r1
+#define ah r0
+#else
+#define al r0
+#define ah r1
+#endif
+
+ENTRY(__lshrdi3)
+ENTRY(__aeabi_llsr)
+
+	subs	r3, r2, #32
+	rsb	ip, r2, #32
+	movmi	al, al, lsr r2
+	movpl	al, ah, lsr r3
+ ARM(	orrmi	al, al, ah, lsl ip	)
+ THUMB(	lslmi	r3, ah, ip		)
+ THUMB(	orrmi	al, al, r3		)
+	mov	ah, ah, lsr r2
+	mov	pc, lr
+
+ENDPROC(__lshrdi3)
+ENDPROC(__aeabi_llsr)

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:30 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4Uz-000835-Vz; Wed, 10 Oct 2012 22:11:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ux-0007zQ-U7
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:28 +0000
Received: from [85.158.143.99:8949] by server-2.bemta-4.messagelabs.com id
	C7/7D-25171-F82F5705; Wed, 10 Oct 2012 22:11:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1349907085!28351485!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31349 invoked from network); 10 Oct 2012 22:11:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uv-00060E-Ip
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uv-0000OU-HZ
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:25 +0000
Message-Id: <E1TM4Uv-0000OU-HZ@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:25 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: don't bother setting up vtimer,
	vgic etc on idle CPUs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1349791538 -3600
# Node ID 1f72d3ae4ccdf5b2c36c7884ee3a4cc4f4754fd9
# Parent  c22ecf8daa6971acc57769aa999ab93354f4913f
arm: don't bother setting up vtimer, vgic etc on idle CPUs

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


diff -r c22ecf8daa69 -r 1f72d3ae4ccd xen/arch/arm/domain.c
--- a/xen/arch/arm/domain.c	Tue Oct 09 15:05:38 2012 +0100
+++ b/xen/arch/arm/domain.c	Tue Oct 09 15:05:38 2012 +0100
@@ -386,6 +386,10 @@ int vcpu_initialise(struct vcpu *v)
     v->arch.saved_context.sp = (uint32_t)v->arch.cpu_info;
     v->arch.saved_context.pc = (uint32_t)continue_new_vcpu;
 
+    /* Idle VCPUs don't need the rest of this setup */
+    if ( is_idle_vcpu(v) )
+        return rc;
+
     if ( (rc = vcpu_vgic_init(v)) != 0 )
         return rc;
 

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:30 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4Uz-000835-Vz; Wed, 10 Oct 2012 22:11:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ux-0007zQ-U7
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:28 +0000
Received: from [85.158.143.99:8949] by server-2.bemta-4.messagelabs.com id
	C7/7D-25171-F82F5705; Wed, 10 Oct 2012 22:11:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1349907085!28351485!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31349 invoked from network); 10 Oct 2012 22:11:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uv-00060E-Ip
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uv-0000OU-HZ
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:25 +0000
Message-Id: <E1TM4Uv-0000OU-HZ@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:25 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: don't bother setting up vtimer,
	vgic etc on idle CPUs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1349791538 -3600
# Node ID 1f72d3ae4ccdf5b2c36c7884ee3a4cc4f4754fd9
# Parent  c22ecf8daa6971acc57769aa999ab93354f4913f
arm: don't bother setting up vtimer, vgic etc on idle CPUs

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


diff -r c22ecf8daa69 -r 1f72d3ae4ccd xen/arch/arm/domain.c
--- a/xen/arch/arm/domain.c	Tue Oct 09 15:05:38 2012 +0100
+++ b/xen/arch/arm/domain.c	Tue Oct 09 15:05:38 2012 +0100
@@ -386,6 +386,10 @@ int vcpu_initialise(struct vcpu *v)
     v->arch.saved_context.sp = (uint32_t)v->arch.cpu_info;
     v->arch.saved_context.pc = (uint32_t)continue_new_vcpu;
 
+    /* Idle VCPUs don't need the rest of this setup */
+    if ( is_idle_vcpu(v) )
+        return rc;
+
     if ( (rc = vcpu_vgic_init(v)) != 0 )
         return rc;
 

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:30 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4V0-00083H-2M; Wed, 10 Oct 2012 22:11:30 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ux-0007qr-Rx
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-27.messagelabs.com!1349907079!4913370!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4840 invoked from network); 10 Oct 2012 22:11:20 -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 2012 22:11:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Up-0005z4-OW
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Up-0000Lp-NF
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:19 +0000
Message-Id: <E1TM4Up-0000Lp-NF@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Implement page offline recovery
	action for AMD
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1349783497 -3600
# Node ID 142e4577f5a9b95832b82f7b6d31fde1697cbe76
# Parent  cb1382bdaad9e11683a0329d18cef60ee85360c1
Implement page offline recovery action for AMD

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


diff -r cb1382bdaad9 -r 142e4577f5a9 xen/arch/x86/cpu/mcheck/Makefile
--- a/xen/arch/x86/cpu/mcheck/Makefile	Tue Oct 09 12:46:27 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/Makefile	Tue Oct 09 12:51:37 2012 +0100
@@ -3,6 +3,7 @@ obj-y += k7.o
 obj-y += amd_k8.o
 obj-y += amd_f10.o
 obj-y += mce_amd.o
+obj-y += mcaction.o
 obj-y += barrier.o
 obj-y += mctelem.o
 obj-y += mce.o
diff -r cb1382bdaad9 -r 142e4577f5a9 xen/arch/x86/cpu/mcheck/amd_f10.c
--- a/xen/arch/x86/cpu/mcheck/amd_f10.c	Tue Oct 09 12:46:27 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/amd_f10.c	Tue Oct 09 12:51:37 2012 +0100
@@ -44,6 +44,7 @@
 #include "mce_quirks.h"
 #include "x86_mca.h"
 #include "mce_amd.h"
+#include "mcaction.h"
 
 static struct mcinfo_extended *
 amd_f10_handler(struct mc_info *mi, uint16_t bank, uint64_t status)
@@ -97,6 +98,7 @@ enum mcheck_type amd_f10_mcheck_init(str
 
 	x86_mce_callback_register(amd_f10_handler);
 	mce_recoverable_register(mc_amd_recoverable_scan);
+	mce_register_addrcheck(mc_amd_addrcheck);
 
 	return mcheck_amd_famXX;
 }
diff -r cb1382bdaad9 -r 142e4577f5a9 xen/arch/x86/cpu/mcheck/mcaction.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/x86/cpu/mcheck/mcaction.c	Tue Oct 09 12:51:37 2012 +0100
@@ -0,0 +1,139 @@
+#include <xen/types.h>
+#include <xen/sched.h>
+#include "mcaction.h"
+#include "vmce.h"
+#include "mce.h"
+
+static struct mcinfo_recovery *
+mci_action_add_pageoffline(int bank, struct mc_info *mi,
+                       uint64_t mfn, uint32_t status)
+{
+    struct mcinfo_recovery *rec;
+
+    if (!mi)
+        return NULL;
+
+    rec = x86_mcinfo_reserve(mi, sizeof(struct mcinfo_recovery));
+    if (!rec) {
+        mi->flags |= MCINFO_FLAGS_UNCOMPLETE;
+        return NULL;
+    }
+
+    memset(rec, 0, sizeof(struct mcinfo_recovery));
+
+    rec->common.type = MC_TYPE_RECOVERY;
+    rec->common.size = sizeof(*rec);
+    rec->mc_bank = bank;
+    rec->action_types = MC_ACTION_PAGE_OFFLINE;
+    rec->action_info.page_retire.mfn = mfn;
+    rec->action_info.page_retire.status = status;
+    return rec;
+}
+
+mce_check_addr_t mc_check_addr = NULL;
+
+void mce_register_addrcheck(mce_check_addr_t cbfunc)
+{
+    mc_check_addr = cbfunc;
+}
+
+void
+mc_memerr_dhandler(struct mca_binfo *binfo,
+                   enum mce_result *result,
+                   struct cpu_user_regs *regs)
+{
+    struct mcinfo_bank *bank = binfo->mib;
+    struct mcinfo_global *global = binfo->mig;
+    struct domain *d;
+    unsigned long mfn, gfn;
+    uint32_t status;
+    uint16_t vmce_vcpuid;
+
+    if (!mc_check_addr(bank->mc_status, bank->mc_misc, MC_ADDR_PHYSICAL)) {
+        dprintk(XENLOG_WARNING,
+            "No physical address provided for memory error\n");
+        return;
+    }
+
+    mfn = bank->mc_addr >> PAGE_SHIFT;
+    if (offline_page(mfn, 1, &status))
+    {
+        dprintk(XENLOG_WARNING,
+                "Failed to offline page %lx for MCE error\n", mfn);
+        return;
+    }
+
+    mci_action_add_pageoffline(binfo->bank, binfo->mi, mfn, status);
+
+    /* This is free page */
+    if (status & PG_OFFLINE_OFFLINED)
+        *result = MCER_RECOVERED;
+    else if (status & PG_OFFLINE_AGAIN)
+        *result = MCER_CONTINUE;
+    else if (status & PG_OFFLINE_PENDING) {
+        /* This page has owner */
+        if (status & PG_OFFLINE_OWNED) {
+            bank->mc_domid = status >> PG_OFFLINE_OWNER_SHIFT;
+            mce_printk(MCE_QUIET, "MCE: This error page is ownded"
+              " by DOM %d\n", bank->mc_domid);
+            /* XXX: Cannot handle shared pages yet
+             * (this should identify all domains and gfn mapping to
+             *  the mfn in question) */
+            BUG_ON( bank->mc_domid == DOMID_COW );
+            if ( bank->mc_domid != DOMID_XEN ) {
+                d = get_domain_by_id(bank->mc_domid);
+                ASSERT(d);
+                gfn = get_gpfn_from_mfn((bank->mc_addr) >> PAGE_SHIFT);
+
+                if ( !is_vmce_ready(bank, d) )
+                {
+                    printk("DOM%d not ready for vMCE\n", d->domain_id);
+                    goto vmce_failed;
+                }
+
+                if ( unmmap_broken_page(d, _mfn(mfn), gfn) )
+                {
+                    printk("Unmap broken memory %lx for DOM%d failed\n",
+                            mfn, d->domain_id);
+                    goto vmce_failed;
+                }
+
+                bank->mc_addr = gfn << PAGE_SHIFT |
+                  (bank->mc_addr & (PAGE_SIZE -1 ));
+                if ( fill_vmsr_data(bank, d,
+                      global->mc_gstatus) == -1 )
+                {
+                    mce_printk(MCE_QUIET, "Fill vMCE# data for DOM%d "
+                      "failed\n", bank->mc_domid);
+                    goto vmce_failed;
+                }
+
+                if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL )
+                    vmce_vcpuid = VMCE_INJECT_BROADCAST;
+                else
+                    vmce_vcpuid = global->mc_vcpuid;
+
+                /* We will inject vMCE to DOMU*/
+                if ( inject_vmce(d, vmce_vcpuid) < 0 )
+                {
+                    mce_printk(MCE_QUIET, "inject vMCE to DOM%d"
+                      " failed\n", d->domain_id);
+                    goto vmce_failed;
+                }
+
+                /* Impacted domain go on with domain's recovery job
+                 * if the domain has its own MCA handler.
+                 * For xen, it has contained the error and finished
+                 * its own recovery job.
+                 */
+                *result = MCER_RECOVERED;
+                put_domain(d);
+
+                return;
+vmce_failed:
+                put_domain(d);
+                domain_crash(d);
+            }
+        }
+    }
+}
diff -r cb1382bdaad9 -r 142e4577f5a9 xen/arch/x86/cpu/mcheck/mcaction.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/x86/cpu/mcheck/mcaction.h	Tue Oct 09 12:51:37 2012 +0100
@@ -0,0 +1,20 @@
+#ifndef _MCHECK_ACTION_H
+#define _MCHECK_ACTION_H
+
+#include <xen/types.h>
+#include "x86_mca.h"
+
+void
+mc_memerr_dhandler(struct mca_binfo *binfo,
+                   enum mce_result *result,
+                   struct cpu_user_regs *regs);
+
+#define MC_ADDR_PHYSICAL  0
+#define MC_ADDR_VIRTUAL   1
+
+typedef int (*mce_check_addr_t)(uint64_t status, uint64_t misc, int addr_type);
+extern void mce_register_addrcheck(mce_check_addr_t);
+
+extern mce_check_addr_t mc_check_addr;
+
+#endif
diff -r cb1382bdaad9 -r 142e4577f5a9 xen/arch/x86/cpu/mcheck/mce.c
--- a/xen/arch/x86/cpu/mcheck/mce.c	Tue Oct 09 12:46:27 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce.c	Tue Oct 09 12:51:37 2012 +0100
@@ -24,6 +24,7 @@
 
 #include "mce.h"
 #include "barrier.h"
+#include "mcaction.h"
 #include "util.h"
 #include "vmce.h"
 
@@ -216,7 +217,7 @@ static void mca_init_bank(enum mca_sourc
 
     if ((mib->mc_status & MCi_STATUS_MISCV) &&
         (mib->mc_status & MCi_STATUS_ADDRV) &&
-        ((mib->mc_misc & MCi_MISC_ADDRMOD_MASK) == MCi_MISC_PHYSMOD) && 
+        (mc_check_addr(mib->mc_status, mib->mc_misc, MC_ADDR_PHYSICAL)) &&
         (who == MCA_POLLER || who == MCA_CMCI_HANDLER) &&
         (mfn_valid(paddr_to_pfn(mib->mc_addr))))
     {
diff -r cb1382bdaad9 -r 142e4577f5a9 xen/arch/x86/cpu/mcheck/mce_amd.c
--- a/xen/arch/x86/cpu/mcheck/mce_amd.c	Tue Oct 09 12:46:27 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce_amd.c	Tue Oct 09 12:51:37 2012 +0100
@@ -25,6 +25,7 @@
 #include "mce.h"
 #include "x86_mca.h"
 #include "mce_amd.h"
+#include "mcaction.h"
 
 /* Error Code Types */
 enum mc_ec_type {
@@ -75,3 +76,25 @@ mc_amd_recoverable_scan(uint64_t status)
 
     return ret;
 }
+
+int
+mc_amd_addrcheck(uint64_t status, uint64_t misc, int addrtype)
+{
+    enum mc_ec_type ectype;
+    uint16_t errorcode;
+
+    errorcode = status & (MCi_STATUS_MCA | MCi_STATUS_MSEC);
+    ectype = mc_ec2type(errorcode);
+
+    switch (ectype) {
+    case MC_EC_BUS_TYPE: /* value in addr MSR is physical */
+    case MC_EC_MEM_TYPE: /* value in addr MSR is physical */
+        return (addrtype == MC_ADDR_PHYSICAL);
+    case MC_EC_TLB_TYPE: /* value in addr MSR is virtual */
+        return (addrtype == MC_ADDR_VIRTUAL);
+    }
+
+    /* unreached */
+    BUG();
+    return 0;
+}
diff -r cb1382bdaad9 -r 142e4577f5a9 xen/arch/x86/cpu/mcheck/mce_amd.h
--- a/xen/arch/x86/cpu/mcheck/mce_amd.h	Tue Oct 09 12:46:27 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce_amd.h	Tue Oct 09 12:51:37 2012 +0100
@@ -2,5 +2,6 @@
 #define _MCHECK_AMD_H
 
 int mc_amd_recoverable_scan(uint64_t status);
+int mc_amd_addrcheck(uint64_t status, uint64_t misc, int addrtype);
 
 #endif
diff -r cb1382bdaad9 -r 142e4577f5a9 xen/arch/x86/cpu/mcheck/mce_intel.c
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c	Tue Oct 09 12:46:27 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c	Tue Oct 09 12:51:37 2012 +0100
@@ -19,6 +19,7 @@
 #include "barrier.h"
 #include "util.h"
 #include "vmce.h"
+#include "mcaction.h"
 
 DEFINE_PER_CPU(struct mca_banks *, mce_banks_owned);
 DEFINE_PER_CPU(struct mca_banks *, no_cmci_banks);
@@ -257,130 +258,13 @@ static enum intel_mce_type intel_check_m
     return intel_mce_fatal;
 }
 
-struct mcinfo_recovery *mci_add_pageoff_action(int bank, struct mc_info *mi,
-                              uint64_t mfn, uint32_t status)
-{
-    struct mcinfo_recovery *rec;
-
-    if (!mi)
-        return NULL;
-
-    rec = x86_mcinfo_reserve(mi, sizeof(struct mcinfo_recovery));
-    if (!rec)
-    {
-        mi->flags |= MCINFO_FLAGS_UNCOMPLETE;
-        return NULL;
-    }
-
-    memset(rec, 0, sizeof(struct mcinfo_recovery));
-
-    rec->mc_bank = bank;
-    rec->action_types = MC_ACTION_PAGE_OFFLINE;
-    rec->action_info.page_retire.mfn = mfn;
-    rec->action_info.page_retire.status = status;
-    return rec;
-}
-
 static void intel_memerr_dhandler(
              struct mca_binfo *binfo,
              enum mce_result *result,
              struct cpu_user_regs *regs)
 {
-    struct mcinfo_bank *bank = binfo->mib;
-    struct mcinfo_global *global = binfo->mig;
-    struct domain *d;
-    unsigned long mfn, gfn;
-    uint32_t status;
-    uint64_t mc_status, mc_misc;
-
     mce_printk(MCE_VERBOSE, "MCE: Enter UCR recovery action\n");
-
-    mc_status = bank->mc_status;
-    mc_misc = bank->mc_misc;
-    if (!(mc_status &  MCi_STATUS_ADDRV) ||
-        !(mc_status & MCi_STATUS_MISCV) ||
-        ((mc_misc & MCi_MISC_ADDRMOD_MASK) != MCi_MISC_PHYSMOD) )
-    {
-        dprintk(XENLOG_WARNING,
-            "No physical address provided for memory error\n");
-        return;
-    }
-
-    mfn = bank->mc_addr >> PAGE_SHIFT;
-    if (offline_page(mfn, 1, &status))
-    {
-        dprintk(XENLOG_WARNING,
-                "Failed to offline page %lx for MCE error\n", mfn);
-        return;
-    }
-
-    mci_add_pageoff_action(binfo->bank, binfo->mi, mfn, status);
-
-    /* This is free page */
-    if (status & PG_OFFLINE_OFFLINED)
-        *result = MCER_RECOVERED;
-    else if (status & PG_OFFLINE_AGAIN)
-        *result = MCER_CONTINUE;
-    else if (status & PG_OFFLINE_PENDING) {
-        /* This page has owner */
-        if (status & PG_OFFLINE_OWNED) {
-            bank->mc_domid = status >> PG_OFFLINE_OWNER_SHIFT;
-            mce_printk(MCE_QUIET, "MCE: This error page is ownded"
-              " by DOM %d\n", bank->mc_domid);
-            /* XXX: Cannot handle shared pages yet 
-             * (this should identify all domains and gfn mapping to
-             *  the mfn in question) */
-            BUG_ON( bank->mc_domid == DOMID_COW );
-            if ( bank->mc_domid != DOMID_XEN ) {
-                d = get_domain_by_id(bank->mc_domid);
-                ASSERT(d);
-                gfn = get_gpfn_from_mfn((bank->mc_addr) >> PAGE_SHIFT);
-
-                if ( !is_vmce_ready(bank, d) )
-                {
-                    printk("DOM%d not ready for vMCE\n", d->domain_id);
-                    goto vmce_failed;
-                }
-
-                if ( unmmap_broken_page(d, _mfn(mfn), gfn) )
-                {
-                    printk("Unmap broken memory %lx for DOM%d failed\n",
-                            mfn, d->domain_id);
-                    goto vmce_failed;
-                }
-
-                bank->mc_addr =  gfn << PAGE_SHIFT |
-                  (bank->mc_addr & (PAGE_SIZE -1 ));
-                if ( fill_vmsr_data(bank, d,
-                      global->mc_gstatus) == -1 )
-                {
-                    mce_printk(MCE_QUIET, "Fill vMCE# data for DOM%d "
-                      "failed\n", bank->mc_domid);
-                    goto vmce_failed;
-                }
-
-                /* We will inject vMCE to DOMU*/
-                if ( inject_vmce(d, VMCE_INJECT_BROADCAST) < 0 )
-                {
-                    mce_printk(MCE_QUIET, "inject vMCE to DOM%d"
-                      " failed\n", d->domain_id);
-                    goto vmce_failed;
-                }
-                /* Impacted domain go on with domain's recovery job
-                 * if the domain has its own MCA handler.
-                 * For xen, it has contained the error and finished
-                 * its own recovery job.
-                 */
-                *result = MCER_RECOVERED;
-                put_domain(d);
-
-                return;
-vmce_failed:
-                put_domain(d);
-                domain_crash(d);
-            }
-        }
-    }
+    mc_memerr_dhandler(binfo, result, regs);
 }
 
 static int intel_srar_check(uint64_t status)
@@ -388,6 +272,19 @@ static int intel_srar_check(uint64_t sta
     return ( intel_check_mce_type(status) == intel_mce_ucr_srar );
 }
 
+static int intel_checkaddr(uint64_t status, uint64_t misc, int addrtype)
+{
+    if (!(status & MCi_STATUS_ADDRV) ||
+        !(status & MCi_STATUS_MISCV) ||
+        ((misc & MCi_MISC_ADDRMOD_MASK) != MCi_MISC_PHYSMOD) )
+    {
+        /* addr is virtual */
+        return (addrtype == MC_ADDR_VIRTUAL);
+    }
+
+    return (addrtype == MC_ADDR_PHYSICAL);
+}
+
 static void intel_srar_dhandler(
              struct mca_binfo *binfo,
              enum mce_result *result,
@@ -882,6 +779,7 @@ static void intel_init_mce(void)
     x86_mce_vector_register(intel_machine_check);
     mce_recoverable_register(intel_recoverable_scan);
     mce_need_clearbank_register(intel_need_clearbank_scan);
+    mce_register_addrcheck(intel_checkaddr);
 
     mce_dhandlers = intel_mce_dhandlers;
     mce_dhandler_num = ARRAY_SIZE(intel_mce_dhandlers);

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:30 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4V0-00083H-2M; Wed, 10 Oct 2012 22:11:30 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ux-0007qr-Rx
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-27.messagelabs.com!1349907079!4913370!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4840 invoked from network); 10 Oct 2012 22:11:20 -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 2012 22:11:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Up-0005z4-OW
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Up-0000Lp-NF
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:19 +0000
Message-Id: <E1TM4Up-0000Lp-NF@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Implement page offline recovery
	action for AMD
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1349783497 -3600
# Node ID 142e4577f5a9b95832b82f7b6d31fde1697cbe76
# Parent  cb1382bdaad9e11683a0329d18cef60ee85360c1
Implement page offline recovery action for AMD

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


diff -r cb1382bdaad9 -r 142e4577f5a9 xen/arch/x86/cpu/mcheck/Makefile
--- a/xen/arch/x86/cpu/mcheck/Makefile	Tue Oct 09 12:46:27 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/Makefile	Tue Oct 09 12:51:37 2012 +0100
@@ -3,6 +3,7 @@ obj-y += k7.o
 obj-y += amd_k8.o
 obj-y += amd_f10.o
 obj-y += mce_amd.o
+obj-y += mcaction.o
 obj-y += barrier.o
 obj-y += mctelem.o
 obj-y += mce.o
diff -r cb1382bdaad9 -r 142e4577f5a9 xen/arch/x86/cpu/mcheck/amd_f10.c
--- a/xen/arch/x86/cpu/mcheck/amd_f10.c	Tue Oct 09 12:46:27 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/amd_f10.c	Tue Oct 09 12:51:37 2012 +0100
@@ -44,6 +44,7 @@
 #include "mce_quirks.h"
 #include "x86_mca.h"
 #include "mce_amd.h"
+#include "mcaction.h"
 
 static struct mcinfo_extended *
 amd_f10_handler(struct mc_info *mi, uint16_t bank, uint64_t status)
@@ -97,6 +98,7 @@ enum mcheck_type amd_f10_mcheck_init(str
 
 	x86_mce_callback_register(amd_f10_handler);
 	mce_recoverable_register(mc_amd_recoverable_scan);
+	mce_register_addrcheck(mc_amd_addrcheck);
 
 	return mcheck_amd_famXX;
 }
diff -r cb1382bdaad9 -r 142e4577f5a9 xen/arch/x86/cpu/mcheck/mcaction.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/x86/cpu/mcheck/mcaction.c	Tue Oct 09 12:51:37 2012 +0100
@@ -0,0 +1,139 @@
+#include <xen/types.h>
+#include <xen/sched.h>
+#include "mcaction.h"
+#include "vmce.h"
+#include "mce.h"
+
+static struct mcinfo_recovery *
+mci_action_add_pageoffline(int bank, struct mc_info *mi,
+                       uint64_t mfn, uint32_t status)
+{
+    struct mcinfo_recovery *rec;
+
+    if (!mi)
+        return NULL;
+
+    rec = x86_mcinfo_reserve(mi, sizeof(struct mcinfo_recovery));
+    if (!rec) {
+        mi->flags |= MCINFO_FLAGS_UNCOMPLETE;
+        return NULL;
+    }
+
+    memset(rec, 0, sizeof(struct mcinfo_recovery));
+
+    rec->common.type = MC_TYPE_RECOVERY;
+    rec->common.size = sizeof(*rec);
+    rec->mc_bank = bank;
+    rec->action_types = MC_ACTION_PAGE_OFFLINE;
+    rec->action_info.page_retire.mfn = mfn;
+    rec->action_info.page_retire.status = status;
+    return rec;
+}
+
+mce_check_addr_t mc_check_addr = NULL;
+
+void mce_register_addrcheck(mce_check_addr_t cbfunc)
+{
+    mc_check_addr = cbfunc;
+}
+
+void
+mc_memerr_dhandler(struct mca_binfo *binfo,
+                   enum mce_result *result,
+                   struct cpu_user_regs *regs)
+{
+    struct mcinfo_bank *bank = binfo->mib;
+    struct mcinfo_global *global = binfo->mig;
+    struct domain *d;
+    unsigned long mfn, gfn;
+    uint32_t status;
+    uint16_t vmce_vcpuid;
+
+    if (!mc_check_addr(bank->mc_status, bank->mc_misc, MC_ADDR_PHYSICAL)) {
+        dprintk(XENLOG_WARNING,
+            "No physical address provided for memory error\n");
+        return;
+    }
+
+    mfn = bank->mc_addr >> PAGE_SHIFT;
+    if (offline_page(mfn, 1, &status))
+    {
+        dprintk(XENLOG_WARNING,
+                "Failed to offline page %lx for MCE error\n", mfn);
+        return;
+    }
+
+    mci_action_add_pageoffline(binfo->bank, binfo->mi, mfn, status);
+
+    /* This is free page */
+    if (status & PG_OFFLINE_OFFLINED)
+        *result = MCER_RECOVERED;
+    else if (status & PG_OFFLINE_AGAIN)
+        *result = MCER_CONTINUE;
+    else if (status & PG_OFFLINE_PENDING) {
+        /* This page has owner */
+        if (status & PG_OFFLINE_OWNED) {
+            bank->mc_domid = status >> PG_OFFLINE_OWNER_SHIFT;
+            mce_printk(MCE_QUIET, "MCE: This error page is ownded"
+              " by DOM %d\n", bank->mc_domid);
+            /* XXX: Cannot handle shared pages yet
+             * (this should identify all domains and gfn mapping to
+             *  the mfn in question) */
+            BUG_ON( bank->mc_domid == DOMID_COW );
+            if ( bank->mc_domid != DOMID_XEN ) {
+                d = get_domain_by_id(bank->mc_domid);
+                ASSERT(d);
+                gfn = get_gpfn_from_mfn((bank->mc_addr) >> PAGE_SHIFT);
+
+                if ( !is_vmce_ready(bank, d) )
+                {
+                    printk("DOM%d not ready for vMCE\n", d->domain_id);
+                    goto vmce_failed;
+                }
+
+                if ( unmmap_broken_page(d, _mfn(mfn), gfn) )
+                {
+                    printk("Unmap broken memory %lx for DOM%d failed\n",
+                            mfn, d->domain_id);
+                    goto vmce_failed;
+                }
+
+                bank->mc_addr = gfn << PAGE_SHIFT |
+                  (bank->mc_addr & (PAGE_SIZE -1 ));
+                if ( fill_vmsr_data(bank, d,
+                      global->mc_gstatus) == -1 )
+                {
+                    mce_printk(MCE_QUIET, "Fill vMCE# data for DOM%d "
+                      "failed\n", bank->mc_domid);
+                    goto vmce_failed;
+                }
+
+                if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL )
+                    vmce_vcpuid = VMCE_INJECT_BROADCAST;
+                else
+                    vmce_vcpuid = global->mc_vcpuid;
+
+                /* We will inject vMCE to DOMU*/
+                if ( inject_vmce(d, vmce_vcpuid) < 0 )
+                {
+                    mce_printk(MCE_QUIET, "inject vMCE to DOM%d"
+                      " failed\n", d->domain_id);
+                    goto vmce_failed;
+                }
+
+                /* Impacted domain go on with domain's recovery job
+                 * if the domain has its own MCA handler.
+                 * For xen, it has contained the error and finished
+                 * its own recovery job.
+                 */
+                *result = MCER_RECOVERED;
+                put_domain(d);
+
+                return;
+vmce_failed:
+                put_domain(d);
+                domain_crash(d);
+            }
+        }
+    }
+}
diff -r cb1382bdaad9 -r 142e4577f5a9 xen/arch/x86/cpu/mcheck/mcaction.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/x86/cpu/mcheck/mcaction.h	Tue Oct 09 12:51:37 2012 +0100
@@ -0,0 +1,20 @@
+#ifndef _MCHECK_ACTION_H
+#define _MCHECK_ACTION_H
+
+#include <xen/types.h>
+#include "x86_mca.h"
+
+void
+mc_memerr_dhandler(struct mca_binfo *binfo,
+                   enum mce_result *result,
+                   struct cpu_user_regs *regs);
+
+#define MC_ADDR_PHYSICAL  0
+#define MC_ADDR_VIRTUAL   1
+
+typedef int (*mce_check_addr_t)(uint64_t status, uint64_t misc, int addr_type);
+extern void mce_register_addrcheck(mce_check_addr_t);
+
+extern mce_check_addr_t mc_check_addr;
+
+#endif
diff -r cb1382bdaad9 -r 142e4577f5a9 xen/arch/x86/cpu/mcheck/mce.c
--- a/xen/arch/x86/cpu/mcheck/mce.c	Tue Oct 09 12:46:27 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce.c	Tue Oct 09 12:51:37 2012 +0100
@@ -24,6 +24,7 @@
 
 #include "mce.h"
 #include "barrier.h"
+#include "mcaction.h"
 #include "util.h"
 #include "vmce.h"
 
@@ -216,7 +217,7 @@ static void mca_init_bank(enum mca_sourc
 
     if ((mib->mc_status & MCi_STATUS_MISCV) &&
         (mib->mc_status & MCi_STATUS_ADDRV) &&
-        ((mib->mc_misc & MCi_MISC_ADDRMOD_MASK) == MCi_MISC_PHYSMOD) && 
+        (mc_check_addr(mib->mc_status, mib->mc_misc, MC_ADDR_PHYSICAL)) &&
         (who == MCA_POLLER || who == MCA_CMCI_HANDLER) &&
         (mfn_valid(paddr_to_pfn(mib->mc_addr))))
     {
diff -r cb1382bdaad9 -r 142e4577f5a9 xen/arch/x86/cpu/mcheck/mce_amd.c
--- a/xen/arch/x86/cpu/mcheck/mce_amd.c	Tue Oct 09 12:46:27 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce_amd.c	Tue Oct 09 12:51:37 2012 +0100
@@ -25,6 +25,7 @@
 #include "mce.h"
 #include "x86_mca.h"
 #include "mce_amd.h"
+#include "mcaction.h"
 
 /* Error Code Types */
 enum mc_ec_type {
@@ -75,3 +76,25 @@ mc_amd_recoverable_scan(uint64_t status)
 
     return ret;
 }
+
+int
+mc_amd_addrcheck(uint64_t status, uint64_t misc, int addrtype)
+{
+    enum mc_ec_type ectype;
+    uint16_t errorcode;
+
+    errorcode = status & (MCi_STATUS_MCA | MCi_STATUS_MSEC);
+    ectype = mc_ec2type(errorcode);
+
+    switch (ectype) {
+    case MC_EC_BUS_TYPE: /* value in addr MSR is physical */
+    case MC_EC_MEM_TYPE: /* value in addr MSR is physical */
+        return (addrtype == MC_ADDR_PHYSICAL);
+    case MC_EC_TLB_TYPE: /* value in addr MSR is virtual */
+        return (addrtype == MC_ADDR_VIRTUAL);
+    }
+
+    /* unreached */
+    BUG();
+    return 0;
+}
diff -r cb1382bdaad9 -r 142e4577f5a9 xen/arch/x86/cpu/mcheck/mce_amd.h
--- a/xen/arch/x86/cpu/mcheck/mce_amd.h	Tue Oct 09 12:46:27 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce_amd.h	Tue Oct 09 12:51:37 2012 +0100
@@ -2,5 +2,6 @@
 #define _MCHECK_AMD_H
 
 int mc_amd_recoverable_scan(uint64_t status);
+int mc_amd_addrcheck(uint64_t status, uint64_t misc, int addrtype);
 
 #endif
diff -r cb1382bdaad9 -r 142e4577f5a9 xen/arch/x86/cpu/mcheck/mce_intel.c
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c	Tue Oct 09 12:46:27 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c	Tue Oct 09 12:51:37 2012 +0100
@@ -19,6 +19,7 @@
 #include "barrier.h"
 #include "util.h"
 #include "vmce.h"
+#include "mcaction.h"
 
 DEFINE_PER_CPU(struct mca_banks *, mce_banks_owned);
 DEFINE_PER_CPU(struct mca_banks *, no_cmci_banks);
@@ -257,130 +258,13 @@ static enum intel_mce_type intel_check_m
     return intel_mce_fatal;
 }
 
-struct mcinfo_recovery *mci_add_pageoff_action(int bank, struct mc_info *mi,
-                              uint64_t mfn, uint32_t status)
-{
-    struct mcinfo_recovery *rec;
-
-    if (!mi)
-        return NULL;
-
-    rec = x86_mcinfo_reserve(mi, sizeof(struct mcinfo_recovery));
-    if (!rec)
-    {
-        mi->flags |= MCINFO_FLAGS_UNCOMPLETE;
-        return NULL;
-    }
-
-    memset(rec, 0, sizeof(struct mcinfo_recovery));
-
-    rec->mc_bank = bank;
-    rec->action_types = MC_ACTION_PAGE_OFFLINE;
-    rec->action_info.page_retire.mfn = mfn;
-    rec->action_info.page_retire.status = status;
-    return rec;
-}
-
 static void intel_memerr_dhandler(
              struct mca_binfo *binfo,
              enum mce_result *result,
              struct cpu_user_regs *regs)
 {
-    struct mcinfo_bank *bank = binfo->mib;
-    struct mcinfo_global *global = binfo->mig;
-    struct domain *d;
-    unsigned long mfn, gfn;
-    uint32_t status;
-    uint64_t mc_status, mc_misc;
-
     mce_printk(MCE_VERBOSE, "MCE: Enter UCR recovery action\n");
-
-    mc_status = bank->mc_status;
-    mc_misc = bank->mc_misc;
-    if (!(mc_status &  MCi_STATUS_ADDRV) ||
-        !(mc_status & MCi_STATUS_MISCV) ||
-        ((mc_misc & MCi_MISC_ADDRMOD_MASK) != MCi_MISC_PHYSMOD) )
-    {
-        dprintk(XENLOG_WARNING,
-            "No physical address provided for memory error\n");
-        return;
-    }
-
-    mfn = bank->mc_addr >> PAGE_SHIFT;
-    if (offline_page(mfn, 1, &status))
-    {
-        dprintk(XENLOG_WARNING,
-                "Failed to offline page %lx for MCE error\n", mfn);
-        return;
-    }
-
-    mci_add_pageoff_action(binfo->bank, binfo->mi, mfn, status);
-
-    /* This is free page */
-    if (status & PG_OFFLINE_OFFLINED)
-        *result = MCER_RECOVERED;
-    else if (status & PG_OFFLINE_AGAIN)
-        *result = MCER_CONTINUE;
-    else if (status & PG_OFFLINE_PENDING) {
-        /* This page has owner */
-        if (status & PG_OFFLINE_OWNED) {
-            bank->mc_domid = status >> PG_OFFLINE_OWNER_SHIFT;
-            mce_printk(MCE_QUIET, "MCE: This error page is ownded"
-              " by DOM %d\n", bank->mc_domid);
-            /* XXX: Cannot handle shared pages yet 
-             * (this should identify all domains and gfn mapping to
-             *  the mfn in question) */
-            BUG_ON( bank->mc_domid == DOMID_COW );
-            if ( bank->mc_domid != DOMID_XEN ) {
-                d = get_domain_by_id(bank->mc_domid);
-                ASSERT(d);
-                gfn = get_gpfn_from_mfn((bank->mc_addr) >> PAGE_SHIFT);
-
-                if ( !is_vmce_ready(bank, d) )
-                {
-                    printk("DOM%d not ready for vMCE\n", d->domain_id);
-                    goto vmce_failed;
-                }
-
-                if ( unmmap_broken_page(d, _mfn(mfn), gfn) )
-                {
-                    printk("Unmap broken memory %lx for DOM%d failed\n",
-                            mfn, d->domain_id);
-                    goto vmce_failed;
-                }
-
-                bank->mc_addr =  gfn << PAGE_SHIFT |
-                  (bank->mc_addr & (PAGE_SIZE -1 ));
-                if ( fill_vmsr_data(bank, d,
-                      global->mc_gstatus) == -1 )
-                {
-                    mce_printk(MCE_QUIET, "Fill vMCE# data for DOM%d "
-                      "failed\n", bank->mc_domid);
-                    goto vmce_failed;
-                }
-
-                /* We will inject vMCE to DOMU*/
-                if ( inject_vmce(d, VMCE_INJECT_BROADCAST) < 0 )
-                {
-                    mce_printk(MCE_QUIET, "inject vMCE to DOM%d"
-                      " failed\n", d->domain_id);
-                    goto vmce_failed;
-                }
-                /* Impacted domain go on with domain's recovery job
-                 * if the domain has its own MCA handler.
-                 * For xen, it has contained the error and finished
-                 * its own recovery job.
-                 */
-                *result = MCER_RECOVERED;
-                put_domain(d);
-
-                return;
-vmce_failed:
-                put_domain(d);
-                domain_crash(d);
-            }
-        }
-    }
+    mc_memerr_dhandler(binfo, result, regs);
 }
 
 static int intel_srar_check(uint64_t status)
@@ -388,6 +272,19 @@ static int intel_srar_check(uint64_t sta
     return ( intel_check_mce_type(status) == intel_mce_ucr_srar );
 }
 
+static int intel_checkaddr(uint64_t status, uint64_t misc, int addrtype)
+{
+    if (!(status & MCi_STATUS_ADDRV) ||
+        !(status & MCi_STATUS_MISCV) ||
+        ((misc & MCi_MISC_ADDRMOD_MASK) != MCi_MISC_PHYSMOD) )
+    {
+        /* addr is virtual */
+        return (addrtype == MC_ADDR_VIRTUAL);
+    }
+
+    return (addrtype == MC_ADDR_PHYSICAL);
+}
+
 static void intel_srar_dhandler(
              struct mca_binfo *binfo,
              enum mce_result *result,
@@ -882,6 +779,7 @@ static void intel_init_mce(void)
     x86_mce_vector_register(intel_machine_check);
     mce_recoverable_register(intel_recoverable_scan);
     mce_need_clearbank_register(intel_need_clearbank_scan);
+    mce_register_addrcheck(intel_checkaddr);
 
     mce_dhandlers = intel_mce_dhandlers;
     mce_dhandler_num = ARRAY_SIZE(intel_mce_dhandlers);

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:30 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4Uz-00082v-TV; Wed, 10 Oct 2012 22:11:29 +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 1TM4Ux-0007z8-QG
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:28 +0000
Received: from [85.158.139.211:58673] by server-4.bemta-5.messagelabs.com id
	A9/57-18688-E82F5705; Wed, 10 Oct 2012 22:11:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-206.messagelabs.com!1349907085!21852193!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31879 invoked from network); 10 Oct 2012 22:11:26 -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;
	10 Oct 2012 22:11:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uv-000604-25
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uv-0000OF-0n
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:25 +0000
Message-Id: <E1TM4Uv-0000OF-0n@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:24 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen/arm: introduce __lshrdi3 and
	__aeabi_llsr
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1349791538 -3600
# Node ID c22ecf8daa6971acc57769aa999ab93354f4913f
# Parent  3dc453705b8810a2de95ae03cfda8576169c2ead
xen/arm: introduce __lshrdi3 and __aeabi_llsr

Taken from Linux.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 3dc453705b88 -r c22ecf8daa69 xen/arch/arm/lib/Makefile
--- a/xen/arch/arm/lib/Makefile	Tue Oct 09 15:05:37 2012 +0100
+++ b/xen/arch/arm/lib/Makefile	Tue Oct 09 15:05:38 2012 +0100
@@ -2,4 +2,4 @@ obj-y += memcpy.o memmove.o memset.o mem
 obj-y += findbit.o setbit.o
 obj-y += setbit.o clearbit.o changebit.o
 obj-y += testsetbit.o testclearbit.o testchangebit.o
-obj-y += lib1funcs.o div64.o
+obj-y += lib1funcs.o lshrdi3.o div64.o
diff -r 3dc453705b88 -r c22ecf8daa69 xen/arch/arm/lib/lshrdi3.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/lib/lshrdi3.S	Tue Oct 09 15:05:38 2012 +0100
@@ -0,0 +1,54 @@
+/* Copyright 1995, 1996, 1998, 1999, 2000, 2003, 2004, 2005
+   Free Software Foundation, Inc.
+
+This file is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file.  (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+This file is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; see the file COPYING.  If not, write to
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA.  */
+
+
+#include <xen/config.h>
+#include "assembler.h"
+
+#ifdef __ARMEB__
+#define al r1
+#define ah r0
+#else
+#define al r0
+#define ah r1
+#endif
+
+ENTRY(__lshrdi3)
+ENTRY(__aeabi_llsr)
+
+	subs	r3, r2, #32
+	rsb	ip, r2, #32
+	movmi	al, al, lsr r2
+	movpl	al, ah, lsr r3
+ ARM(	orrmi	al, al, ah, lsl ip	)
+ THUMB(	lslmi	r3, ah, ip		)
+ THUMB(	orrmi	al, al, r3		)
+	mov	ah, ah, lsr r2
+	mov	pc, lr
+
+ENDPROC(__lshrdi3)
+ENDPROC(__aeabi_llsr)

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:31 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11: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 1TM4V1-00085c-7v; Wed, 10 Oct 2012 22:11:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uz-00081a-Fu
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:29 +0000
Received: from [85.158.139.211:28364] by server-12.bemta-5.messagelabs.com id
	32/44-19095-092F5705; Wed, 10 Oct 2012 22:11:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-206.messagelabs.com!1349907086!21390181!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13827 invoked from network); 10 Oct 2012 22:11:27 -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;
	10 Oct 2012 22:11:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uw-00060Q-KP
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uw-0000Oy-JC
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:26 +0000
Message-Id: <E1TM4Uw-0000Oy-JC@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:26 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: Use per-CPU irq_desc for PPIs
	and SGIs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1349791540 -3600
# Node ID 92fc422d8ceec4d5577122b93db3df97a98dc4aa
# Parent  fcd072eedbb5d927f04f3aabb939bdc9e8ca7ac5
arm: Use per-CPU irq_desc for PPIs and SGIs

The first 32 interrupts on a GIC are the Peripheral Private Interrupts
and Software-Generated Interrupts and are local to each processor.

The irq_desc cannot be shared since we use irq_desc->status to track
whether the IRQ is in-progress etc. Therefore give each processor its
own local irq_desc for each of these interupts.

We must also route them on each CPU, so do so.

This feels like a bit of a layering violation (since the core ARM
irq.c now knows about thinkgs wich are really gic.c business)

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


diff -r fcd072eedbb5 -r 92fc422d8cee xen/arch/arm/gic.c
--- a/xen/arch/arm/gic.c	Tue Oct 09 15:05:39 2012 +0100
+++ b/xen/arch/arm/gic.c	Tue Oct 09 15:05:40 2012 +0100
@@ -50,9 +50,17 @@ static struct {
     uint64_t lr_mask;
 } gic;
 
-irq_desc_t irq_desc[NR_IRQS];
+static irq_desc_t irq_desc[NR_IRQS];
+static DEFINE_PER_CPU(irq_desc_t[NR_LOCAL_IRQS], local_irq_desc);
+
 unsigned nr_lrs;
 
+irq_desc_t *__irq_to_desc(int irq)
+{
+    if (irq < NR_LOCAL_IRQS) return &this_cpu(local_irq_desc)[irq];
+    return &irq_desc[irq-NR_LOCAL_IRQS];
+}
+
 void gic_save_state(struct vcpu *v)
 {
     int i;
@@ -260,8 +268,8 @@ static void __cpuinit gic_cpu_init(void)
 {
     int i;
 
-    /* The first 32 interrupts (PPI and SGI) are banked per-cpu, so 
-     * even though they are controlled with GICD registers, they must 
+    /* The first 32 interrupts (PPI and SGI) are banked per-cpu, so
+     * even though they are controlled with GICD registers, they must
      * be set up here with the other per-cpu state. */
     GICD[GICD_ICENABLER] = 0xffff0000; /* Disable all PPI */
     GICD[GICD_ISENABLER] = 0x0000ffff; /* Enable all SGI */
@@ -342,7 +350,7 @@ void gic_disable_cpu(void)
     spin_unlock_irq(&gic.lock);
 }
 
-void gic_route_irqs(void)
+void gic_route_ppis(void)
 {
     /* XXX should get these from DT */
     /* GIC maintenance */
@@ -351,6 +359,11 @@ void gic_route_irqs(void)
     gic_route_irq(26, 1, 1u << smp_processor_id(), 0xa0);
     /* Timer */
     gic_route_irq(30, 1, 1u << smp_processor_id(), 0xa0);
+}
+
+void gic_route_spis(void)
+{
+    /* XXX should get these from DT */
     /* UART */
     gic_route_irq(37, 0, 1u << smp_processor_id(), 0xa0);
 }
@@ -408,7 +421,7 @@ int __init setup_irq(unsigned int irq, s
 
     rc = __setup_irq(desc, irq, new);
 
-    spin_unlock_irqrestore(&desc->lock,flags);
+    spin_unlock_irqrestore(&desc->lock, flags);
 
     return rc;
 }
diff -r fcd072eedbb5 -r 92fc422d8cee xen/arch/arm/gic.h
--- a/xen/arch/arm/gic.h	Tue Oct 09 15:05:39 2012 +0100
+++ b/xen/arch/arm/gic.h	Tue Oct 09 15:05:40 2012 +0100
@@ -132,7 +132,8 @@ extern int vcpu_vgic_init(struct vcpu *v
 extern void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq,int virtual);
 extern struct pending_irq *irq_to_pending(struct vcpu *v, unsigned int irq);
 
-extern void gic_route_irqs(void);
+extern void gic_route_ppis(void);
+extern void gic_route_spis(void);
 
 extern void gic_inject(void);
 
diff -r fcd072eedbb5 -r 92fc422d8cee xen/arch/arm/irq.c
--- a/xen/arch/arm/irq.c	Tue Oct 09 15:05:39 2012 +0100
+++ b/xen/arch/arm/irq.c	Tue Oct 09 15:05:40 2012 +0100
@@ -58,20 +58,41 @@ static int __init init_irq_data(void)
 {
     int irq;
 
-    for (irq = 0; irq < NR_IRQS; irq++) {
+    for (irq = NR_LOCAL_IRQS; irq < NR_IRQS; irq++) {
         struct irq_desc *desc = irq_to_desc(irq);
         init_one_irq_desc(desc);
         desc->irq = irq;
         desc->action  = NULL;
     }
+
+    return 0;
+}
+
+static int __cpuinit init_local_irq_data(void)
+{
+    int irq;
+
+    for (irq = 0; irq < NR_LOCAL_IRQS; irq++) {
+        struct irq_desc *desc = irq_to_desc(irq);
+        init_one_irq_desc(desc);
+        desc->irq = irq;
+        desc->action  = NULL;
+    }
+
     return 0;
 }
 
 void __init init_IRQ(void)
 {
+    BUG_ON(init_local_irq_data() < 0);
     BUG_ON(init_irq_data() < 0);
 }
 
+void __cpuinit init_secondary_IRQ(void)
+{
+    BUG_ON(init_local_irq_data() < 0);
+}
+
 int __init request_irq(unsigned int irq,
         void (*handler)(int, void *, struct cpu_user_regs *),
         unsigned long irqflags, const char * devname, void *dev_id)
diff -r fcd072eedbb5 -r 92fc422d8cee xen/arch/arm/setup.c
--- a/xen/arch/arm/setup.c	Tue Oct 09 15:05:39 2012 +0100
+++ b/xen/arch/arm/setup.c	Tue Oct 09 15:05:40 2012 +0100
@@ -200,7 +200,8 @@ void __init start_xen(unsigned long boot
 
     init_IRQ();
 
-    gic_route_irqs();
+    gic_route_ppis();
+    gic_route_spis();
 
     init_maintenance_interrupt();
     init_timer_interrupt();
diff -r fcd072eedbb5 -r 92fc422d8cee xen/arch/arm/smpboot.c
--- a/xen/arch/arm/smpboot.c	Tue Oct 09 15:05:39 2012 +0100
+++ b/xen/arch/arm/smpboot.c	Tue Oct 09 15:05:40 2012 +0100
@@ -26,6 +26,8 @@
 #include <xen/sched.h>
 #include <xen/smp.h>
 #include <xen/softirq.h>
+#include <xen/timer.h>
+#include <xen/irq.h>
 #include <asm/vfp.h>
 #include "gic.h"
 
@@ -129,8 +131,13 @@ void __cpuinit start_secondary(unsigned 
     enable_vfp();
 
     gic_init_secondary_cpu();
+
+    init_secondary_IRQ();
+
+    gic_route_ppis();
+
+    init_maintenance_interrupt();
     init_timer_interrupt();
-    gic_route_irqs();
 
     set_current(idle_vcpu[cpuid]);
 
diff -r fcd072eedbb5 -r 92fc422d8cee xen/include/asm-arm/irq.h
--- a/xen/include/asm-arm/irq.h	Tue Oct 09 15:05:39 2012 +0100
+++ b/xen/include/asm-arm/irq.h	Tue Oct 09 15:05:40 2012 +0100
@@ -17,10 +17,23 @@ struct irq_cfg {
 #define arch_irq_desc irq_cfg
 };
 
+#define NR_LOCAL_IRQS	32
+#define NR_IRQS		1024
+#define nr_irqs NR_IRQS
+
+struct irq_desc;
+
+struct irq_desc *__irq_to_desc(int irq);
+
+#define irq_to_desc(irq)    __irq_to_desc(irq)
+
 void do_IRQ(struct cpu_user_regs *regs, unsigned int irq, int is_fiq);
 
 #define domain_pirq_to_irq(d, pirq) (pirq)
 
+void init_IRQ(void);
+void init_secondary_IRQ(void);
+
 #endif /* _ASM_HW_IRQ_H */
 /*
  * Local variables:
diff -r fcd072eedbb5 -r 92fc422d8cee xen/include/asm-arm/setup.h
--- a/xen/include/asm-arm/setup.h	Tue Oct 09 15:05:39 2012 +0100
+++ b/xen/include/asm-arm/setup.h	Tue Oct 09 15:05:40 2012 +0100
@@ -9,8 +9,6 @@ void arch_get_xen_caps(xen_capabilities_
 
 int construct_dom0(struct domain *d);
 
-void init_IRQ(void);
-
 #endif
 /*
  * Local variables:
diff -r fcd072eedbb5 -r 92fc422d8cee xen/include/xen/irq.h
--- a/xen/include/xen/irq.h	Tue Oct 09 15:05:39 2012 +0100
+++ b/xen/include/xen/irq.h	Tue Oct 09 15:05:40 2012 +0100
@@ -88,21 +88,15 @@ typedef struct irq_desc {
     struct list_head rl_link;
 } __cacheline_aligned irq_desc_t;
 
+#ifndef irq_to_desc
 #define irq_to_desc(irq)    (&irq_desc[irq])
+#endif
 
 int init_one_irq_desc(struct irq_desc *);
 int arch_init_one_irq_desc(struct irq_desc *);
 
 #define irq_desc_initialized(desc) ((desc)->handler != NULL)
 
-#if defined(__arm__)
-
-#define NR_IRQS		1024
-#define nr_irqs NR_IRQS
-extern irq_desc_t irq_desc[NR_IRQS];
-
-#endif
-
 extern int setup_irq(unsigned int irq, struct irqaction *);
 extern void release_irq(unsigned int irq);
 extern int request_irq(unsigned int irq,

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:31 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11: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 1TM4V1-00085c-7v; Wed, 10 Oct 2012 22:11:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uz-00081a-Fu
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:29 +0000
Received: from [85.158.139.211:28364] by server-12.bemta-5.messagelabs.com id
	32/44-19095-092F5705; Wed, 10 Oct 2012 22:11:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-206.messagelabs.com!1349907086!21390181!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13827 invoked from network); 10 Oct 2012 22:11:27 -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;
	10 Oct 2012 22:11:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uw-00060Q-KP
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uw-0000Oy-JC
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:26 +0000
Message-Id: <E1TM4Uw-0000Oy-JC@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:26 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: Use per-CPU irq_desc for PPIs
	and SGIs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1349791540 -3600
# Node ID 92fc422d8ceec4d5577122b93db3df97a98dc4aa
# Parent  fcd072eedbb5d927f04f3aabb939bdc9e8ca7ac5
arm: Use per-CPU irq_desc for PPIs and SGIs

The first 32 interrupts on a GIC are the Peripheral Private Interrupts
and Software-Generated Interrupts and are local to each processor.

The irq_desc cannot be shared since we use irq_desc->status to track
whether the IRQ is in-progress etc. Therefore give each processor its
own local irq_desc for each of these interupts.

We must also route them on each CPU, so do so.

This feels like a bit of a layering violation (since the core ARM
irq.c now knows about thinkgs wich are really gic.c business)

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


diff -r fcd072eedbb5 -r 92fc422d8cee xen/arch/arm/gic.c
--- a/xen/arch/arm/gic.c	Tue Oct 09 15:05:39 2012 +0100
+++ b/xen/arch/arm/gic.c	Tue Oct 09 15:05:40 2012 +0100
@@ -50,9 +50,17 @@ static struct {
     uint64_t lr_mask;
 } gic;
 
-irq_desc_t irq_desc[NR_IRQS];
+static irq_desc_t irq_desc[NR_IRQS];
+static DEFINE_PER_CPU(irq_desc_t[NR_LOCAL_IRQS], local_irq_desc);
+
 unsigned nr_lrs;
 
+irq_desc_t *__irq_to_desc(int irq)
+{
+    if (irq < NR_LOCAL_IRQS) return &this_cpu(local_irq_desc)[irq];
+    return &irq_desc[irq-NR_LOCAL_IRQS];
+}
+
 void gic_save_state(struct vcpu *v)
 {
     int i;
@@ -260,8 +268,8 @@ static void __cpuinit gic_cpu_init(void)
 {
     int i;
 
-    /* The first 32 interrupts (PPI and SGI) are banked per-cpu, so 
-     * even though they are controlled with GICD registers, they must 
+    /* The first 32 interrupts (PPI and SGI) are banked per-cpu, so
+     * even though they are controlled with GICD registers, they must
      * be set up here with the other per-cpu state. */
     GICD[GICD_ICENABLER] = 0xffff0000; /* Disable all PPI */
     GICD[GICD_ISENABLER] = 0x0000ffff; /* Enable all SGI */
@@ -342,7 +350,7 @@ void gic_disable_cpu(void)
     spin_unlock_irq(&gic.lock);
 }
 
-void gic_route_irqs(void)
+void gic_route_ppis(void)
 {
     /* XXX should get these from DT */
     /* GIC maintenance */
@@ -351,6 +359,11 @@ void gic_route_irqs(void)
     gic_route_irq(26, 1, 1u << smp_processor_id(), 0xa0);
     /* Timer */
     gic_route_irq(30, 1, 1u << smp_processor_id(), 0xa0);
+}
+
+void gic_route_spis(void)
+{
+    /* XXX should get these from DT */
     /* UART */
     gic_route_irq(37, 0, 1u << smp_processor_id(), 0xa0);
 }
@@ -408,7 +421,7 @@ int __init setup_irq(unsigned int irq, s
 
     rc = __setup_irq(desc, irq, new);
 
-    spin_unlock_irqrestore(&desc->lock,flags);
+    spin_unlock_irqrestore(&desc->lock, flags);
 
     return rc;
 }
diff -r fcd072eedbb5 -r 92fc422d8cee xen/arch/arm/gic.h
--- a/xen/arch/arm/gic.h	Tue Oct 09 15:05:39 2012 +0100
+++ b/xen/arch/arm/gic.h	Tue Oct 09 15:05:40 2012 +0100
@@ -132,7 +132,8 @@ extern int vcpu_vgic_init(struct vcpu *v
 extern void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq,int virtual);
 extern struct pending_irq *irq_to_pending(struct vcpu *v, unsigned int irq);
 
-extern void gic_route_irqs(void);
+extern void gic_route_ppis(void);
+extern void gic_route_spis(void);
 
 extern void gic_inject(void);
 
diff -r fcd072eedbb5 -r 92fc422d8cee xen/arch/arm/irq.c
--- a/xen/arch/arm/irq.c	Tue Oct 09 15:05:39 2012 +0100
+++ b/xen/arch/arm/irq.c	Tue Oct 09 15:05:40 2012 +0100
@@ -58,20 +58,41 @@ static int __init init_irq_data(void)
 {
     int irq;
 
-    for (irq = 0; irq < NR_IRQS; irq++) {
+    for (irq = NR_LOCAL_IRQS; irq < NR_IRQS; irq++) {
         struct irq_desc *desc = irq_to_desc(irq);
         init_one_irq_desc(desc);
         desc->irq = irq;
         desc->action  = NULL;
     }
+
+    return 0;
+}
+
+static int __cpuinit init_local_irq_data(void)
+{
+    int irq;
+
+    for (irq = 0; irq < NR_LOCAL_IRQS; irq++) {
+        struct irq_desc *desc = irq_to_desc(irq);
+        init_one_irq_desc(desc);
+        desc->irq = irq;
+        desc->action  = NULL;
+    }
+
     return 0;
 }
 
 void __init init_IRQ(void)
 {
+    BUG_ON(init_local_irq_data() < 0);
     BUG_ON(init_irq_data() < 0);
 }
 
+void __cpuinit init_secondary_IRQ(void)
+{
+    BUG_ON(init_local_irq_data() < 0);
+}
+
 int __init request_irq(unsigned int irq,
         void (*handler)(int, void *, struct cpu_user_regs *),
         unsigned long irqflags, const char * devname, void *dev_id)
diff -r fcd072eedbb5 -r 92fc422d8cee xen/arch/arm/setup.c
--- a/xen/arch/arm/setup.c	Tue Oct 09 15:05:39 2012 +0100
+++ b/xen/arch/arm/setup.c	Tue Oct 09 15:05:40 2012 +0100
@@ -200,7 +200,8 @@ void __init start_xen(unsigned long boot
 
     init_IRQ();
 
-    gic_route_irqs();
+    gic_route_ppis();
+    gic_route_spis();
 
     init_maintenance_interrupt();
     init_timer_interrupt();
diff -r fcd072eedbb5 -r 92fc422d8cee xen/arch/arm/smpboot.c
--- a/xen/arch/arm/smpboot.c	Tue Oct 09 15:05:39 2012 +0100
+++ b/xen/arch/arm/smpboot.c	Tue Oct 09 15:05:40 2012 +0100
@@ -26,6 +26,8 @@
 #include <xen/sched.h>
 #include <xen/smp.h>
 #include <xen/softirq.h>
+#include <xen/timer.h>
+#include <xen/irq.h>
 #include <asm/vfp.h>
 #include "gic.h"
 
@@ -129,8 +131,13 @@ void __cpuinit start_secondary(unsigned 
     enable_vfp();
 
     gic_init_secondary_cpu();
+
+    init_secondary_IRQ();
+
+    gic_route_ppis();
+
+    init_maintenance_interrupt();
     init_timer_interrupt();
-    gic_route_irqs();
 
     set_current(idle_vcpu[cpuid]);
 
diff -r fcd072eedbb5 -r 92fc422d8cee xen/include/asm-arm/irq.h
--- a/xen/include/asm-arm/irq.h	Tue Oct 09 15:05:39 2012 +0100
+++ b/xen/include/asm-arm/irq.h	Tue Oct 09 15:05:40 2012 +0100
@@ -17,10 +17,23 @@ struct irq_cfg {
 #define arch_irq_desc irq_cfg
 };
 
+#define NR_LOCAL_IRQS	32
+#define NR_IRQS		1024
+#define nr_irqs NR_IRQS
+
+struct irq_desc;
+
+struct irq_desc *__irq_to_desc(int irq);
+
+#define irq_to_desc(irq)    __irq_to_desc(irq)
+
 void do_IRQ(struct cpu_user_regs *regs, unsigned int irq, int is_fiq);
 
 #define domain_pirq_to_irq(d, pirq) (pirq)
 
+void init_IRQ(void);
+void init_secondary_IRQ(void);
+
 #endif /* _ASM_HW_IRQ_H */
 /*
  * Local variables:
diff -r fcd072eedbb5 -r 92fc422d8cee xen/include/asm-arm/setup.h
--- a/xen/include/asm-arm/setup.h	Tue Oct 09 15:05:39 2012 +0100
+++ b/xen/include/asm-arm/setup.h	Tue Oct 09 15:05:40 2012 +0100
@@ -9,8 +9,6 @@ void arch_get_xen_caps(xen_capabilities_
 
 int construct_dom0(struct domain *d);
 
-void init_IRQ(void);
-
 #endif
 /*
  * Local variables:
diff -r fcd072eedbb5 -r 92fc422d8cee xen/include/xen/irq.h
--- a/xen/include/xen/irq.h	Tue Oct 09 15:05:39 2012 +0100
+++ b/xen/include/xen/irq.h	Tue Oct 09 15:05:40 2012 +0100
@@ -88,21 +88,15 @@ typedef struct irq_desc {
     struct list_head rl_link;
 } __cacheline_aligned irq_desc_t;
 
+#ifndef irq_to_desc
 #define irq_to_desc(irq)    (&irq_desc[irq])
+#endif
 
 int init_one_irq_desc(struct irq_desc *);
 int arch_init_one_irq_desc(struct irq_desc *);
 
 #define irq_desc_initialized(desc) ((desc)->handler != NULL)
 
-#if defined(__arm__)
-
-#define NR_IRQS		1024
-#define nr_irqs NR_IRQS
-extern irq_desc_t irq_desc[NR_IRQS];
-
-#endif
-
 extern int setup_irq(unsigned int irq, struct irqaction *);
 extern void release_irq(unsigned int irq);
 extern int request_irq(unsigned int irq,

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:31 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11: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 1TM4V1-00085R-5W; Wed, 10 Oct 2012 22:11:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uz-00081m-Jk
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:29 +0000
Received: from [85.158.139.211:32970] by server-11.bemta-5.messagelabs.com id
	49/D7-15507-092F5705; Wed, 10 Oct 2012 22:11:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-206.messagelabs.com!1349907087!21390183!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13844 invoked from network); 10 Oct 2012 22:11:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ux-00060X-4e
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ux-0000PD-3N
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:27 +0000
Message-Id: <E1TM4Ux-0000PD-3N@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:26 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs, build: Tolerate missing fig2dev
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <ian.jackson@eu.citrix.com>
# Date 1349801998 -3600
# Node ID af59cce8d1fd2a592006e188c3e3b42f5bd56fd0
# Parent  92fc422d8ceec4d5577122b93db3df97a98dc4aa
docs, build: Tolerate missing fig2dev

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


diff -r 92fc422d8cee -r af59cce8d1fd docs/Makefile
--- a/docs/Makefile	Tue Oct 09 15:05:40 2012 +0100
+++ b/docs/Makefile	Tue Oct 09 17:59:58 2012 +0100
@@ -42,7 +42,9 @@ txt: $(DOC_TXT)
 
 .PHONY: figs
 figs:
-	$(MAKE) -C figs
+	@set -e ; if which $(FIG2DEV) 1>/dev/null 2>/dev/null; then \
+	set -x; $(MAKE) -C figs ; else                   \
+	echo "fig2dev (transfig) not installed; skipping figs."; fi
 
 .PHONY: python-dev-docs
 python-dev-docs:

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:31 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11: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 1TM4V1-00085R-5W; Wed, 10 Oct 2012 22:11:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uz-00081m-Jk
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:29 +0000
Received: from [85.158.139.211:32970] by server-11.bemta-5.messagelabs.com id
	49/D7-15507-092F5705; Wed, 10 Oct 2012 22:11:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-206.messagelabs.com!1349907087!21390183!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13844 invoked from network); 10 Oct 2012 22:11:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ux-00060X-4e
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ux-0000PD-3N
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:27 +0000
Message-Id: <E1TM4Ux-0000PD-3N@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:26 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs, build: Tolerate missing fig2dev
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <ian.jackson@eu.citrix.com>
# Date 1349801998 -3600
# Node ID af59cce8d1fd2a592006e188c3e3b42f5bd56fd0
# Parent  92fc422d8ceec4d5577122b93db3df97a98dc4aa
docs, build: Tolerate missing fig2dev

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


diff -r 92fc422d8cee -r af59cce8d1fd docs/Makefile
--- a/docs/Makefile	Tue Oct 09 15:05:40 2012 +0100
+++ b/docs/Makefile	Tue Oct 09 17:59:58 2012 +0100
@@ -42,7 +42,9 @@ txt: $(DOC_TXT)
 
 .PHONY: figs
 figs:
-	$(MAKE) -C figs
+	@set -e ; if which $(FIG2DEV) 1>/dev/null 2>/dev/null; then \
+	set -x; $(MAKE) -C figs ; else                   \
+	echo "fig2dev (transfig) not installed; skipping figs."; fi
 
 .PHONY: python-dev-docs
 python-dev-docs:

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:31 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11: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 1TM4V1-00086G-Fj; Wed, 10 Oct 2012 22:11:31 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uz-0007ti-Ou
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:30 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-27.messagelabs.com!1349907080!2365118!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23086 invoked from network); 10 Oct 2012 22:11:21 -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;
	10 Oct 2012 22:11:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uq-0005z7-9X
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uq-0000M4-8E
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:20 +0000
Message-Id: <E1TM4Uq-0000M4-8E@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxc: add ARM support to xc_dom (PV
	domain building)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1349791530 -3600
# Node ID 034ea69233fe5f8d35c91ce77920e3f397bd93f4
# Parent  142e4577f5a9b95832b82f7b6d31fde1697cbe76
libxc: add ARM support to xc_dom (PV domain building)

Includes ARM zImage support.

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


diff -r 142e4577f5a9 -r 034ea69233fe tools/libxc/Makefile
--- a/tools/libxc/Makefile	Tue Oct 09 12:51:37 2012 +0100
+++ b/tools/libxc/Makefile	Tue Oct 09 15:05:30 2012 +0100
@@ -58,6 +58,7 @@ GUEST_SRCS-y += libelf-dominfo.c libelf-
 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_ARM)     += xc_dom_armzimageloader.c
 GUEST_SRCS-y                 += xc_dom_binloader.c
 GUEST_SRCS-y                 += xc_dom_compat_linux.c
 
diff -r 142e4577f5a9 -r 034ea69233fe tools/libxc/xc_dom.h
--- a/tools/libxc/xc_dom.h	Tue Oct 09 12:51:37 2012 +0100
+++ b/tools/libxc/xc_dom.h	Tue Oct 09 15:05:30 2012 +0100
@@ -89,10 +89,24 @@ struct xc_dom_image {
 
     /* other state info */
     uint32_t f_active[XENFEAT_NR_SUBMAPS];
+    /*
+     * p2m_host maps guest physical addresses an offset from
+     * rambase_pfn (see below) into gfns.
+     *
+     * For a pure PV guest this means that it maps GPFNs into MFNs for
+     * a hybrid guest this means that it maps GPFNs to GPFNS.
+     *
+     * Note that the input is offset by rambase.
+     */
     xen_pfn_t *p2m_host;
     void *p2m_guest;
 
-    /* physical memory */
+    /* physical memory
+     *
+     * A PV guest has a single contiguous block of physical RAM,
+     * consisting of total_pages starting at rambase_pfn.
+     */
+    xen_pfn_t rambase_pfn;
     xen_pfn_t total_pages;
     struct xc_dom_phys *phys_pages;
     int realmodearea_log;
@@ -286,7 +300,7 @@ static inline xen_pfn_t xc_dom_p2m_host(
 {
     if (dom->shadow_enabled)
         return pfn;
-    return dom->p2m_host[pfn];
+    return dom->p2m_host[pfn - dom->rambase_pfn];
 }
 
 static inline xen_pfn_t xc_dom_p2m_guest(struct xc_dom_image *dom,
@@ -294,7 +308,7 @@ static inline xen_pfn_t xc_dom_p2m_guest
 {
     if (xc_dom_feature_translated(dom))
         return pfn;
-    return dom->p2m_host[pfn];
+    return dom->p2m_host[pfn - dom->rambase_pfn];
 }
 
 /* --- arch bits --------------------------------------------------- */
diff -r 142e4577f5a9 -r 034ea69233fe tools/libxc/xc_dom_arm.c
--- a/tools/libxc/xc_dom_arm.c	Tue Oct 09 12:51:37 2012 +0100
+++ b/tools/libxc/xc_dom_arm.c	Tue Oct 09 15:05:30 2012 +0100
@@ -18,14 +18,143 @@
  * Copyright (c) 2011, Citrix Systems
  */
 #include <inttypes.h>
+
 #include <xen/xen.h>
+#include <xen/io/protocols.h>
+
 #include "xg_private.h"
 #include "xc_dom.h"
 
+/* ------------------------------------------------------------------------ */
+/*
+ * arm guests are hybrid and start off with paging disabled, therefore no
+ * pagetables and nothing to do here.
+ */
+static int count_pgtables_arm(struct xc_dom_image *dom)
+{
+    DOMPRINTF_CALLED(dom->xch);
+    return 0;
+}
+
+static int setup_pgtables_arm(struct xc_dom_image *dom)
+{
+    DOMPRINTF_CALLED(dom->xch);
+    return 0;
+}
+
+/* ------------------------------------------------------------------------ */
+
+static int alloc_magic_pages(struct xc_dom_image *dom)
+{
+    DOMPRINTF_CALLED(dom->xch);
+    /* XXX
+     *   dom->p2m_guest
+     *   dom->start_info_pfn
+     *   dom->xenstore_pfn
+     *   dom->console_pfn
+     */
+    return 0;
+}
+
+/* ------------------------------------------------------------------------ */
+
+static int start_info_arm(struct xc_dom_image *dom)
+{
+    DOMPRINTF_CALLED(dom->xch);
+    return 0;
+}
+
+static int shared_info_arm(struct xc_dom_image *dom, void *ptr)
+{
+    DOMPRINTF_CALLED(dom->xch);
+    return 0;
+}
+
+/* ------------------------------------------------------------------------ */
+
+static int vcpu_arm(struct xc_dom_image *dom, void *ptr)
+{
+    vcpu_guest_context_t *ctxt = ptr;
+
+    DOMPRINTF_CALLED(dom->xch);
+
+    /* clear everything */
+    memset(ctxt, 0, sizeof(*ctxt));
+
+    ctxt->user_regs.pc = dom->parms.virt_entry;
+
+    /* Linux boot protocol. See linux.Documentation/arm/Booting. */
+    ctxt->user_regs.r0 = 0; /* SBZ */
+    /* Machine ID: We use DTB therefore no machine id */
+    ctxt->user_regs.r1 = 0xffffffff;
+    /* ATAGS/DTB: We currently require that the guest kernel to be
+     * using CONFIG_ARM_APPENDED_DTB. Ensure that r2 does not look
+     * like a valid pointer to a set of ATAGS or a DTB.
+     */
+    ctxt->user_regs.r2 = 0xffffffff;
+
+    ctxt->sctlr = /* #define SCTLR_BASE */0x00c50078;
+
+    ctxt->ttbr0 = 0;
+    ctxt->ttbr1 = 0;
+    ctxt->ttbcr = 0; /* Defined Reset Value */
+
+    ctxt->user_regs.cpsr = PSR_ABT_MASK|PSR_FIQ_MASK|PSR_IRQ_MASK|PSR_MODE_SVC;
+
+    DOMPRINTF("Initial state CPSR %#"PRIx32" PC %#"PRIx32,
+           ctxt->user_regs.cpsr, ctxt->user_regs.pc);
+
+    return 0;
+}
+
+/* ------------------------------------------------------------------------ */
+
+static struct xc_dom_arch xc_dom_32 = {
+    .guest_type = "xen-3.0-armv7l",
+    .native_protocol = XEN_IO_PROTO_ABI_ARM,
+    .page_shift = PAGE_SHIFT_ARM,
+    .sizeof_pfn = 8,
+    .alloc_magic_pages = alloc_magic_pages,
+    .count_pgtables = count_pgtables_arm,
+    .setup_pgtables = setup_pgtables_arm,
+    .start_info = start_info_arm,
+    .shared_info = shared_info_arm,
+    .vcpu = vcpu_arm,
+};
+
+static void __init register_arch_hooks(void)
+{
+    xc_dom_register_arch_hooks(&xc_dom_32);
+}
+
 int arch_setup_meminit(struct xc_dom_image *dom)
 {
-    errno = ENOSYS;
-    return -1;
+    int rc;
+    xen_pfn_t pfn, allocsz, i;
+
+    dom->shadow_enabled = 1;
+
+    dom->p2m_host = xc_dom_malloc(dom, sizeof(xen_pfn_t) * dom->total_pages);
+
+    /* setup initial p2m */
+    for ( pfn = 0; pfn < dom->total_pages; pfn++ )
+        dom->p2m_host[pfn] = pfn + dom->rambase_pfn;
+
+    /* allocate guest memory */
+    for ( i = rc = allocsz = 0;
+          (i < dom->total_pages) && !rc;
+          i += allocsz )
+    {
+        allocsz = dom->total_pages - i;
+        if ( allocsz > 1024*1024 )
+            allocsz = 1024*1024;
+
+        rc = xc_domain_populate_physmap_exact(
+            dom->xch, dom->guest_domid, allocsz,
+            0, 0, &dom->p2m_host[i]);
+    }
+
+    return 0;
 }
 
 int arch_setup_bootearly(struct xc_dom_image *dom)
@@ -36,9 +165,14 @@ int arch_setup_bootearly(struct xc_dom_i
 
 int arch_setup_bootlate(struct xc_dom_image *dom)
 {
-    DOMPRINTF("%s: doing nothing", __FUNCTION__);
+    /* XXX
+     *   map shared info
+     *   map grant tables
+     *   setup shared info
+     */
     return 0;
 }
+
 /*
  * Local variables:
  * mode: C
diff -r 142e4577f5a9 -r 034ea69233fe tools/libxc/xc_dom_armzimageloader.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/libxc/xc_dom_armzimageloader.c	Tue Oct 09 15:05:30 2012 +0100
@@ -0,0 +1,174 @@
+/*
+ * Xen domain builder -- ARM zImage bits
+ *
+ * Parse and load ARM zImage kernel images.
+ *
+ * Copyright (C) 2012, Citrix Systems.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <inttypes.h>
+
+#include "xg_private.h"
+#include "xc_dom.h"
+
+#include <arpa/inet.h> /* XXX ntohl is not the right function... */
+
+/*
+ * Guest virtual RAM starts here. This must be consistent with the DTB
+ * appended to the guest kernel.
+ */
+#define GUEST_RAM_BASE 0x80000000
+
+#define ZIMAGE_MAGIC_OFFSET 0x24
+#define ZIMAGE_START_OFFSET 0x28
+#define ZIMAGE_END_OFFSET   0x2c
+
+#define ZIMAGE_MAGIC 0x016f2818
+
+struct minimal_dtb_header {
+    uint32_t magic;
+    uint32_t total_size;
+    /* There are other fields but we don't use them yet. */
+};
+
+#define DTB_MAGIC 0xd00dfeed
+
+static int xc_dom_probe_zimage_kernel(struct xc_dom_image *dom)
+{
+    uint32_t *zimage;
+    uint32_t end;
+
+    if ( dom->kernel_blob == NULL )
+    {
+        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                     "%s: no kernel image loaded", __FUNCTION__);
+        return -EINVAL;
+    }
+
+    if ( dom->kernel_size < 0x30 /*sizeof(struct setup_header)*/ )
+    {
+        xc_dom_printf(dom->xch, "%s: kernel image too small", __FUNCTION__);
+        return -EINVAL;
+    }
+
+    zimage = (uint32_t *)dom->kernel_blob;
+    if ( zimage[ZIMAGE_MAGIC_OFFSET/4] != ZIMAGE_MAGIC )
+    {
+        xc_dom_printf(dom->xch, "%s: kernel is not a bzImage", __FUNCTION__);
+        return -EINVAL;
+    }
+
+    end = zimage[ZIMAGE_END_OFFSET/4];
+
+    /*
+     * Check for an appended DTB.
+     */
+    if ( end + sizeof(struct minimal_dtb_header) < dom->kernel_size ) {
+        struct minimal_dtb_header *dtb_hdr;
+        dtb_hdr = (struct minimal_dtb_header *)(dom->kernel_blob + end);
+        if (ntohl/*be32_to_cpu*/(dtb_hdr->magic) == DTB_MAGIC) {
+            xc_dom_printf(dom->xch, "%s: found an appended DTB", __FUNCTION__);
+            end += ntohl/*be32_to_cpu*/(dtb_hdr->total_size);
+        }
+    }
+
+    dom->kernel_size = end;
+
+    return 0;
+}
+
+static int xc_dom_parse_zimage_kernel(struct xc_dom_image *dom)
+{
+    uint32_t *zimage;
+    uint32_t start, entry_addr;
+    uint64_t v_start, v_end;
+    uint64_t rambase = GUEST_RAM_BASE;
+
+    DOMPRINTF_CALLED(dom->xch);
+
+    zimage = (uint32_t *)dom->kernel_blob;
+
+    dom->rambase_pfn = rambase >> XC_PAGE_SHIFT;
+
+    /* Do not load kernel at the very first RAM address */
+    v_start = rambase + 0x8000;
+    v_end = v_start + dom->kernel_size;
+
+    start = zimage[ZIMAGE_START_OFFSET/4];
+
+    if (start == 0)
+        entry_addr = v_start;
+    else
+        entry_addr = start;
+
+    /* find kernel segment */
+    dom->kernel_seg.vstart = v_start;
+    dom->kernel_seg.vend   = v_end;
+
+    dom->parms.virt_entry = entry_addr;
+
+    dom->guest_type = "xen-3.0-armv7l";
+    DOMPRINTF("%s: %s: RAM starts at %"PRI_xen_pfn,
+              __FUNCTION__, dom->guest_type, dom->rambase_pfn);
+    DOMPRINTF("%s: %s: 0x%" PRIx64 " -> 0x%" PRIx64 "",
+              __FUNCTION__, dom->guest_type,
+              dom->kernel_seg.vstart, dom->kernel_seg.vend);
+    return 0;
+}
+
+static int xc_dom_load_zimage_kernel(struct xc_dom_image *dom)
+{
+    void *dst;
+
+    DOMPRINTF_CALLED(dom->xch);
+
+    dst = xc_dom_seg_to_ptr(dom, &dom->kernel_seg);
+
+    DOMPRINTF("%s: kernel sed %#"PRIx64"-%#"PRIx64,
+              __func__, dom->kernel_seg.vstart, dom->kernel_seg.vend);
+    DOMPRINTF("%s: copy %zd bytes from blob %p to dst %p",
+              __func__, dom->kernel_size, dom->kernel_blob, dst);
+
+    memcpy(dst, dom->kernel_blob, dom->kernel_size);
+
+    return 0;
+}
+
+static struct xc_dom_loader zimage_loader = {
+    .name = "Linux zImage (ARM)",
+    .probe = xc_dom_probe_zimage_kernel,
+    .parser = xc_dom_parse_zimage_kernel,
+    .loader = xc_dom_load_zimage_kernel,
+};
+
+static void __init register_loader(void)
+{
+    xc_dom_register_loader(&zimage_loader);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r 142e4577f5a9 -r 034ea69233fe tools/libxc/xc_dom_core.c
--- a/tools/libxc/xc_dom_core.c	Tue Oct 09 12:51:37 2012 +0100
+++ b/tools/libxc/xc_dom_core.c	Tue Oct 09 15:05:30 2012 +0100
@@ -307,15 +307,17 @@ void *xc_dom_pfn_to_ptr(struct xc_dom_im
                         xen_pfn_t count)
 {
     struct xc_dom_phys *phys;
+    xen_pfn_t offset;
     unsigned int page_shift = XC_DOM_PAGE_SHIFT(dom);
     char *mode = "unset";
 
-    if ( pfn > dom->total_pages ||    /* multiple checks to avoid overflows */
+    offset = pfn - dom->rambase_pfn;
+    if ( offset > dom->total_pages || /* multiple checks to avoid overflows */
          count > dom->total_pages ||
-         pfn > dom->total_pages - count )
+         offset > dom->total_pages - count )
     {
-        DOMPRINTF("%s: pfn out of range (0x%" PRIpfn " > 0x%" PRIpfn ")",
-                  __FUNCTION__, pfn, dom->total_pages);
+        DOMPRINTF("%s: pfn %"PRI_xen_pfn" out of range (0x%" PRIpfn " > 0x%" PRIpfn ")",
+                  __FUNCTION__, pfn, offset, dom->total_pages);
         return NULL;
     }
 
diff -r 142e4577f5a9 -r 034ea69233fe tools/libxc/xg_private.h
--- a/tools/libxc/xg_private.h	Tue Oct 09 12:51:37 2012 +0100
+++ b/tools/libxc/xg_private.h	Tue Oct 09 15:05:30 2012 +0100
@@ -148,6 +148,10 @@ typedef l4_pgentry_64_t l4_pgentry_t;
 #define l4_table_offset(_a) l4_table_offset_x86_64(_a)
 #endif
 
+#define PAGE_SHIFT_ARM          12
+#define PAGE_SIZE_ARM           (1UL << PAGE_SHIFT_ARM)
+#define PAGE_MASK_ARM           (~(PAGE_SIZE_ARM-1))
+
 #define PAGE_SHIFT_X86          12
 #define PAGE_SIZE_X86           (1UL << PAGE_SHIFT_X86)
 #define PAGE_MASK_X86           (~(PAGE_SIZE_X86-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 10 22:11:31 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11: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 1TM4V1-00086G-Fj; Wed, 10 Oct 2012 22:11:31 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uz-0007ti-Ou
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:30 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-27.messagelabs.com!1349907080!2365118!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23086 invoked from network); 10 Oct 2012 22:11:21 -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;
	10 Oct 2012 22:11:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uq-0005z7-9X
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uq-0000M4-8E
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:20 +0000
Message-Id: <E1TM4Uq-0000M4-8E@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxc: add ARM support to xc_dom (PV
	domain building)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1349791530 -3600
# Node ID 034ea69233fe5f8d35c91ce77920e3f397bd93f4
# Parent  142e4577f5a9b95832b82f7b6d31fde1697cbe76
libxc: add ARM support to xc_dom (PV domain building)

Includes ARM zImage support.

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


diff -r 142e4577f5a9 -r 034ea69233fe tools/libxc/Makefile
--- a/tools/libxc/Makefile	Tue Oct 09 12:51:37 2012 +0100
+++ b/tools/libxc/Makefile	Tue Oct 09 15:05:30 2012 +0100
@@ -58,6 +58,7 @@ GUEST_SRCS-y += libelf-dominfo.c libelf-
 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_ARM)     += xc_dom_armzimageloader.c
 GUEST_SRCS-y                 += xc_dom_binloader.c
 GUEST_SRCS-y                 += xc_dom_compat_linux.c
 
diff -r 142e4577f5a9 -r 034ea69233fe tools/libxc/xc_dom.h
--- a/tools/libxc/xc_dom.h	Tue Oct 09 12:51:37 2012 +0100
+++ b/tools/libxc/xc_dom.h	Tue Oct 09 15:05:30 2012 +0100
@@ -89,10 +89,24 @@ struct xc_dom_image {
 
     /* other state info */
     uint32_t f_active[XENFEAT_NR_SUBMAPS];
+    /*
+     * p2m_host maps guest physical addresses an offset from
+     * rambase_pfn (see below) into gfns.
+     *
+     * For a pure PV guest this means that it maps GPFNs into MFNs for
+     * a hybrid guest this means that it maps GPFNs to GPFNS.
+     *
+     * Note that the input is offset by rambase.
+     */
     xen_pfn_t *p2m_host;
     void *p2m_guest;
 
-    /* physical memory */
+    /* physical memory
+     *
+     * A PV guest has a single contiguous block of physical RAM,
+     * consisting of total_pages starting at rambase_pfn.
+     */
+    xen_pfn_t rambase_pfn;
     xen_pfn_t total_pages;
     struct xc_dom_phys *phys_pages;
     int realmodearea_log;
@@ -286,7 +300,7 @@ static inline xen_pfn_t xc_dom_p2m_host(
 {
     if (dom->shadow_enabled)
         return pfn;
-    return dom->p2m_host[pfn];
+    return dom->p2m_host[pfn - dom->rambase_pfn];
 }
 
 static inline xen_pfn_t xc_dom_p2m_guest(struct xc_dom_image *dom,
@@ -294,7 +308,7 @@ static inline xen_pfn_t xc_dom_p2m_guest
 {
     if (xc_dom_feature_translated(dom))
         return pfn;
-    return dom->p2m_host[pfn];
+    return dom->p2m_host[pfn - dom->rambase_pfn];
 }
 
 /* --- arch bits --------------------------------------------------- */
diff -r 142e4577f5a9 -r 034ea69233fe tools/libxc/xc_dom_arm.c
--- a/tools/libxc/xc_dom_arm.c	Tue Oct 09 12:51:37 2012 +0100
+++ b/tools/libxc/xc_dom_arm.c	Tue Oct 09 15:05:30 2012 +0100
@@ -18,14 +18,143 @@
  * Copyright (c) 2011, Citrix Systems
  */
 #include <inttypes.h>
+
 #include <xen/xen.h>
+#include <xen/io/protocols.h>
+
 #include "xg_private.h"
 #include "xc_dom.h"
 
+/* ------------------------------------------------------------------------ */
+/*
+ * arm guests are hybrid and start off with paging disabled, therefore no
+ * pagetables and nothing to do here.
+ */
+static int count_pgtables_arm(struct xc_dom_image *dom)
+{
+    DOMPRINTF_CALLED(dom->xch);
+    return 0;
+}
+
+static int setup_pgtables_arm(struct xc_dom_image *dom)
+{
+    DOMPRINTF_CALLED(dom->xch);
+    return 0;
+}
+
+/* ------------------------------------------------------------------------ */
+
+static int alloc_magic_pages(struct xc_dom_image *dom)
+{
+    DOMPRINTF_CALLED(dom->xch);
+    /* XXX
+     *   dom->p2m_guest
+     *   dom->start_info_pfn
+     *   dom->xenstore_pfn
+     *   dom->console_pfn
+     */
+    return 0;
+}
+
+/* ------------------------------------------------------------------------ */
+
+static int start_info_arm(struct xc_dom_image *dom)
+{
+    DOMPRINTF_CALLED(dom->xch);
+    return 0;
+}
+
+static int shared_info_arm(struct xc_dom_image *dom, void *ptr)
+{
+    DOMPRINTF_CALLED(dom->xch);
+    return 0;
+}
+
+/* ------------------------------------------------------------------------ */
+
+static int vcpu_arm(struct xc_dom_image *dom, void *ptr)
+{
+    vcpu_guest_context_t *ctxt = ptr;
+
+    DOMPRINTF_CALLED(dom->xch);
+
+    /* clear everything */
+    memset(ctxt, 0, sizeof(*ctxt));
+
+    ctxt->user_regs.pc = dom->parms.virt_entry;
+
+    /* Linux boot protocol. See linux.Documentation/arm/Booting. */
+    ctxt->user_regs.r0 = 0; /* SBZ */
+    /* Machine ID: We use DTB therefore no machine id */
+    ctxt->user_regs.r1 = 0xffffffff;
+    /* ATAGS/DTB: We currently require that the guest kernel to be
+     * using CONFIG_ARM_APPENDED_DTB. Ensure that r2 does not look
+     * like a valid pointer to a set of ATAGS or a DTB.
+     */
+    ctxt->user_regs.r2 = 0xffffffff;
+
+    ctxt->sctlr = /* #define SCTLR_BASE */0x00c50078;
+
+    ctxt->ttbr0 = 0;
+    ctxt->ttbr1 = 0;
+    ctxt->ttbcr = 0; /* Defined Reset Value */
+
+    ctxt->user_regs.cpsr = PSR_ABT_MASK|PSR_FIQ_MASK|PSR_IRQ_MASK|PSR_MODE_SVC;
+
+    DOMPRINTF("Initial state CPSR %#"PRIx32" PC %#"PRIx32,
+           ctxt->user_regs.cpsr, ctxt->user_regs.pc);
+
+    return 0;
+}
+
+/* ------------------------------------------------------------------------ */
+
+static struct xc_dom_arch xc_dom_32 = {
+    .guest_type = "xen-3.0-armv7l",
+    .native_protocol = XEN_IO_PROTO_ABI_ARM,
+    .page_shift = PAGE_SHIFT_ARM,
+    .sizeof_pfn = 8,
+    .alloc_magic_pages = alloc_magic_pages,
+    .count_pgtables = count_pgtables_arm,
+    .setup_pgtables = setup_pgtables_arm,
+    .start_info = start_info_arm,
+    .shared_info = shared_info_arm,
+    .vcpu = vcpu_arm,
+};
+
+static void __init register_arch_hooks(void)
+{
+    xc_dom_register_arch_hooks(&xc_dom_32);
+}
+
 int arch_setup_meminit(struct xc_dom_image *dom)
 {
-    errno = ENOSYS;
-    return -1;
+    int rc;
+    xen_pfn_t pfn, allocsz, i;
+
+    dom->shadow_enabled = 1;
+
+    dom->p2m_host = xc_dom_malloc(dom, sizeof(xen_pfn_t) * dom->total_pages);
+
+    /* setup initial p2m */
+    for ( pfn = 0; pfn < dom->total_pages; pfn++ )
+        dom->p2m_host[pfn] = pfn + dom->rambase_pfn;
+
+    /* allocate guest memory */
+    for ( i = rc = allocsz = 0;
+          (i < dom->total_pages) && !rc;
+          i += allocsz )
+    {
+        allocsz = dom->total_pages - i;
+        if ( allocsz > 1024*1024 )
+            allocsz = 1024*1024;
+
+        rc = xc_domain_populate_physmap_exact(
+            dom->xch, dom->guest_domid, allocsz,
+            0, 0, &dom->p2m_host[i]);
+    }
+
+    return 0;
 }
 
 int arch_setup_bootearly(struct xc_dom_image *dom)
@@ -36,9 +165,14 @@ int arch_setup_bootearly(struct xc_dom_i
 
 int arch_setup_bootlate(struct xc_dom_image *dom)
 {
-    DOMPRINTF("%s: doing nothing", __FUNCTION__);
+    /* XXX
+     *   map shared info
+     *   map grant tables
+     *   setup shared info
+     */
     return 0;
 }
+
 /*
  * Local variables:
  * mode: C
diff -r 142e4577f5a9 -r 034ea69233fe tools/libxc/xc_dom_armzimageloader.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/libxc/xc_dom_armzimageloader.c	Tue Oct 09 15:05:30 2012 +0100
@@ -0,0 +1,174 @@
+/*
+ * Xen domain builder -- ARM zImage bits
+ *
+ * Parse and load ARM zImage kernel images.
+ *
+ * Copyright (C) 2012, Citrix Systems.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <inttypes.h>
+
+#include "xg_private.h"
+#include "xc_dom.h"
+
+#include <arpa/inet.h> /* XXX ntohl is not the right function... */
+
+/*
+ * Guest virtual RAM starts here. This must be consistent with the DTB
+ * appended to the guest kernel.
+ */
+#define GUEST_RAM_BASE 0x80000000
+
+#define ZIMAGE_MAGIC_OFFSET 0x24
+#define ZIMAGE_START_OFFSET 0x28
+#define ZIMAGE_END_OFFSET   0x2c
+
+#define ZIMAGE_MAGIC 0x016f2818
+
+struct minimal_dtb_header {
+    uint32_t magic;
+    uint32_t total_size;
+    /* There are other fields but we don't use them yet. */
+};
+
+#define DTB_MAGIC 0xd00dfeed
+
+static int xc_dom_probe_zimage_kernel(struct xc_dom_image *dom)
+{
+    uint32_t *zimage;
+    uint32_t end;
+
+    if ( dom->kernel_blob == NULL )
+    {
+        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                     "%s: no kernel image loaded", __FUNCTION__);
+        return -EINVAL;
+    }
+
+    if ( dom->kernel_size < 0x30 /*sizeof(struct setup_header)*/ )
+    {
+        xc_dom_printf(dom->xch, "%s: kernel image too small", __FUNCTION__);
+        return -EINVAL;
+    }
+
+    zimage = (uint32_t *)dom->kernel_blob;
+    if ( zimage[ZIMAGE_MAGIC_OFFSET/4] != ZIMAGE_MAGIC )
+    {
+        xc_dom_printf(dom->xch, "%s: kernel is not a bzImage", __FUNCTION__);
+        return -EINVAL;
+    }
+
+    end = zimage[ZIMAGE_END_OFFSET/4];
+
+    /*
+     * Check for an appended DTB.
+     */
+    if ( end + sizeof(struct minimal_dtb_header) < dom->kernel_size ) {
+        struct minimal_dtb_header *dtb_hdr;
+        dtb_hdr = (struct minimal_dtb_header *)(dom->kernel_blob + end);
+        if (ntohl/*be32_to_cpu*/(dtb_hdr->magic) == DTB_MAGIC) {
+            xc_dom_printf(dom->xch, "%s: found an appended DTB", __FUNCTION__);
+            end += ntohl/*be32_to_cpu*/(dtb_hdr->total_size);
+        }
+    }
+
+    dom->kernel_size = end;
+
+    return 0;
+}
+
+static int xc_dom_parse_zimage_kernel(struct xc_dom_image *dom)
+{
+    uint32_t *zimage;
+    uint32_t start, entry_addr;
+    uint64_t v_start, v_end;
+    uint64_t rambase = GUEST_RAM_BASE;
+
+    DOMPRINTF_CALLED(dom->xch);
+
+    zimage = (uint32_t *)dom->kernel_blob;
+
+    dom->rambase_pfn = rambase >> XC_PAGE_SHIFT;
+
+    /* Do not load kernel at the very first RAM address */
+    v_start = rambase + 0x8000;
+    v_end = v_start + dom->kernel_size;
+
+    start = zimage[ZIMAGE_START_OFFSET/4];
+
+    if (start == 0)
+        entry_addr = v_start;
+    else
+        entry_addr = start;
+
+    /* find kernel segment */
+    dom->kernel_seg.vstart = v_start;
+    dom->kernel_seg.vend   = v_end;
+
+    dom->parms.virt_entry = entry_addr;
+
+    dom->guest_type = "xen-3.0-armv7l";
+    DOMPRINTF("%s: %s: RAM starts at %"PRI_xen_pfn,
+              __FUNCTION__, dom->guest_type, dom->rambase_pfn);
+    DOMPRINTF("%s: %s: 0x%" PRIx64 " -> 0x%" PRIx64 "",
+              __FUNCTION__, dom->guest_type,
+              dom->kernel_seg.vstart, dom->kernel_seg.vend);
+    return 0;
+}
+
+static int xc_dom_load_zimage_kernel(struct xc_dom_image *dom)
+{
+    void *dst;
+
+    DOMPRINTF_CALLED(dom->xch);
+
+    dst = xc_dom_seg_to_ptr(dom, &dom->kernel_seg);
+
+    DOMPRINTF("%s: kernel sed %#"PRIx64"-%#"PRIx64,
+              __func__, dom->kernel_seg.vstart, dom->kernel_seg.vend);
+    DOMPRINTF("%s: copy %zd bytes from blob %p to dst %p",
+              __func__, dom->kernel_size, dom->kernel_blob, dst);
+
+    memcpy(dst, dom->kernel_blob, dom->kernel_size);
+
+    return 0;
+}
+
+static struct xc_dom_loader zimage_loader = {
+    .name = "Linux zImage (ARM)",
+    .probe = xc_dom_probe_zimage_kernel,
+    .parser = xc_dom_parse_zimage_kernel,
+    .loader = xc_dom_load_zimage_kernel,
+};
+
+static void __init register_loader(void)
+{
+    xc_dom_register_loader(&zimage_loader);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r 142e4577f5a9 -r 034ea69233fe tools/libxc/xc_dom_core.c
--- a/tools/libxc/xc_dom_core.c	Tue Oct 09 12:51:37 2012 +0100
+++ b/tools/libxc/xc_dom_core.c	Tue Oct 09 15:05:30 2012 +0100
@@ -307,15 +307,17 @@ void *xc_dom_pfn_to_ptr(struct xc_dom_im
                         xen_pfn_t count)
 {
     struct xc_dom_phys *phys;
+    xen_pfn_t offset;
     unsigned int page_shift = XC_DOM_PAGE_SHIFT(dom);
     char *mode = "unset";
 
-    if ( pfn > dom->total_pages ||    /* multiple checks to avoid overflows */
+    offset = pfn - dom->rambase_pfn;
+    if ( offset > dom->total_pages || /* multiple checks to avoid overflows */
          count > dom->total_pages ||
-         pfn > dom->total_pages - count )
+         offset > dom->total_pages - count )
     {
-        DOMPRINTF("%s: pfn out of range (0x%" PRIpfn " > 0x%" PRIpfn ")",
-                  __FUNCTION__, pfn, dom->total_pages);
+        DOMPRINTF("%s: pfn %"PRI_xen_pfn" out of range (0x%" PRIpfn " > 0x%" PRIpfn ")",
+                  __FUNCTION__, pfn, offset, dom->total_pages);
         return NULL;
     }
 
diff -r 142e4577f5a9 -r 034ea69233fe tools/libxc/xg_private.h
--- a/tools/libxc/xg_private.h	Tue Oct 09 12:51:37 2012 +0100
+++ b/tools/libxc/xg_private.h	Tue Oct 09 15:05:30 2012 +0100
@@ -148,6 +148,10 @@ typedef l4_pgentry_64_t l4_pgentry_t;
 #define l4_table_offset(_a) l4_table_offset_x86_64(_a)
 #endif
 
+#define PAGE_SHIFT_ARM          12
+#define PAGE_SIZE_ARM           (1UL << PAGE_SHIFT_ARM)
+#define PAGE_MASK_ARM           (~(PAGE_SIZE_ARM-1))
+
 #define PAGE_SHIFT_X86          12
 #define PAGE_SIZE_X86           (1UL << PAGE_SHIFT_X86)
 #define PAGE_MASK_X86           (~(PAGE_SIZE_X86-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 10 22:11:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4V1-000873-Od; Wed, 10 Oct 2012 22:11:31 +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 1TM4V0-00082V-89
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:30 +0000
Received: from [85.158.138.51:34829] by server-5.bemta-3.messagelabs.com id
	71/60-12440-192F5705; Wed, 10 Oct 2012 22:11:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-174.messagelabs.com!1349907087!25012878!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25191 invoked from network); 10 Oct 2012 22:11:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ux-00060f-Ls
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ux-0000PS-KJ
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:27 +0000
Message-Id: <E1TM4Ux-0000PS-KJ@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:27 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs,
	build: Tolerate missing pod2text
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <ian.jackson@eu.citrix.com>
# Date 1349801999 -3600
# Node ID f92152f52a853ccf5e9ab2cd81a4fc33a61f444a
# Parent  af59cce8d1fd2a592006e188c3e3b42f5bd56fd0
docs, build: Tolerate missing pod2text

We gate the whole of the "txt" target on pod2text.  I think this is
better than gating only the pod-generated outputs; it avoids a partial
output tree.

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


diff -r af59cce8d1fd -r f92152f52a85 docs/Makefile
--- a/docs/Makefile	Tue Oct 09 17:59:58 2012 +0100
+++ b/docs/Makefile	Tue Oct 09 17:59:59 2012 +0100
@@ -38,7 +38,10 @@ dev-docs: python-dev-docs
 html: $(DOC_HTML) html/index.html
 
 .PHONY: txt
-txt: $(DOC_TXT)
+txt:
+	@if which $(POD2TEXT) 1>/dev/null 2>/dev/null; then \
+	$(MAKE) $(DOC_TXT); else              \
+	echo "pod2text not installed; skipping text outputs."; fi
 
 .PHONY: figs
 figs:

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4V1-000873-Od; Wed, 10 Oct 2012 22:11:31 +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 1TM4V0-00082V-89
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:30 +0000
Received: from [85.158.138.51:34829] by server-5.bemta-3.messagelabs.com id
	71/60-12440-192F5705; Wed, 10 Oct 2012 22:11:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-174.messagelabs.com!1349907087!25012878!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25191 invoked from network); 10 Oct 2012 22:11:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ux-00060f-Ls
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ux-0000PS-KJ
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:27 +0000
Message-Id: <E1TM4Ux-0000PS-KJ@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:27 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs,
	build: Tolerate missing pod2text
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <ian.jackson@eu.citrix.com>
# Date 1349801999 -3600
# Node ID f92152f52a853ccf5e9ab2cd81a4fc33a61f444a
# Parent  af59cce8d1fd2a592006e188c3e3b42f5bd56fd0
docs, build: Tolerate missing pod2text

We gate the whole of the "txt" target on pod2text.  I think this is
better than gating only the pod-generated outputs; it avoids a partial
output tree.

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


diff -r af59cce8d1fd -r f92152f52a85 docs/Makefile
--- a/docs/Makefile	Tue Oct 09 17:59:58 2012 +0100
+++ b/docs/Makefile	Tue Oct 09 17:59:59 2012 +0100
@@ -38,7 +38,10 @@ dev-docs: python-dev-docs
 html: $(DOC_HTML) html/index.html
 
 .PHONY: txt
-txt: $(DOC_TXT)
+txt:
+	@if which $(POD2TEXT) 1>/dev/null 2>/dev/null; then \
+	$(MAKE) $(DOC_TXT); else              \
+	echo "pod2text not installed; skipping text outputs."; fi
 
 .PHONY: figs
 figs:

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4V1-00087f-U2; Wed, 10 Oct 2012 22:11:31 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4V0-0007vE-7s
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:30 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1349907082!9588703!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25802 invoked from network); 10 Oct 2012 22:11:23 -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;
	10 Oct 2012 22:11:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Us-0005ze-Cv
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Us-0000N2-Be
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:22 +0000
Message-Id: <E1TM4Us-0000N2-Be@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen/arm: create_p2m_entries should
	not call free_domheap_page
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1349791534 -3600
# Node ID f91b841ff95caaaf0cb8f333f5a95f7b562cab76
# Parent  b98da9b014141929a02a2ea679bf7f5c6edcf7f4
xen/arm: create_p2m_entries should not call free_domheap_page

The guest is entitled to leak a page from its p2m (by overwriting it) if
it wants to. Since the memory is effectively lost to it (can't even be
recovered by XENMEM increase reservation etc).

In these cases we shouldn't call free_domheap_page to free the existing
page from create_p2m_entries, because it resets the reference counting
but the page is still allocated to the guest (even if not in the p2m
anymore) and common grant_table code is also going to call put_page on
it.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r b98da9b01414 -r f91b841ff95c xen/arch/arm/p2m.c
--- a/xen/arch/arm/p2m.c	Tue Oct 09 15:05:33 2012 +0100
+++ b/xen/arch/arm/p2m.c	Tue Oct 09 15:05:34 2012 +0100
@@ -189,12 +189,7 @@ static int create_p2m_entries(struct dom
         /* else: third already valid */
 
         if ( third[third_table_offset(addr)].p2m.valid )
-        {
-            /* p2m entry already present */
-            free_domheap_page(
-                    mfn_to_page(third[third_table_offset(addr)].p2m.base));
             flush_tlb_all_local();
-        }
 
         /* Allocate a new RAM page and attach */
         switch (op) {

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4V1-00087f-U2; Wed, 10 Oct 2012 22:11:31 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4V0-0007vE-7s
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:30 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1349907082!9588703!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25802 invoked from network); 10 Oct 2012 22:11:23 -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;
	10 Oct 2012 22:11:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Us-0005ze-Cv
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Us-0000N2-Be
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:22 +0000
Message-Id: <E1TM4Us-0000N2-Be@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen/arm: create_p2m_entries should
	not call free_domheap_page
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1349791534 -3600
# Node ID f91b841ff95caaaf0cb8f333f5a95f7b562cab76
# Parent  b98da9b014141929a02a2ea679bf7f5c6edcf7f4
xen/arm: create_p2m_entries should not call free_domheap_page

The guest is entitled to leak a page from its p2m (by overwriting it) if
it wants to. Since the memory is effectively lost to it (can't even be
recovered by XENMEM increase reservation etc).

In these cases we shouldn't call free_domheap_page to free the existing
page from create_p2m_entries, because it resets the reference counting
but the page is still allocated to the guest (even if not in the p2m
anymore) and common grant_table code is also going to call put_page on
it.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r b98da9b01414 -r f91b841ff95c xen/arch/arm/p2m.c
--- a/xen/arch/arm/p2m.c	Tue Oct 09 15:05:33 2012 +0100
+++ b/xen/arch/arm/p2m.c	Tue Oct 09 15:05:34 2012 +0100
@@ -189,12 +189,7 @@ static int create_p2m_entries(struct dom
         /* else: third already valid */
 
         if ( third[third_table_offset(addr)].p2m.valid )
-        {
-            /* p2m entry already present */
-            free_domheap_page(
-                    mfn_to_page(third[third_table_offset(addr)].p2m.base));
             flush_tlb_all_local();
-        }
 
         /* Allocate a new RAM page and attach */
         switch (op) {

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4V2-00088J-71; Wed, 10 Oct 2012 22:11:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4V0-00083n-Sv
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:31 +0000
Received: from [85.158.138.51:34844] by server-7.bemta-3.messagelabs.com id
	B0/0D-06991-192F5705; Wed, 10 Oct 2012 22:11:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1349907088!33813946!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9082 invoked from network); 10 Oct 2012 22:11:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uy-00060k-67
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uy-0000Ph-4p
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:28 +0000
Message-Id: <E1TM4Uy-0000Ph-4p@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:27 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs,
	build: Do not ignore install-docs errors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <ian.jackson@eu.citrix.com>
# Date 1349802000 -3600
# Node ID 3696dd6a7836079c8436719ea03541a8410051a7
# Parent  f92152f52a853ccf5e9ab2cd81a4fc33a61f444a
docs, build: Do not ignore install-docs errors

In the toplevel Makefile "install-docs" (depended on by "install" and
hence "dist"), but not "build", ignores errors.

This was inherited from before 24563:4271634e4c86, prior to which the
||true seems intended to handle failures of check_pkgs.  Nowadays we
handle docs tools individually in the docs makefiles so there is no
need for this ||true here.

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


diff -r f92152f52a85 -r 3696dd6a7836 Makefile
--- a/Makefile	Tue Oct 09 17:59:59 2012 +0100
+++ b/Makefile	Tue Oct 09 18:00:00 2012 +0100
@@ -103,7 +103,7 @@ tools/firmware/seabios-dir-force-update:
 
 .PHONY: install-docs
 install-docs:
-	$(MAKE) -C docs install || true
+	$(MAKE) -C docs install
 
 .PHONY: dev-docs
 dev-docs:

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22:11:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TM4V2-00088J-71; Wed, 10 Oct 2012 22:11:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4V0-00083n-Sv
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:31 +0000
Received: from [85.158.138.51:34844] by server-7.bemta-3.messagelabs.com id
	B0/0D-06991-192F5705; Wed, 10 Oct 2012 22:11:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1349907088!33813946!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9082 invoked from network); 10 Oct 2012 22:11:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uy-00060k-67
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uy-0000Ph-4p
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:28 +0000
Message-Id: <E1TM4Uy-0000Ph-4p@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:27 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs,
	build: Do not ignore install-docs errors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <ian.jackson@eu.citrix.com>
# Date 1349802000 -3600
# Node ID 3696dd6a7836079c8436719ea03541a8410051a7
# Parent  f92152f52a853ccf5e9ab2cd81a4fc33a61f444a
docs, build: Do not ignore install-docs errors

In the toplevel Makefile "install-docs" (depended on by "install" and
hence "dist"), but not "build", ignores errors.

This was inherited from before 24563:4271634e4c86, prior to which the
||true seems intended to handle failures of check_pkgs.  Nowadays we
handle docs tools individually in the docs makefiles so there is no
need for this ||true here.

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


diff -r f92152f52a85 -r 3696dd6a7836 Makefile
--- a/Makefile	Tue Oct 09 17:59:59 2012 +0100
+++ b/Makefile	Tue Oct 09 18:00:00 2012 +0100
@@ -103,7 +103,7 @@ tools/firmware/seabios-dir-force-update:
 
 .PHONY: install-docs
 install-docs:
-	$(MAKE) -C docs install || true
+	$(MAKE) -C docs install
 
 .PHONY: dev-docs
 dev-docs:

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:33 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22: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 1TM4V2-00089F-Ff; Wed, 10 Oct 2012 22:11:32 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4V0-0007w3-QE
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:31 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-27.messagelabs.com!1349907083!1748950!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24057 invoked from network); 10 Oct 2012 22:11:24 -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;
	10 Oct 2012 22:11:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ut-0005zl-FE
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ut-0000NW-Dl
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:23 +0000
Message-Id: <E1TM4Ut-0000NW-Dl@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxc/arm: allocate xenstore and
	console pages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1349791535 -3600
# Node ID e222ecc2f61fca6a2975ceef851b0330db38227f
# Parent  478830e5d80abc9678dc5287738406e73a8bd087
libxc/arm: allocate xenstore and console pages

Allocate two additional pages at the end of the guest physical memory
for xenstore and console.
Set HVM_PARAM_STORE_PFN and HVM_PARAM_CONSOLE_PFN to the corresponding
values.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc -- pass correct p2m array to populate physmap in
         alloc_magic_pages
]
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 478830e5d80a -r e222ecc2f61f tools/libxc/xc_dom_arm.c
--- a/tools/libxc/xc_dom_arm.c	Tue Oct 09 15:05:34 2012 +0100
+++ b/tools/libxc/xc_dom_arm.c	Tue Oct 09 15:05:35 2012 +0100
@@ -25,6 +25,10 @@
 #include "xg_private.h"
 #include "xc_dom.h"
 
+#define NR_MAGIC_PAGES 2
+#define CONSOLE_PFN_OFFSET 0
+#define XENSTORE_PFN_OFFSET 1
+
 /* ------------------------------------------------------------------------ */
 /*
  * arm guests are hybrid and start off with paging disabled, therefore no
@@ -46,13 +50,30 @@ static int setup_pgtables_arm(struct xc_
 
 static int alloc_magic_pages(struct xc_dom_image *dom)
 {
+    int rc, i;
+    xen_pfn_t store_pfn, console_pfn, p2m[NR_MAGIC_PAGES];
+
     DOMPRINTF_CALLED(dom->xch);
-    /* XXX
-     *   dom->p2m_guest
-     *   dom->start_info_pfn
-     *   dom->xenstore_pfn
-     *   dom->console_pfn
-     */
+
+    for (i = 0; i < NR_MAGIC_PAGES; i++)
+        p2m[i] = dom->rambase_pfn + dom->total_pages + i;
+
+    rc = xc_domain_populate_physmap_exact(
+            dom->xch, dom->guest_domid, NR_MAGIC_PAGES,
+            0, 0, p2m);
+    if ( rc < 0 )
+        return rc;
+
+    console_pfn = dom->rambase_pfn + dom->total_pages + CONSOLE_PFN_OFFSET;
+    store_pfn = dom->rambase_pfn + dom->total_pages + XENSTORE_PFN_OFFSET;
+
+    xc_clear_domain_page(dom->xch, dom->guest_domid, console_pfn);
+    xc_clear_domain_page(dom->xch, dom->guest_domid, store_pfn);
+    xc_set_hvm_param(dom->xch, dom->guest_domid, HVM_PARAM_CONSOLE_PFN,
+            console_pfn);
+    xc_set_hvm_param(dom->xch, dom->guest_domid, HVM_PARAM_STORE_PFN,
+            store_pfn);
+
     return 0;
 }
 

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:33 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22: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 1TM4V2-00089F-Ff; Wed, 10 Oct 2012 22:11:32 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4V0-0007w3-QE
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:31 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-27.messagelabs.com!1349907083!1748950!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24057 invoked from network); 10 Oct 2012 22:11:24 -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;
	10 Oct 2012 22:11:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ut-0005zl-FE
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Ut-0000NW-Dl
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:23 +0000
Message-Id: <E1TM4Ut-0000NW-Dl@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxc/arm: allocate xenstore and
	console pages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1349791535 -3600
# Node ID e222ecc2f61fca6a2975ceef851b0330db38227f
# Parent  478830e5d80abc9678dc5287738406e73a8bd087
libxc/arm: allocate xenstore and console pages

Allocate two additional pages at the end of the guest physical memory
for xenstore and console.
Set HVM_PARAM_STORE_PFN and HVM_PARAM_CONSOLE_PFN to the corresponding
values.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc -- pass correct p2m array to populate physmap in
         alloc_magic_pages
]
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 478830e5d80a -r e222ecc2f61f tools/libxc/xc_dom_arm.c
--- a/tools/libxc/xc_dom_arm.c	Tue Oct 09 15:05:34 2012 +0100
+++ b/tools/libxc/xc_dom_arm.c	Tue Oct 09 15:05:35 2012 +0100
@@ -25,6 +25,10 @@
 #include "xg_private.h"
 #include "xc_dom.h"
 
+#define NR_MAGIC_PAGES 2
+#define CONSOLE_PFN_OFFSET 0
+#define XENSTORE_PFN_OFFSET 1
+
 /* ------------------------------------------------------------------------ */
 /*
  * arm guests are hybrid and start off with paging disabled, therefore no
@@ -46,13 +50,30 @@ static int setup_pgtables_arm(struct xc_
 
 static int alloc_magic_pages(struct xc_dom_image *dom)
 {
+    int rc, i;
+    xen_pfn_t store_pfn, console_pfn, p2m[NR_MAGIC_PAGES];
+
     DOMPRINTF_CALLED(dom->xch);
-    /* XXX
-     *   dom->p2m_guest
-     *   dom->start_info_pfn
-     *   dom->xenstore_pfn
-     *   dom->console_pfn
-     */
+
+    for (i = 0; i < NR_MAGIC_PAGES; i++)
+        p2m[i] = dom->rambase_pfn + dom->total_pages + i;
+
+    rc = xc_domain_populate_physmap_exact(
+            dom->xch, dom->guest_domid, NR_MAGIC_PAGES,
+            0, 0, p2m);
+    if ( rc < 0 )
+        return rc;
+
+    console_pfn = dom->rambase_pfn + dom->total_pages + CONSOLE_PFN_OFFSET;
+    store_pfn = dom->rambase_pfn + dom->total_pages + XENSTORE_PFN_OFFSET;
+
+    xc_clear_domain_page(dom->xch, dom->guest_domid, console_pfn);
+    xc_clear_domain_page(dom->xch, dom->guest_domid, store_pfn);
+    xc_set_hvm_param(dom->xch, dom->guest_domid, HVM_PARAM_CONSOLE_PFN,
+            console_pfn);
+    xc_set_hvm_param(dom->xch, dom->guest_domid, HVM_PARAM_STORE_PFN,
+            store_pfn);
+
     return 0;
 }
 

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:34 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 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 1TM4V4-0008CL-Ga; Wed, 10 Oct 2012 22:11:34 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4V2-0007xp-0a
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:32 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-27.messagelabs.com!1349907084!1748955!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24087 invoked from network); 10 Oct 2012 22:11:25 -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;
	10 Oct 2012 22:11:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uu-0005zv-HD
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uu-0000O0-Fw
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:24 +0000
Message-Id: <E1TM4Uu-0000O0-Fw@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:24 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen/arm: protect LR registers and
	lr_mask changes with spin_lock_irq
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1349791537 -3600
# Node ID 3dc453705b8810a2de95ae03cfda8576169c2ead
# Parent  c5cb51bde9f05ae81f40d81647dc449981214979
xen/arm: protect LR registers and lr_mask changes with spin_lock_irq

GICH_LR registers and lr_mask need to be kept in sync: make sure that
their modifications are protected by spin_lock_irq(&gic.lock).

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r c5cb51bde9f0 -r 3dc453705b88 xen/arch/arm/gic.c
--- a/xen/arch/arm/gic.c	Tue Oct 09 15:05:36 2012 +0100
+++ b/xen/arch/arm/gic.c	Tue Oct 09 15:05:37 2012 +0100
@@ -57,9 +57,11 @@ void gic_save_state(struct vcpu *v)
 {
     int i;
 
+    spin_lock_irq(&gic.lock);
     for ( i=0; i<nr_lrs; i++)
         v->arch.gic_lr[i] = GICH[GICH_LR + i];
     v->arch.lr_mask = gic.lr_mask;
+    spin_unlock_irq(&gic.lock);
     /* Disable until next VCPU scheduled */
     GICH[GICH_HCR] = 0;
     isb();
@@ -72,9 +74,11 @@ void gic_restore_state(struct vcpu *v)
     if ( is_idle_vcpu(v) )
         return;
 
+    spin_lock_irq(&gic.lock);
     gic.lr_mask = v->arch.lr_mask;
     for ( i=0; i<nr_lrs; i++)
         GICH[GICH_LR + i] = v->arch.gic_lr[i];
+    spin_unlock_irq(&gic.lock);
     GICH[GICH_HCR] = GICH_HCR_EN;
     isb();
 
@@ -469,9 +473,11 @@ static void gic_restore_pending_irqs(str
         i = find_first_zero_bit(&gic.lr_mask, nr_lrs);
         if ( i >= nr_lrs ) return;
 
+        spin_lock_irq(&gic.lock);
         gic_set_lr(i, p->irq, GICH_LR_PENDING, p->priority);
         list_del_init(&p->lr_queue);
         set_bit(i, &gic.lr_mask);
+        spin_unlock_irq(&gic.lock);
     }
 
 }

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:34 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 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 1TM4V4-0008CL-Ga; Wed, 10 Oct 2012 22:11:34 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4V2-0007xp-0a
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:32 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-27.messagelabs.com!1349907084!1748955!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24087 invoked from network); 10 Oct 2012 22:11:25 -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;
	10 Oct 2012 22:11:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uu-0005zv-HD
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uu-0000O0-Fw
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:24 +0000
Message-Id: <E1TM4Uu-0000O0-Fw@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:24 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen/arm: protect LR registers and
	lr_mask changes with spin_lock_irq
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1349791537 -3600
# Node ID 3dc453705b8810a2de95ae03cfda8576169c2ead
# Parent  c5cb51bde9f05ae81f40d81647dc449981214979
xen/arm: protect LR registers and lr_mask changes with spin_lock_irq

GICH_LR registers and lr_mask need to be kept in sync: make sure that
their modifications are protected by spin_lock_irq(&gic.lock).

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r c5cb51bde9f0 -r 3dc453705b88 xen/arch/arm/gic.c
--- a/xen/arch/arm/gic.c	Tue Oct 09 15:05:36 2012 +0100
+++ b/xen/arch/arm/gic.c	Tue Oct 09 15:05:37 2012 +0100
@@ -57,9 +57,11 @@ void gic_save_state(struct vcpu *v)
 {
     int i;
 
+    spin_lock_irq(&gic.lock);
     for ( i=0; i<nr_lrs; i++)
         v->arch.gic_lr[i] = GICH[GICH_LR + i];
     v->arch.lr_mask = gic.lr_mask;
+    spin_unlock_irq(&gic.lock);
     /* Disable until next VCPU scheduled */
     GICH[GICH_HCR] = 0;
     isb();
@@ -72,9 +74,11 @@ void gic_restore_state(struct vcpu *v)
     if ( is_idle_vcpu(v) )
         return;
 
+    spin_lock_irq(&gic.lock);
     gic.lr_mask = v->arch.lr_mask;
     for ( i=0; i<nr_lrs; i++)
         GICH[GICH_LR + i] = v->arch.gic_lr[i];
+    spin_unlock_irq(&gic.lock);
     GICH[GICH_HCR] = GICH_HCR_EN;
     isb();
 
@@ -469,9 +473,11 @@ static void gic_restore_pending_irqs(str
         i = find_first_zero_bit(&gic.lr_mask, nr_lrs);
         if ( i >= nr_lrs ) return;
 
+        spin_lock_irq(&gic.lock);
         gic_set_lr(i, p->irq, GICH_LR_PENDING, p->priority);
         list_del_init(&p->lr_queue);
         set_bit(i, &gic.lr_mask);
+        spin_unlock_irq(&gic.lock);
     }
 
 }

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:35 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22: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 1TM4V5-0008F1-Mh; Wed, 10 Oct 2012 22:11:35 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4V3-00080J-Bg
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:33 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-27.messagelabs.com!1349907086!3065348!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9640 invoked from network); 10 Oct 2012 22:11:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uw-00060J-3O
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uw-0000Oj-28
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:26 +0000
Message-Id: <E1TM4Uw-0000Oj-28@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:25 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm/vtimer: convert result to ticks
	when reading CNTPCT register
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1349791539 -3600
# Node ID fcd072eedbb5d927f04f3aabb939bdc9e8ca7ac5
# Parent  1f72d3ae4ccdf5b2c36c7884ee3a4cc4f4754fd9
arm/vtimer: convert result to ticks when reading CNTPCT register

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


diff -r 1f72d3ae4ccd -r fcd072eedbb5 xen/arch/arm/vtimer.c
--- a/xen/arch/arm/vtimer.c	Tue Oct 09 15:05:38 2012 +0100
+++ b/xen/arch/arm/vtimer.c	Tue Oct 09 15:05:39 2012 +0100
@@ -103,6 +103,7 @@ static int vtimer_emulate_64(struct cpu_
     struct hsr_cp64 cp64 = hsr.cp64;
     uint32_t *r1 = &regs->r0 + cp64.reg1;
     uint32_t *r2 = &regs->r0 + cp64.reg2;
+    uint64_t ticks;
     s_time_t now;
 
     switch ( hsr.bits & HSR_CP64_REGS_MASK )
@@ -111,8 +112,9 @@ static int vtimer_emulate_64(struct cpu_
         if ( cp64.read )
         {
             now = NOW() - v->arch.vtimer.offset;
-            *r1 = (uint32_t)(now & 0xffffffff);
-            *r2 = (uint32_t)(now >> 32);
+            ticks = ns_to_ticks(now);
+            *r1 = (uint32_t)(ticks & 0xffffffff);
+            *r2 = (uint32_t)(ticks >> 32);
             return 1;
         }
         else

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

From xen-changelog-bounces@lists.xen.org Wed Oct 10 22:11:35 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Oct 2012 22: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 1TM4V5-0008F1-Mh; Wed, 10 Oct 2012 22:11:35 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4V3-00080J-Bg
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:33 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-27.messagelabs.com!1349907086!3065348!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9640 invoked from network); 10 Oct 2012 22:11:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2012 22:11:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uw-00060J-3O
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TM4Uw-0000Oj-28
	for xen-changelog@lists.xensource.com; Wed, 10 Oct 2012 22:11:26 +0000
Message-Id: <E1TM4Uw-0000Oj-28@xenbits.xen.org>
Date: Wed, 10 Oct 2012 22:11:25 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm/vtimer: convert result to ticks
	when reading CNTPCT register
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1349791539 -3600
# Node ID fcd072eedbb5d927f04f3aabb939bdc9e8ca7ac5
# Parent  1f72d3ae4ccdf5b2c36c7884ee3a4cc4f4754fd9
arm/vtimer: convert result to ticks when reading CNTPCT register

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


diff -r 1f72d3ae4ccd -r fcd072eedbb5 xen/arch/arm/vtimer.c
--- a/xen/arch/arm/vtimer.c	Tue Oct 09 15:05:38 2012 +0100
+++ b/xen/arch/arm/vtimer.c	Tue Oct 09 15:05:39 2012 +0100
@@ -103,6 +103,7 @@ static int vtimer_emulate_64(struct cpu_
     struct hsr_cp64 cp64 = hsr.cp64;
     uint32_t *r1 = &regs->r0 + cp64.reg1;
     uint32_t *r2 = &regs->r0 + cp64.reg2;
+    uint64_t ticks;
     s_time_t now;
 
     switch ( hsr.bits & HSR_CP64_REGS_MASK )
@@ -111,8 +112,9 @@ static int vtimer_emulate_64(struct cpu_
         if ( cp64.read )
         {
             now = NOW() - v->arch.vtimer.offset;
-            *r1 = (uint32_t)(now & 0xffffffff);
-            *r2 = (uint32_t)(now >> 32);
+            ticks = ns_to_ticks(now);
+            *r1 = (uint32_t)(ticks & 0xffffffff);
+            *r2 = (uint32_t)(ticks >> 32);
             return 1;
         }
         else

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

From xen-changelog-bounces@lists.xen.org Thu Oct 11 19:22:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Oct 2012 19: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 1TMOKi-0002x5-Qm; Thu, 11 Oct 2012 19:22:12 +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 1TMOKh-0002wi-O3
	for xen-changelog@lists.xensource.com; Thu, 11 Oct 2012 19:22:11 +0000
Received: from [85.158.139.83:45567] by server-1.bemta-5.messagelabs.com id
	72/8C-18294-26C17705; Thu, 11 Oct 2012 19:22:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-182.messagelabs.com!1349983329!34463543!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8702 invoked from network); 11 Oct 2012 19:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2012 19:22:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMOKf-0004q3-6z
	for xen-changelog@lists.xensource.com; Thu, 11 Oct 2012 19:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMOKf-0008F5-1X
	for xen-changelog@lists.xensource.com; Thu, 11 Oct 2012 19:22:09 +0000
Message-Id: <E1TMOKf-0008F5-1X@xenbits.xen.org>
Date: Thu, 11 Oct 2012 19:22:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] init scripts: xendomains correct
	order of options for shutdown command
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Sander Eikelenboom <linux@eikelenboom.it>
# Date 1349947276 -3600
# Node ID 4845b5ce90e85b43701a45d0f43be9de3ca1237a
# Parent  d1c3b589af50cd3d2afb9c84d154f9a7659afb9c
init scripts: xendomains correct order of options for shutdown command

Options for the shutdown command that are supplied behind the domain id are
ignored. In case of the default xendomains init script this means that it will
not wait for the domains to be actually shutdown.

Signed-off-by: Sander Eikelenboom <linux@eikelenboom.it>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r d1c3b589af50 -r 4845b5ce90e8 tools/hotplug/Linux/init.d/xendomains
--- a/tools/hotplug/Linux/init.d/xendomains	Thu Oct 11 10:21:15 2012 +0100
+++ b/tools/hotplug/Linux/init.d/xendomains	Thu Oct 11 10:21:16 2012 +0100
@@ -438,7 +438,7 @@ stop()
 	    echo -n "(shut)"
 	    watchdog_xencmd shutdown &
 	    WDOG_PID=$!
-	    XMR=`$CMD shutdown $id $XENDOMAINS_SHUTDOWN 2>&1 1>/dev/null`
+	    XMR=`$CMD shutdown $XENDOMAINS_SHUTDOWN $id 2>&1 1>/dev/null`
 	    if test $? -ne 0; then
 		echo -e "\nAn error occurred while shutting down domain:\n$XMR\n"
 		rc_failed $?

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

From xen-changelog-bounces@lists.xen.org Thu Oct 11 19:22:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Oct 2012 19: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 1TMOKi-0002x5-Qm; Thu, 11 Oct 2012 19:22:12 +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 1TMOKh-0002wi-O3
	for xen-changelog@lists.xensource.com; Thu, 11 Oct 2012 19:22:11 +0000
Received: from [85.158.139.83:45567] by server-1.bemta-5.messagelabs.com id
	72/8C-18294-26C17705; Thu, 11 Oct 2012 19:22:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-182.messagelabs.com!1349983329!34463543!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8702 invoked from network); 11 Oct 2012 19:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2012 19:22:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMOKf-0004q3-6z
	for xen-changelog@lists.xensource.com; Thu, 11 Oct 2012 19:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMOKf-0008F5-1X
	for xen-changelog@lists.xensource.com; Thu, 11 Oct 2012 19:22:09 +0000
Message-Id: <E1TMOKf-0008F5-1X@xenbits.xen.org>
Date: Thu, 11 Oct 2012 19:22:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] init scripts: xendomains correct
	order of options for shutdown command
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Sander Eikelenboom <linux@eikelenboom.it>
# Date 1349947276 -3600
# Node ID 4845b5ce90e85b43701a45d0f43be9de3ca1237a
# Parent  d1c3b589af50cd3d2afb9c84d154f9a7659afb9c
init scripts: xendomains correct order of options for shutdown command

Options for the shutdown command that are supplied behind the domain id are
ignored. In case of the default xendomains init script this means that it will
not wait for the domains to be actually shutdown.

Signed-off-by: Sander Eikelenboom <linux@eikelenboom.it>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r d1c3b589af50 -r 4845b5ce90e8 tools/hotplug/Linux/init.d/xendomains
--- a/tools/hotplug/Linux/init.d/xendomains	Thu Oct 11 10:21:15 2012 +0100
+++ b/tools/hotplug/Linux/init.d/xendomains	Thu Oct 11 10:21:16 2012 +0100
@@ -438,7 +438,7 @@ stop()
 	    echo -n "(shut)"
 	    watchdog_xencmd shutdown &
 	    WDOG_PID=$!
-	    XMR=`$CMD shutdown $id $XENDOMAINS_SHUTDOWN 2>&1 1>/dev/null`
+	    XMR=`$CMD shutdown $XENDOMAINS_SHUTDOWN $id 2>&1 1>/dev/null`
 	    if test $? -ne 0; then
 		echo -e "\nAn error occurred while shutting down domain:\n$XMR\n"
 		rc_failed $?

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

From xen-changelog-bounces@lists.xen.org Thu Oct 11 19:22:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Oct 2012 19: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 1TMOKi-0002x0-OL; Thu, 11 Oct 2012 19:22:12 +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 1TMOKh-0002wh-MQ
	for xen-changelog@lists.xensource.com; Thu, 11 Oct 2012 19:22:11 +0000
Received: from [85.158.139.83:45562] by server-12.bemta-5.messagelabs.com id
	C4/A7-19095-26C17705; Thu, 11 Oct 2012 19:22:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1349983329!33813828!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 795 invoked from network); 11 Oct 2012 19:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2012 19:22:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMOKf-0004q0-0h
	for xen-changelog@lists.xensource.com; Thu, 11 Oct 2012 19:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMOKe-0008Eq-Fj
	for xen-changelog@lists.xensource.com; Thu, 11 Oct 2012 19:22:08 +0000
Message-Id: <E1TMOKe-0008Eq-Fj@xenbits.xen.org>
Date: Thu, 11 Oct 2012 19:22:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] stubdom: fix error assignment in
	grub:load_module
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1349947275 -3600
# Node ID d1c3b589af50cd3d2afb9c84d154f9a7659afb9c
# Parent  3696dd6a7836079c8436719ea03541a8410051a7
stubdom: fix error assignment in grub:load_module

[ 1333s] mini-os.c: In function 'load_module':
[ 1333s] mini-os.c:244: warning: statement with no effect

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 3696dd6a7836 -r d1c3b589af50 stubdom/grub/mini-os.c
--- a/stubdom/grub/mini-os.c	Tue Oct 09 18:00:00 2012 +0100
+++ b/stubdom/grub/mini-os.c	Thu Oct 11 10:21:15 2012 +0100
@@ -241,7 +241,7 @@ load_module (char *module, char *arg)
 
     if ((void*) (multiboot_next_module_header+1) - module_image > PAGE_SIZE) {
         /* Too many modules */
-        ERR_WONT_FIT;
+        errnum = ERR_WONT_FIT;
         return 0;
     }
 

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

From xen-changelog-bounces@lists.xen.org Thu Oct 11 19:22:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Oct 2012 19: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 1TMOKi-0002x0-OL; Thu, 11 Oct 2012 19:22:12 +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 1TMOKh-0002wh-MQ
	for xen-changelog@lists.xensource.com; Thu, 11 Oct 2012 19:22:11 +0000
Received: from [85.158.139.83:45562] by server-12.bemta-5.messagelabs.com id
	C4/A7-19095-26C17705; Thu, 11 Oct 2012 19:22:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1349983329!33813828!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 795 invoked from network); 11 Oct 2012 19:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2012 19:22:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMOKf-0004q0-0h
	for xen-changelog@lists.xensource.com; Thu, 11 Oct 2012 19:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMOKe-0008Eq-Fj
	for xen-changelog@lists.xensource.com; Thu, 11 Oct 2012 19:22:08 +0000
Message-Id: <E1TMOKe-0008Eq-Fj@xenbits.xen.org>
Date: Thu, 11 Oct 2012 19:22:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] stubdom: fix error assignment in
	grub:load_module
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1349947275 -3600
# Node ID d1c3b589af50cd3d2afb9c84d154f9a7659afb9c
# Parent  3696dd6a7836079c8436719ea03541a8410051a7
stubdom: fix error assignment in grub:load_module

[ 1333s] mini-os.c: In function 'load_module':
[ 1333s] mini-os.c:244: warning: statement with no effect

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 3696dd6a7836 -r d1c3b589af50 stubdom/grub/mini-os.c
--- a/stubdom/grub/mini-os.c	Tue Oct 09 18:00:00 2012 +0100
+++ b/stubdom/grub/mini-os.c	Thu Oct 11 10:21:15 2012 +0100
@@ -241,7 +241,7 @@ load_module (char *module, char *arg)
 
     if ((void*) (multiboot_next_module_header+1) - module_image > PAGE_SIZE) {
         /* Too many modules */
-        ERR_WONT_FIT;
+        errnum = ERR_WONT_FIT;
         return 0;
     }
 

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

From xen-changelog-bounces@lists.xen.org Thu Oct 11 19:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Oct 2012 19:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TMOKj-0002xK-Vl; Thu, 11 Oct 2012 19:22:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMOKi-0002wm-Km
	for xen-changelog@lists.xensource.com; Thu, 11 Oct 2012 19:22:12 +0000
Received: from [85.158.143.99:48891] by server-1.bemta-4.messagelabs.com id
	8D/23-19551-46C17705; Thu, 11 Oct 2012 19:22:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1349983330!33447674!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19839 invoked from network); 11 Oct 2012 19:22:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2012 19:22:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMOKg-0004q9-9i
	for xen-changelog@lists.xensource.com; Thu, 11 Oct 2012 19:22:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMOKg-0008Fa-49
	for xen-changelog@lists.xensource.com; Thu, 11 Oct 2012 19:22:10 +0000
Message-Id: <E1TMOKg-0008Fa-49@xenbits.xen.org>
Date: Thu, 11 Oct 2012 19:22:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] init/sysconfig scripts: Remove
	--halt/-H option for shutdown command.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Sander Eikelenboom <linux@eikelenboom.it>
# Date 1349952730 -3600
# Node ID b91f57f54f478dd9849e55f3de3fc3bab7f33b46
# Parent  ba7198bfc6794ffaedefec8f7ee5b0e9638c39a8
init/sysconfig scripts: Remove --halt/-H option for shutdown command.

The --halt/-H option for the shutdown command is now pointless,
since linux in a guest treats "halt" and "poweroff" identically.
The option is not implemented in xl / libxl and if supplied causes the command
to fail , so remove it from the init and sysconfig scripts.

Signed-off-by: Sander Eikelenboom <linux@eikelenboom.it>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r ba7198bfc679 -r b91f57f54f47 tools/hotplug/Linux/init.d/sysconfig.xendomains
--- a/tools/hotplug/Linux/init.d/sysconfig.xendomains	Thu Oct 11 11:52:09 2012 +0100
+++ b/tools/hotplug/Linux/init.d/sysconfig.xendomains	Thu Oct 11 11:52:10 2012 +0100
@@ -56,29 +56,29 @@ XENDOMAINS_MIGRATE=""
 XENDOMAINS_SAVE=/var/lib/xen/save
 
 ## Type: string
-## Default: "--halt --wait"
+## Default: "--wait"
 #
 # If neither MIGRATE nor SAVE were enabled or if they failed, you can
 # try to shut down a domain by sending it a shutdown request. To do this,
-# set this to "--halt --wait". Omit the "--wait" flag to avoid waiting
+# set this to "--wait". Omit the "--wait" flag to avoid waiting
 # for the domain to be really down. Leave empty to skip domain shutdown.
 #
-XENDOMAINS_SHUTDOWN="--halt --wait"
+XENDOMAINS_SHUTDOWN="--wait"
 
 ## Type: string
-## Default: "--all --halt --wait"
+## Default: "--all --wait"
 #
 # After we have gone over all virtual machines (resp. all automatically
 # started ones, see XENDOMAINS_AUTO_ONLY below) in a loop and sent SysRq,
 # migrated, saved and/or shutdown according to the settings above, we
 # might want to shutdown the virtual machines that are still running
 # for some reason or another. To do this, set this variable to
-# "--all --halt --wait", it will be passed to xm shutdown.
+# "--all --wait", it will be passed to xm shutdown.
 # Leave it empty not to do anything special here.
 # (Note: This will hit all virtual machines, even if XENDOMAINS_AUTO_ONLY
 # is set.)
 # 
-XENDOMAINS_SHUTDOWN_ALL="--all --halt --wait"
+XENDOMAINS_SHUTDOWN_ALL="--all --wait"
 
 ## Type: boolean
 ## Default: true
diff -r ba7198bfc679 -r b91f57f54f47 tools/hotplug/Linux/init.d/xendomains
--- a/tools/hotplug/Linux/init.d/xendomains	Thu Oct 11 11:52:09 2012 +0100
+++ b/tools/hotplug/Linux/init.d/xendomains	Thu Oct 11 11:52:10 2012 +0100
@@ -434,7 +434,7 @@ stop()
 	    fi
 	fi
 	if test -n "$XENDOMAINS_SHUTDOWN"; then
-	    # XENDOMAINS_SHUTDOWN should be "--halt --wait"
+	    # XENDOMAINS_SHUTDOWN should be "--wait"
 	    echo -n "(shut)"
 	    watchdog_xencmd shutdown &
 	    WDOG_PID=$!
@@ -453,7 +453,7 @@ stop()
     # This is because it's easier to do ;-) but arguably if this script is run
     # on system shutdown then it's also the right thing to do.
     if ! all_zombies && test -n "$XENDOMAINS_SHUTDOWN_ALL"; then
-	# XENDOMAINS_SHUTDOWN_ALL should be "--all --halt --wait"
+	# XENDOMAINS_SHUTDOWN_ALL should be "--all --wait"
 	echo -n " SHUTDOWN_ALL "
 	watchdog_xencmd shutdown 1 false &
 	WDOG_PID=$!
diff -r ba7198bfc679 -r b91f57f54f47 tools/hotplug/NetBSD/rc.d/xendomains
--- a/tools/hotplug/NetBSD/rc.d/xendomains	Thu Oct 11 11:52:09 2012 +0100
+++ b/tools/hotplug/NetBSD/rc.d/xendomains	Thu Oct 11 11:52:10 2012 +0100
@@ -94,7 +94,7 @@ xendomains_stop()
 	#
 	echo "Stopping xen domains."
 	for domain in $(xendomains_list); do
-		${ctl_command} shutdown --halt $domain
+		${ctl_command} shutdown $domain
 	done
 	while [ $timeout -gt 0 ]; do
 		livedomains=$(xendomains_list)

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

From xen-changelog-bounces@lists.xen.org Thu Oct 11 19:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Oct 2012 19:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TMOKj-0002xK-Vl; Thu, 11 Oct 2012 19:22:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMOKi-0002wm-Km
	for xen-changelog@lists.xensource.com; Thu, 11 Oct 2012 19:22:12 +0000
Received: from [85.158.143.99:48891] by server-1.bemta-4.messagelabs.com id
	8D/23-19551-46C17705; Thu, 11 Oct 2012 19:22:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1349983330!33447674!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19839 invoked from network); 11 Oct 2012 19:22:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2012 19:22:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMOKg-0004q9-9i
	for xen-changelog@lists.xensource.com; Thu, 11 Oct 2012 19:22:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMOKg-0008Fa-49
	for xen-changelog@lists.xensource.com; Thu, 11 Oct 2012 19:22:10 +0000
Message-Id: <E1TMOKg-0008Fa-49@xenbits.xen.org>
Date: Thu, 11 Oct 2012 19:22:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] init/sysconfig scripts: Remove
	--halt/-H option for shutdown command.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Sander Eikelenboom <linux@eikelenboom.it>
# Date 1349952730 -3600
# Node ID b91f57f54f478dd9849e55f3de3fc3bab7f33b46
# Parent  ba7198bfc6794ffaedefec8f7ee5b0e9638c39a8
init/sysconfig scripts: Remove --halt/-H option for shutdown command.

The --halt/-H option for the shutdown command is now pointless,
since linux in a guest treats "halt" and "poweroff" identically.
The option is not implemented in xl / libxl and if supplied causes the command
to fail , so remove it from the init and sysconfig scripts.

Signed-off-by: Sander Eikelenboom <linux@eikelenboom.it>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r ba7198bfc679 -r b91f57f54f47 tools/hotplug/Linux/init.d/sysconfig.xendomains
--- a/tools/hotplug/Linux/init.d/sysconfig.xendomains	Thu Oct 11 11:52:09 2012 +0100
+++ b/tools/hotplug/Linux/init.d/sysconfig.xendomains	Thu Oct 11 11:52:10 2012 +0100
@@ -56,29 +56,29 @@ XENDOMAINS_MIGRATE=""
 XENDOMAINS_SAVE=/var/lib/xen/save
 
 ## Type: string
-## Default: "--halt --wait"
+## Default: "--wait"
 #
 # If neither MIGRATE nor SAVE were enabled or if they failed, you can
 # try to shut down a domain by sending it a shutdown request. To do this,
-# set this to "--halt --wait". Omit the "--wait" flag to avoid waiting
+# set this to "--wait". Omit the "--wait" flag to avoid waiting
 # for the domain to be really down. Leave empty to skip domain shutdown.
 #
-XENDOMAINS_SHUTDOWN="--halt --wait"
+XENDOMAINS_SHUTDOWN="--wait"
 
 ## Type: string
-## Default: "--all --halt --wait"
+## Default: "--all --wait"
 #
 # After we have gone over all virtual machines (resp. all automatically
 # started ones, see XENDOMAINS_AUTO_ONLY below) in a loop and sent SysRq,
 # migrated, saved and/or shutdown according to the settings above, we
 # might want to shutdown the virtual machines that are still running
 # for some reason or another. To do this, set this variable to
-# "--all --halt --wait", it will be passed to xm shutdown.
+# "--all --wait", it will be passed to xm shutdown.
 # Leave it empty not to do anything special here.
 # (Note: This will hit all virtual machines, even if XENDOMAINS_AUTO_ONLY
 # is set.)
 # 
-XENDOMAINS_SHUTDOWN_ALL="--all --halt --wait"
+XENDOMAINS_SHUTDOWN_ALL="--all --wait"
 
 ## Type: boolean
 ## Default: true
diff -r ba7198bfc679 -r b91f57f54f47 tools/hotplug/Linux/init.d/xendomains
--- a/tools/hotplug/Linux/init.d/xendomains	Thu Oct 11 11:52:09 2012 +0100
+++ b/tools/hotplug/Linux/init.d/xendomains	Thu Oct 11 11:52:10 2012 +0100
@@ -434,7 +434,7 @@ stop()
 	    fi
 	fi
 	if test -n "$XENDOMAINS_SHUTDOWN"; then
-	    # XENDOMAINS_SHUTDOWN should be "--halt --wait"
+	    # XENDOMAINS_SHUTDOWN should be "--wait"
 	    echo -n "(shut)"
 	    watchdog_xencmd shutdown &
 	    WDOG_PID=$!
@@ -453,7 +453,7 @@ stop()
     # This is because it's easier to do ;-) but arguably if this script is run
     # on system shutdown then it's also the right thing to do.
     if ! all_zombies && test -n "$XENDOMAINS_SHUTDOWN_ALL"; then
-	# XENDOMAINS_SHUTDOWN_ALL should be "--all --halt --wait"
+	# XENDOMAINS_SHUTDOWN_ALL should be "--all --wait"
 	echo -n " SHUTDOWN_ALL "
 	watchdog_xencmd shutdown 1 false &
 	WDOG_PID=$!
diff -r ba7198bfc679 -r b91f57f54f47 tools/hotplug/NetBSD/rc.d/xendomains
--- a/tools/hotplug/NetBSD/rc.d/xendomains	Thu Oct 11 11:52:09 2012 +0100
+++ b/tools/hotplug/NetBSD/rc.d/xendomains	Thu Oct 11 11:52:10 2012 +0100
@@ -94,7 +94,7 @@ xendomains_stop()
 	#
 	echo "Stopping xen domains."
 	for domain in $(xendomains_list); do
-		${ctl_command} shutdown --halt $domain
+		${ctl_command} shutdown $domain
 	done
 	while [ $timeout -gt 0 ]; do
 		livedomains=$(xendomains_list)

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

From xen-changelog-bounces@lists.xen.org Thu Oct 11 19:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Oct 2012 19:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TMOKi-0002xE-TD; Thu, 11 Oct 2012 19:22:12 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMOKi-0002wm-3o
	for xen-changelog@lists.xensource.com; Thu, 11 Oct 2012 19:22:12 +0000
Received: from [85.158.143.35:29664] by server-1.bemta-4.messagelabs.com id
	0B/23-19551-36C17705; Thu, 11 Oct 2012 19:22:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-21.messagelabs.com!1349983329!18420345!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25948 invoked from network); 11 Oct 2012 19:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2012 19:22:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMOKf-0004q6-Ky
	for xen-changelog@lists.xensource.com; Thu, 11 Oct 2012 19:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMOKf-0008FK-JK
	for xen-changelog@lists.xensource.com; Thu, 11 Oct 2012 19:22:09 +0000
Message-Id: <E1TMOKf-0008FK-JK@xenbits.xen.org>
Date: Thu, 11 Oct 2012 19:22:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl/libxl: make shutdown accept the
	long option --wait for -w
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Sander Eikelenboom <linux@eikelenboom.it>
# Date 1349952729 -3600
# Node ID ba7198bfc6794ffaedefec8f7ee5b0e9638c39a8
# Parent  4845b5ce90e85b43701a45d0f43be9de3ca1237a
xl/libxl: make shutdown accept the long option --wait for -w

Make xl/libxl accept the long option --wait for -w to be compatible with xm.
The long options are used in the default init and sysconfig scripts.

Signed-off-by: Sander Eikelenboom <linux@eikelenboom.it>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 4845b5ce90e8 -r ba7198bfc679 docs/man/xl.pod.1
--- a/docs/man/xl.pod.1	Thu Oct 11 10:21:16 2012 +0100
+++ b/docs/man/xl.pod.1	Thu Oct 11 11:52:09 2012 +0100
@@ -550,7 +550,7 @@ B<OPTIONS>
 
 =over 4
 
-=item B<-w>
+=item B<-w>, B<--wait>
 
 Wait for the domain to complete shutdown before returning.
 
diff -r 4845b5ce90e8 -r ba7198bfc679 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Oct 11 10:21:16 2012 +0100
+++ b/tools/libxl/xl_cmdimpl.c	Thu Oct 11 11:52:09 2012 +0100
@@ -3709,8 +3709,12 @@ int main_shutdown(int argc, char **argv)
     int opt;
     int wait_for_it = 0;
     int fallback_trigger = 0;
-
-    while ((opt = def_getopt(argc, argv, "wF", "shutdown", 1)) != -1) {
+    static struct option long_options[] = {
+        {"wait", 0, 0, 'w'},
+        {0, 0, 0, 0}
+    };
+
+    while ((opt = getopt_long(argc, argv, "wF", long_options, NULL)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
diff -r 4845b5ce90e8 -r ba7198bfc679 tools/libxl/xl_cmdtable.c
--- a/tools/libxl/xl_cmdtable.c	Thu Oct 11 10:21:16 2012 +0100
+++ b/tools/libxl/xl_cmdtable.c	Thu Oct 11 11:52:09 2012 +0100
@@ -64,7 +64,7 @@ struct cmd_spec cmd_table[] = {
       "-h                      Print this help.\n"
       "-F                      Fallback to ACPI power event for HVM guests with\n"
       "                        no PV drivers.\n"
-      "-w                      Wait for guest to shutdown.\n"
+      "-w, --wait              Wait for guest to shutdown.\n"
     },
     { "reboot",
       &main_reboot, 0, 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 11 19:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Oct 2012 19:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TMOKi-0002xE-TD; Thu, 11 Oct 2012 19:22:12 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMOKi-0002wm-3o
	for xen-changelog@lists.xensource.com; Thu, 11 Oct 2012 19:22:12 +0000
Received: from [85.158.143.35:29664] by server-1.bemta-4.messagelabs.com id
	0B/23-19551-36C17705; Thu, 11 Oct 2012 19:22:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-21.messagelabs.com!1349983329!18420345!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25948 invoked from network); 11 Oct 2012 19:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2012 19:22:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMOKf-0004q6-Ky
	for xen-changelog@lists.xensource.com; Thu, 11 Oct 2012 19:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMOKf-0008FK-JK
	for xen-changelog@lists.xensource.com; Thu, 11 Oct 2012 19:22:09 +0000
Message-Id: <E1TMOKf-0008FK-JK@xenbits.xen.org>
Date: Thu, 11 Oct 2012 19:22:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl/libxl: make shutdown accept the
	long option --wait for -w
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Sander Eikelenboom <linux@eikelenboom.it>
# Date 1349952729 -3600
# Node ID ba7198bfc6794ffaedefec8f7ee5b0e9638c39a8
# Parent  4845b5ce90e85b43701a45d0f43be9de3ca1237a
xl/libxl: make shutdown accept the long option --wait for -w

Make xl/libxl accept the long option --wait for -w to be compatible with xm.
The long options are used in the default init and sysconfig scripts.

Signed-off-by: Sander Eikelenboom <linux@eikelenboom.it>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 4845b5ce90e8 -r ba7198bfc679 docs/man/xl.pod.1
--- a/docs/man/xl.pod.1	Thu Oct 11 10:21:16 2012 +0100
+++ b/docs/man/xl.pod.1	Thu Oct 11 11:52:09 2012 +0100
@@ -550,7 +550,7 @@ B<OPTIONS>
 
 =over 4
 
-=item B<-w>
+=item B<-w>, B<--wait>
 
 Wait for the domain to complete shutdown before returning.
 
diff -r 4845b5ce90e8 -r ba7198bfc679 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Oct 11 10:21:16 2012 +0100
+++ b/tools/libxl/xl_cmdimpl.c	Thu Oct 11 11:52:09 2012 +0100
@@ -3709,8 +3709,12 @@ int main_shutdown(int argc, char **argv)
     int opt;
     int wait_for_it = 0;
     int fallback_trigger = 0;
-
-    while ((opt = def_getopt(argc, argv, "wF", "shutdown", 1)) != -1) {
+    static struct option long_options[] = {
+        {"wait", 0, 0, 'w'},
+        {0, 0, 0, 0}
+    };
+
+    while ((opt = getopt_long(argc, argv, "wF", long_options, NULL)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
diff -r 4845b5ce90e8 -r ba7198bfc679 tools/libxl/xl_cmdtable.c
--- a/tools/libxl/xl_cmdtable.c	Thu Oct 11 10:21:16 2012 +0100
+++ b/tools/libxl/xl_cmdtable.c	Thu Oct 11 11:52:09 2012 +0100
@@ -64,7 +64,7 @@ struct cmd_spec cmd_table[] = {
       "-h                      Print this help.\n"
       "-F                      Fallback to ACPI power event for HVM guests with\n"
       "                        no PV drivers.\n"
-      "-w                      Wait for guest to shutdown.\n"
+      "-w, --wait              Wait for guest to shutdown.\n"
     },
     { "reboot",
       &main_reboot, 0, 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 12 00:11:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Oct 2012 00: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 1TMSqO-0006ES-4a; Fri, 12 Oct 2012 00:11:12 +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 1TMSqM-0006E7-Jw
	for xen-changelog@lists.xensource.com; Fri, 12 Oct 2012 00:11:10 +0000
Received: from [85.158.139.211:16015] by server-2.bemta-5.messagelabs.com id
	EF/02-02746-D1067705; Fri, 12 Oct 2012 00:11:09 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-206.messagelabs.com!1350000668!22054499!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14195 invoked from network); 12 Oct 2012 00:11:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Oct 2012 00:11:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMSqK-0008TN-3x
	for xen-changelog@lists.xensource.com; Fri, 12 Oct 2012 00:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMSqJ-0007Xu-LB
	for xen-changelog@lists.xensource.com; Fri, 12 Oct 2012 00:11:07 +0000
Message-Id: <E1TMSqJ-0007Xu-LB@xenbits.xen.org>
Date: Fri, 12 Oct 2012 00:11:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: Zero the BSS at start of day.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1349967416 -3600
# Node ID 5840770f81ba00775f714b210eb589cd9331012c
# Parent  b91f57f54f478dd9849e55f3de3fc3bab7f33b46
arm: Zero the BSS at start of day.

Avoids surprises e.g. when loading via the boot-wrapper.

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


diff -r b91f57f54f47 -r 5840770f81ba xen/arch/arm/head.S
--- a/xen/arch/arm/head.S	Thu Oct 11 11:52:10 2012 +0100
+++ b/xen/arch/arm/head.S	Thu Oct 11 15:56:56 2012 +0100
@@ -127,8 +127,26 @@ 1:
 	add   pc, r0, r10            /* Call PA of function */
 
 hyp:
+
+	/* Zero BSS On the boot CPU to avoid nasty surprises */
+	teq   r12, #0
+	bne   skip_bss
+
+	PRINT("- Zero BSS -\r\n")
+	ldr   r0, =__bss_start       /* Load start & end of bss */
+	ldr   r1, =__bss_end
+	add   r0, r0, r10            /* Apply physical offset */
+	add   r1, r1, r10
+	
+	mov   r2, #0
+1:	str   r2, [r0], #4
+	cmp   r0, r1
+	blo   1b
+
+skip_bss:	
+
 	PRINT("- Setting up control registers -\r\n")
-
+	
 	/* Set up memory attribute type tables */
 	ldr   r0, =MAIR0VAL
 	ldr   r1, =MAIR1VAL
diff -r b91f57f54f47 -r 5840770f81ba xen/arch/arm/xen.lds.S
--- a/xen/arch/arm/xen.lds.S	Thu Oct 11 11:52:10 2012 +0100
+++ b/xen/arch/arm/xen.lds.S	Thu Oct 11 15:56:56 2012 +0100
@@ -119,6 +119,7 @@ SECTIONS
        *(.bss.percpu.read_mostly)
        . = ALIGN(SMP_CACHE_BYTES);
        __per_cpu_data_end = .;
+       __bss_end = .;
   } :text
   _end = . ;
 

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

From xen-changelog-bounces@lists.xen.org Fri Oct 12 00:11:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Oct 2012 00: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 1TMSqO-0006ES-4a; Fri, 12 Oct 2012 00:11:12 +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 1TMSqM-0006E7-Jw
	for xen-changelog@lists.xensource.com; Fri, 12 Oct 2012 00:11:10 +0000
Received: from [85.158.139.211:16015] by server-2.bemta-5.messagelabs.com id
	EF/02-02746-D1067705; Fri, 12 Oct 2012 00:11:09 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-206.messagelabs.com!1350000668!22054499!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14195 invoked from network); 12 Oct 2012 00:11:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Oct 2012 00:11:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMSqK-0008TN-3x
	for xen-changelog@lists.xensource.com; Fri, 12 Oct 2012 00:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMSqJ-0007Xu-LB
	for xen-changelog@lists.xensource.com; Fri, 12 Oct 2012 00:11:07 +0000
Message-Id: <E1TMSqJ-0007Xu-LB@xenbits.xen.org>
Date: Fri, 12 Oct 2012 00:11:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: Zero the BSS at start of day.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1349967416 -3600
# Node ID 5840770f81ba00775f714b210eb589cd9331012c
# Parent  b91f57f54f478dd9849e55f3de3fc3bab7f33b46
arm: Zero the BSS at start of day.

Avoids surprises e.g. when loading via the boot-wrapper.

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


diff -r b91f57f54f47 -r 5840770f81ba xen/arch/arm/head.S
--- a/xen/arch/arm/head.S	Thu Oct 11 11:52:10 2012 +0100
+++ b/xen/arch/arm/head.S	Thu Oct 11 15:56:56 2012 +0100
@@ -127,8 +127,26 @@ 1:
 	add   pc, r0, r10            /* Call PA of function */
 
 hyp:
+
+	/* Zero BSS On the boot CPU to avoid nasty surprises */
+	teq   r12, #0
+	bne   skip_bss
+
+	PRINT("- Zero BSS -\r\n")
+	ldr   r0, =__bss_start       /* Load start & end of bss */
+	ldr   r1, =__bss_end
+	add   r0, r0, r10            /* Apply physical offset */
+	add   r1, r1, r10
+	
+	mov   r2, #0
+1:	str   r2, [r0], #4
+	cmp   r0, r1
+	blo   1b
+
+skip_bss:	
+
 	PRINT("- Setting up control registers -\r\n")
-
+	
 	/* Set up memory attribute type tables */
 	ldr   r0, =MAIR0VAL
 	ldr   r1, =MAIR1VAL
diff -r b91f57f54f47 -r 5840770f81ba xen/arch/arm/xen.lds.S
--- a/xen/arch/arm/xen.lds.S	Thu Oct 11 11:52:10 2012 +0100
+++ b/xen/arch/arm/xen.lds.S	Thu Oct 11 15:56:56 2012 +0100
@@ -119,6 +119,7 @@ SECTIONS
        *(.bss.percpu.read_mostly)
        . = ALIGN(SMP_CACHE_BYTES);
        __per_cpu_data_end = .;
+       __bss_end = .;
   } :text
   _end = . ;
 

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

From xen-changelog-bounces@lists.xen.org Fri Oct 12 00:11:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Oct 2012 00: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 1TMSqO-0006EX-74; Fri, 12 Oct 2012 00:11:12 +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 1TMSqM-0006E9-UC
	for xen-changelog@lists.xensource.com; Fri, 12 Oct 2012 00:11:11 +0000
Received: from [85.158.139.211:6943] by server-10.bemta-5.messagelabs.com id
	85/02-06995-E1067705; Fri, 12 Oct 2012 00:11:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-206.messagelabs.com!1350000668!21545167!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29177 invoked from network); 12 Oct 2012 00:11:09 -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;
	12 Oct 2012 00:11:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMSqK-0008TQ-B6
	for xen-changelog@lists.xensource.com; Fri, 12 Oct 2012 00:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMSqK-0007Y9-6N
	for xen-changelog@lists.xensource.com; Fri, 12 Oct 2012 00:11:08 +0000
Message-Id: <E1TMSqK-0007Y9-6N@xenbits.xen.org>
Date: Fri, 12 Oct 2012 00:11:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: make virtual address defines
	unsigned
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1349967417 -3600
# Node ID e78fff21c038aa1bd8a0db3b337299d81e872c0e
# Parent  5840770f81ba00775f714b210eb589cd9331012c
arm: make virtual address defines unsigned

avoids confusion due to overflow etc.

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


diff -r 5840770f81ba -r e78fff21c038 xen/include/asm-arm/config.h
--- a/xen/include/asm-arm/config.h	Thu Oct 11 15:56:56 2012 +0100
+++ b/xen/include/asm-arm/config.h	Thu Oct 11 15:56:57 2012 +0100
@@ -69,14 +69,14 @@
  *   - in setup_pagetables() when relocating Xen.
  */
 
-#define XEN_VIRT_START         0x00200000
-#define FIXMAP_ADDR(n)        (0x00400000 + (n) * PAGE_SIZE)
-#define BOOT_MISC_VIRT_START   0x00600000
-#define FRAMETABLE_VIRT_START  0x02000000
-#define XENHEAP_VIRT_START     0x40000000
-#define DOMHEAP_VIRT_START     0x80000000
+#define XEN_VIRT_START         mk_unsigned_long(0x00200000)
+#define FIXMAP_ADDR(n)        (mk_unsigned_long(0x00400000) + (n) * PAGE_SIZE)
+#define BOOT_MISC_VIRT_START   mk_unsigned_long(0x00600000)
+#define FRAMETABLE_VIRT_START  mk_unsigned_long(0x02000000)
+#define XENHEAP_VIRT_START     mk_unsigned_long(0x40000000)
+#define DOMHEAP_VIRT_START     mk_unsigned_long(0x80000000)
 
-#define HYPERVISOR_VIRT_START mk_unsigned_long(XEN_VIRT_START)
+#define HYPERVISOR_VIRT_START  XEN_VIRT_START
 
 #define DOMHEAP_ENTRIES        1024  /* 1024 2MB mapping slots */
 

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

From xen-changelog-bounces@lists.xen.org Fri Oct 12 00:11:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Oct 2012 00: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 1TMSqO-0006EX-74; Fri, 12 Oct 2012 00:11:12 +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 1TMSqM-0006E9-UC
	for xen-changelog@lists.xensource.com; Fri, 12 Oct 2012 00:11:11 +0000
Received: from [85.158.139.211:6943] by server-10.bemta-5.messagelabs.com id
	85/02-06995-E1067705; Fri, 12 Oct 2012 00:11:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-206.messagelabs.com!1350000668!21545167!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29177 invoked from network); 12 Oct 2012 00:11:09 -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;
	12 Oct 2012 00:11:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMSqK-0008TQ-B6
	for xen-changelog@lists.xensource.com; Fri, 12 Oct 2012 00:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMSqK-0007Y9-6N
	for xen-changelog@lists.xensource.com; Fri, 12 Oct 2012 00:11:08 +0000
Message-Id: <E1TMSqK-0007Y9-6N@xenbits.xen.org>
Date: Fri, 12 Oct 2012 00:11:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: make virtual address defines
	unsigned
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1349967417 -3600
# Node ID e78fff21c038aa1bd8a0db3b337299d81e872c0e
# Parent  5840770f81ba00775f714b210eb589cd9331012c
arm: make virtual address defines unsigned

avoids confusion due to overflow etc.

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


diff -r 5840770f81ba -r e78fff21c038 xen/include/asm-arm/config.h
--- a/xen/include/asm-arm/config.h	Thu Oct 11 15:56:56 2012 +0100
+++ b/xen/include/asm-arm/config.h	Thu Oct 11 15:56:57 2012 +0100
@@ -69,14 +69,14 @@
  *   - in setup_pagetables() when relocating Xen.
  */
 
-#define XEN_VIRT_START         0x00200000
-#define FIXMAP_ADDR(n)        (0x00400000 + (n) * PAGE_SIZE)
-#define BOOT_MISC_VIRT_START   0x00600000
-#define FRAMETABLE_VIRT_START  0x02000000
-#define XENHEAP_VIRT_START     0x40000000
-#define DOMHEAP_VIRT_START     0x80000000
+#define XEN_VIRT_START         mk_unsigned_long(0x00200000)
+#define FIXMAP_ADDR(n)        (mk_unsigned_long(0x00400000) + (n) * PAGE_SIZE)
+#define BOOT_MISC_VIRT_START   mk_unsigned_long(0x00600000)
+#define FRAMETABLE_VIRT_START  mk_unsigned_long(0x02000000)
+#define XENHEAP_VIRT_START     mk_unsigned_long(0x40000000)
+#define DOMHEAP_VIRT_START     mk_unsigned_long(0x80000000)
 
-#define HYPERVISOR_VIRT_START mk_unsigned_long(XEN_VIRT_START)
+#define HYPERVISOR_VIRT_START  XEN_VIRT_START
 
 #define DOMHEAP_ENTRIES        1024  /* 1024 2MB mapping slots */
 

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

From xen-changelog-bounces@lists.xen.org Fri Oct 12 00:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Oct 2012 00:11:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TMSqQ-0006F5-Cg; Fri, 12 Oct 2012 00:11:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMSqO-0006EP-Fx
	for xen-changelog@lists.xensource.com; Fri, 12 Oct 2012 00:11:12 +0000
Received: from [85.158.143.99:12594] by server-2.bemta-4.messagelabs.com id
	8D/61-25171-F1067705; Fri, 12 Oct 2012 00:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-216.messagelabs.com!1350000669!33782668!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17414 invoked from network); 12 Oct 2012 00:11:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Oct 2012 00:11:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMSqL-0008TW-Eg
	for xen-changelog@lists.xensource.com; Fri, 12 Oct 2012 00:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMSqL-0007Yd-7T
	for xen-changelog@lists.xensource.com; Fri, 12 Oct 2012 00:11:09 +0000
Message-Id: <E1TMSqL-0007Yd-7T@xenbits.xen.org>
Date: Fri, 12 Oct 2012 00:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: really allocate boot frametable
	pages with 32M alignment
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1349967419 -3600
# Node ID fbb8fc5ab0416c6a1a4a9460d6f8138dbe27c8ab
# Parent  375a7e0e275f408018bbe9a0922b3b4628f28d6f
arm: really allocate boot frametable pages with 32M alignment

This argument to alloc_boot_pages is "pfn_align" and not an order.
We've been lucky until now that the area given to the boot allocator
happened to be properly aligned and this allocation was early enough
to benefit.

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


diff -r 375a7e0e275f -r fbb8fc5ab041 xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c	Thu Oct 11 15:56:58 2012 +0100
+++ b/xen/arch/arm/mm.c	Thu Oct 11 15:56:59 2012 +0100
@@ -352,7 +352,7 @@ void __init setup_frametable_mappings(pa
 
     /* Round up to 32M boundary */
     frametable_size = (frametable_size + 0x1ffffff) & ~0x1ffffff;
-    base_mfn = alloc_boot_pages(frametable_size >> PAGE_SHIFT, 5);
+    base_mfn = alloc_boot_pages(frametable_size >> PAGE_SHIFT, 32<<(20-12));
     create_mappings(FRAMETABLE_VIRT_START, base_mfn, frametable_size >> PAGE_SHIFT);
 
     memset(&frame_table[0], 0, nr_pages * sizeof(struct page_info));

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

From xen-changelog-bounces@lists.xen.org Fri Oct 12 00:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Oct 2012 00:11:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TMSqQ-0006F5-Cg; Fri, 12 Oct 2012 00:11:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMSqO-0006EP-Fx
	for xen-changelog@lists.xensource.com; Fri, 12 Oct 2012 00:11:12 +0000
Received: from [85.158.143.99:12594] by server-2.bemta-4.messagelabs.com id
	8D/61-25171-F1067705; Fri, 12 Oct 2012 00:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-216.messagelabs.com!1350000669!33782668!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17414 invoked from network); 12 Oct 2012 00:11:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Oct 2012 00:11:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMSqL-0008TW-Eg
	for xen-changelog@lists.xensource.com; Fri, 12 Oct 2012 00:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMSqL-0007Yd-7T
	for xen-changelog@lists.xensource.com; Fri, 12 Oct 2012 00:11:09 +0000
Message-Id: <E1TMSqL-0007Yd-7T@xenbits.xen.org>
Date: Fri, 12 Oct 2012 00:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: really allocate boot frametable
	pages with 32M alignment
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1349967419 -3600
# Node ID fbb8fc5ab0416c6a1a4a9460d6f8138dbe27c8ab
# Parent  375a7e0e275f408018bbe9a0922b3b4628f28d6f
arm: really allocate boot frametable pages with 32M alignment

This argument to alloc_boot_pages is "pfn_align" and not an order.
We've been lucky until now that the area given to the boot allocator
happened to be properly aligned and this allocation was early enough
to benefit.

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


diff -r 375a7e0e275f -r fbb8fc5ab041 xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c	Thu Oct 11 15:56:58 2012 +0100
+++ b/xen/arch/arm/mm.c	Thu Oct 11 15:56:59 2012 +0100
@@ -352,7 +352,7 @@ void __init setup_frametable_mappings(pa
 
     /* Round up to 32M boundary */
     frametable_size = (frametable_size + 0x1ffffff) & ~0x1ffffff;
-    base_mfn = alloc_boot_pages(frametable_size >> PAGE_SHIFT, 5);
+    base_mfn = alloc_boot_pages(frametable_size >> PAGE_SHIFT, 32<<(20-12));
     create_mappings(FRAMETABLE_VIRT_START, base_mfn, frametable_size >> PAGE_SHIFT);
 
     memset(&frame_table[0], 0, nr_pages * sizeof(struct page_info));

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

From xen-changelog-bounces@lists.xen.org Fri Oct 12 00:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Oct 2012 00:11:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TMSqQ-0006FA-Fv; Fri, 12 Oct 2012 00:11:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMSqO-0006E9-Ph
	for xen-changelog@lists.xensource.com; Fri, 12 Oct 2012 00:11:12 +0000
Received: from [85.158.139.211:10705] by server-10.bemta-5.messagelabs.com id
	2A/02-06995-02067705; Fri, 12 Oct 2012 00:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-206.messagelabs.com!1350000670!22033342!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7217 invoked from network); 12 Oct 2012 00:11:11 -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;
	12 Oct 2012 00:11:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMSqM-0008Tc-Mw
	for xen-changelog@lists.xensource.com; Fri, 12 Oct 2012 00:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMSqM-0007Z9-91
	for xen-changelog@lists.xensource.com; Fri, 12 Oct 2012 00:11:10 +0000
Message-Id: <E1TMSqM-0007Z9-91@xenbits.xen.org>
Date: Fri, 12 Oct 2012 00:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: mark heap and frametable limits
	as read mostly
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1349967420 -3600
# Node ID e0e1350dfe9b7a6cacb1378f75d8e6536d22eb2d
# Parent  632c1db3658a8a869b82a91b53a89c54506ddac8
arm: mark heap and frametable limits as read mostly

These are used in virt_to_page and page_to_virt so I imagine there's
some small benefit to this (but I've not measured)

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


diff -r 632c1db3658a -r e0e1350dfe9b xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c	Thu Oct 11 15:56:59 2012 +0100
+++ b/xen/arch/arm/mm.c	Thu Oct 11 15:57:00 2012 +0100
@@ -46,11 +46,12 @@ uint64_t boot_httbr;
 static paddr_t phys_offset;
 
 /* Limits of the Xen heap */
-unsigned long xenheap_mfn_start, xenheap_mfn_end;
-unsigned long xenheap_virt_end;
+unsigned long xenheap_mfn_start __read_mostly;
+unsigned long xenheap_mfn_end __read_mostly;
+unsigned long xenheap_virt_end __read_mostly;
 
-unsigned long frametable_base_mfn;
-unsigned long frametable_virt_end;
+unsigned long frametable_base_mfn __read_mostly;
+unsigned long frametable_virt_end __read_mostly;
 
 unsigned long max_page;
 

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

From xen-changelog-bounces@lists.xen.org Fri Oct 12 00:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Oct 2012 00:11:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TMSqQ-0006FA-Fv; Fri, 12 Oct 2012 00:11:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMSqO-0006E9-Ph
	for xen-changelog@lists.xensource.com; Fri, 12 Oct 2012 00:11:12 +0000
Received: from [85.158.139.211:10705] by server-10.bemta-5.messagelabs.com id
	2A/02-06995-02067705; Fri, 12 Oct 2012 00:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-206.messagelabs.com!1350000670!22033342!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7217 invoked from network); 12 Oct 2012 00:11:11 -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;
	12 Oct 2012 00:11:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMSqM-0008Tc-Mw
	for xen-changelog@lists.xensource.com; Fri, 12 Oct 2012 00:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMSqM-0007Z9-91
	for xen-changelog@lists.xensource.com; Fri, 12 Oct 2012 00:11:10 +0000
Message-Id: <E1TMSqM-0007Z9-91@xenbits.xen.org>
Date: Fri, 12 Oct 2012 00:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: mark heap and frametable limits
	as read mostly
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1349967420 -3600
# Node ID e0e1350dfe9b7a6cacb1378f75d8e6536d22eb2d
# Parent  632c1db3658a8a869b82a91b53a89c54506ddac8
arm: mark heap and frametable limits as read mostly

These are used in virt_to_page and page_to_virt so I imagine there's
some small benefit to this (but I've not measured)

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


diff -r 632c1db3658a -r e0e1350dfe9b xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c	Thu Oct 11 15:56:59 2012 +0100
+++ b/xen/arch/arm/mm.c	Thu Oct 11 15:57:00 2012 +0100
@@ -46,11 +46,12 @@ uint64_t boot_httbr;
 static paddr_t phys_offset;
 
 /* Limits of the Xen heap */
-unsigned long xenheap_mfn_start, xenheap_mfn_end;
-unsigned long xenheap_virt_end;
+unsigned long xenheap_mfn_start __read_mostly;
+unsigned long xenheap_mfn_end __read_mostly;
+unsigned long xenheap_virt_end __read_mostly;
 
-unsigned long frametable_base_mfn;
-unsigned long frametable_virt_end;
+unsigned long frametable_base_mfn __read_mostly;
+unsigned long frametable_virt_end __read_mostly;
 
 unsigned long max_page;
 

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

From xen-changelog-bounces@lists.xen.org Fri Oct 12 00:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Oct 2012 00:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TMSqQ-0006FF-IN; Fri, 12 Oct 2012 00:11:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMSqP-0006Ec-5h
	for xen-changelog@lists.xensource.com; Fri, 12 Oct 2012 00:11:13 +0000
Received: from [85.158.138.51:33987] by server-4.bemta-3.messagelabs.com id
	AB/F6-01405-F1067705; Fri, 12 Oct 2012 00:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-174.messagelabs.com!1350000670!34137160!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2239 invoked from network); 12 Oct 2012 00:11:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Oct 2012 00:11:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMSqL-0008TZ-UB
	for xen-changelog@lists.xensource.com; Fri, 12 Oct 2012 00:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMSqL-0007Ys-OC
	for xen-changelog@lists.xensource.com; Fri, 12 Oct 2012 00:11:09 +0000
Message-Id: <E1TMSqL-0007Ys-OC@xenbits.xen.org>
Date: Fri, 12 Oct 2012 00:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: print a message if multiple
	banks of memory are present.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1349967419 -3600
# Node ID 632c1db3658a8a869b82a91b53a89c54506ddac8
# Parent  fbb8fc5ab0416c6a1a4a9460d6f8138dbe27c8ab
arm: print a message if multiple banks of memory are present.

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


diff -r fbb8fc5ab041 -r 632c1db3658a xen/arch/arm/setup.c
--- a/xen/arch/arm/setup.c	Thu Oct 11 15:56:59 2012 +0100
+++ b/xen/arch/arm/setup.c	Thu Oct 11 15:56:59 2012 +0100
@@ -114,6 +114,8 @@ static void __init setup_mm(unsigned lon
      * TODO: only using the first RAM bank for now.  The heaps and the
      * frame table assume RAM is physically contiguous.
      */
+    if ( early_info.mem.nr_banks > 1 )
+        early_printk("WARNING: Only using first bank of memory\n");
     ram_start = early_info.mem.bank[0].start;
     ram_size  = early_info.mem.bank[0].size;
     ram_end = ram_start + ram_size;

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

From xen-changelog-bounces@lists.xen.org Fri Oct 12 00:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Oct 2012 00:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TMSqQ-0006F0-9f; Fri, 12 Oct 2012 00:11:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMSqO-0006EO-9C
	for xen-changelog@lists.xensource.com; Fri, 12 Oct 2012 00:11:12 +0000
Received: from [85.158.137.99:35417] by server-15.bemta-3.messagelabs.com id
	BB/17-10261-F1067705; Fri, 12 Oct 2012 00:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-217.messagelabs.com!1350000669!21280092!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28979 invoked from network); 12 Oct 2012 00:11:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Oct 2012 00:11:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMSqL-0008TT-4X
	for xen-changelog@lists.xensource.com; Fri, 12 Oct 2012 00:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMSqK-0007YO-N8
	for xen-changelog@lists.xensource.com; Fri, 12 Oct 2012 00:11:08 +0000
Message-Id: <E1TMSqK-0007YO-N8@xenbits.xen.org>
Date: Fri, 12 Oct 2012 00:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: move get_paddr_function to arch
	setup.c from device_tree.c
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1349967418 -3600
# Node ID 375a7e0e275f408018bbe9a0922b3b4628f28d6f
# Parent  e78fff21c038aa1bd8a0db3b337299d81e872c0e
arm: move get_paddr_function to arch setup.c from device_tree.c

It's not realy got any DT functionality in it and its only caller is
setup_pagetables.

Put it here because future patches want to incorporate of the module
layout in memory and I'd like to confine that to setup.c

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


diff -r e78fff21c038 -r 375a7e0e275f xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c	Thu Oct 11 15:56:57 2012 +0100
+++ b/xen/arch/arm/mm.c	Thu Oct 11 15:56:58 2012 +0100
@@ -205,15 +205,12 @@ void unmap_domain_page(const void *va)
 
 /* Boot-time pagetable setup.
  * Changes here may need matching changes in head.S */
-void __init setup_pagetables(unsigned long boot_phys_offset)
+void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
 {
-    paddr_t xen_paddr;
     unsigned long dest_va;
     lpae_t pte, *p;
     int i;
 
-    xen_paddr = device_tree_get_xen_paddr();
-
     /* Map the destination in the boot misc area. */
     dest_va = BOOT_MISC_VIRT_START;
     pte = mfn_to_xen_entry(xen_paddr >> PAGE_SHIFT);
diff -r e78fff21c038 -r 375a7e0e275f xen/arch/arm/setup.c
--- a/xen/arch/arm/setup.c	Thu Oct 11 15:56:57 2012 +0100
+++ b/xen/arch/arm/setup.c	Thu Oct 11 15:56:58 2012 +0100
@@ -38,6 +38,7 @@
 #include <asm/current.h>
 #include <asm/setup.h>
 #include <asm/vfp.h>
+#include <asm/early_printk.h>
 #include "gic.h"
 
 static __attribute_used__ void init_done(void)
@@ -67,6 +68,38 @@ static void __init processor_id(void)
            READ_CP32(ID_ISAR3), READ_CP32(ID_ISAR4), READ_CP32(ID_ISAR5));
 }
 
+/**
+ * get_xen_paddr - get physical address to relocate Xen to
+ *
+ * Xen is relocated to the top of RAM and aligned to a XEN_PADDR_ALIGN
+ * boundary.
+ */
+static paddr_t __init get_xen_paddr(void)
+{
+    struct dt_mem_info *mi = &early_info.mem;
+    paddr_t min_size;
+    paddr_t paddr = 0, t;
+    int i;
+
+    min_size = (_end - _start + (XEN_PADDR_ALIGN-1)) & ~(XEN_PADDR_ALIGN-1);
+
+    /* Find the highest bank with enough space. */
+    for ( i = 0; i < mi->nr_banks; i++ )
+    {
+        if ( mi->bank[i].size >= min_size )
+        {
+            t = mi->bank[i].start + mi->bank[i].size - min_size;
+            if ( t > paddr )
+                paddr = t;
+        }
+    }
+
+    if ( !paddr )
+        early_panic("Not enough memory to relocate Xen\n");
+
+    return paddr;
+}
+
 static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
 {
     paddr_t ram_start;
@@ -156,7 +189,7 @@ void __init start_xen(unsigned long boot
 
     cmdline_parse(device_tree_bootargs(fdt));
 
-    setup_pagetables(boot_phys_offset);
+    setup_pagetables(boot_phys_offset, get_xen_paddr());
 
 #ifdef EARLY_UART_ADDRESS
     /* Map the UART */
diff -r e78fff21c038 -r 375a7e0e275f xen/common/device_tree.c
--- a/xen/common/device_tree.c	Thu Oct 11 15:56:57 2012 +0100
+++ b/xen/common/device_tree.c	Thu Oct 11 15:56:58 2012 +0100
@@ -273,38 +273,6 @@ size_t __init device_tree_early_init(con
     return fdt_totalsize(fdt);
 }
 
-/**
- * device_tree_get_xen_paddr - get physical address to relocate Xen to
- *
- * Xen is relocated to the top of RAM and aligned to a XEN_PADDR_ALIGN
- * boundary.
- */
-paddr_t __init device_tree_get_xen_paddr(void)
-{
-    struct dt_mem_info *mi = &early_info.mem;
-    paddr_t min_size;
-    paddr_t paddr = 0, t;
-    int i;
-
-    min_size = (_end - _start + (XEN_PADDR_ALIGN-1)) & ~(XEN_PADDR_ALIGN-1);
-
-    /* Find the highest bank with enough space. */
-    for ( i = 0; i < mi->nr_banks; i++ )
-    {
-        if ( mi->bank[i].size >= min_size )
-        {
-            t = mi->bank[i].start + mi->bank[i].size - min_size;
-            if ( t > paddr )
-                paddr = t;
-        }
-    }
-
-    if ( !paddr )
-        early_panic("Not enough memory to relocate Xen\n");
-
-    return paddr;
-}
-
 /*
  * Local variables:
  * mode: C
diff -r e78fff21c038 -r 375a7e0e275f xen/include/asm-arm/mm.h
--- a/xen/include/asm-arm/mm.h	Thu Oct 11 15:56:57 2012 +0100
+++ b/xen/include/asm-arm/mm.h	Thu Oct 11 15:56:58 2012 +0100
@@ -138,7 +138,7 @@ extern unsigned long max_page;
 extern unsigned long total_pages;
 
 /* Boot-time pagetable setup */
-extern void setup_pagetables(unsigned long boot_phys_offset);
+extern void setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr);
 /* MMU setup for seccondary CPUS (which already have paging enabled) */
 extern void __cpuinit mmu_init_secondary_cpu(void);
 /* Set up the xenheap: up to 1GB of contiguous, always-mapped memory.
diff -r e78fff21c038 -r 375a7e0e275f xen/include/xen/device_tree.h
--- a/xen/include/xen/device_tree.h	Thu Oct 11 15:56:57 2012 +0100
+++ b/xen/include/xen/device_tree.h	Thu Oct 11 15:56:58 2012 +0100
@@ -39,7 +39,6 @@ extern struct dt_early_info early_info;
 extern void *device_tree_flattened;
 
 size_t device_tree_early_init(const void *fdt);
-paddr_t device_tree_get_xen_paddr(void);
 
 void device_tree_get_reg(const u32 **cell, u32 address_cells, u32 size_cells,
                          u64 *start, u64 *size);

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

From xen-changelog-bounces@lists.xen.org Fri Oct 12 00:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Oct 2012 00:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TMSqQ-0006F0-9f; Fri, 12 Oct 2012 00:11:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMSqO-0006EO-9C
	for xen-changelog@lists.xensource.com; Fri, 12 Oct 2012 00:11:12 +0000
Received: from [85.158.137.99:35417] by server-15.bemta-3.messagelabs.com id
	BB/17-10261-F1067705; Fri, 12 Oct 2012 00:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-217.messagelabs.com!1350000669!21280092!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28979 invoked from network); 12 Oct 2012 00:11:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Oct 2012 00:11:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMSqL-0008TT-4X
	for xen-changelog@lists.xensource.com; Fri, 12 Oct 2012 00:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMSqK-0007YO-N8
	for xen-changelog@lists.xensource.com; Fri, 12 Oct 2012 00:11:08 +0000
Message-Id: <E1TMSqK-0007YO-N8@xenbits.xen.org>
Date: Fri, 12 Oct 2012 00:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: move get_paddr_function to arch
	setup.c from device_tree.c
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1349967418 -3600
# Node ID 375a7e0e275f408018bbe9a0922b3b4628f28d6f
# Parent  e78fff21c038aa1bd8a0db3b337299d81e872c0e
arm: move get_paddr_function to arch setup.c from device_tree.c

It's not realy got any DT functionality in it and its only caller is
setup_pagetables.

Put it here because future patches want to incorporate of the module
layout in memory and I'd like to confine that to setup.c

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


diff -r e78fff21c038 -r 375a7e0e275f xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c	Thu Oct 11 15:56:57 2012 +0100
+++ b/xen/arch/arm/mm.c	Thu Oct 11 15:56:58 2012 +0100
@@ -205,15 +205,12 @@ void unmap_domain_page(const void *va)
 
 /* Boot-time pagetable setup.
  * Changes here may need matching changes in head.S */
-void __init setup_pagetables(unsigned long boot_phys_offset)
+void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
 {
-    paddr_t xen_paddr;
     unsigned long dest_va;
     lpae_t pte, *p;
     int i;
 
-    xen_paddr = device_tree_get_xen_paddr();
-
     /* Map the destination in the boot misc area. */
     dest_va = BOOT_MISC_VIRT_START;
     pte = mfn_to_xen_entry(xen_paddr >> PAGE_SHIFT);
diff -r e78fff21c038 -r 375a7e0e275f xen/arch/arm/setup.c
--- a/xen/arch/arm/setup.c	Thu Oct 11 15:56:57 2012 +0100
+++ b/xen/arch/arm/setup.c	Thu Oct 11 15:56:58 2012 +0100
@@ -38,6 +38,7 @@
 #include <asm/current.h>
 #include <asm/setup.h>
 #include <asm/vfp.h>
+#include <asm/early_printk.h>
 #include "gic.h"
 
 static __attribute_used__ void init_done(void)
@@ -67,6 +68,38 @@ static void __init processor_id(void)
            READ_CP32(ID_ISAR3), READ_CP32(ID_ISAR4), READ_CP32(ID_ISAR5));
 }
 
+/**
+ * get_xen_paddr - get physical address to relocate Xen to
+ *
+ * Xen is relocated to the top of RAM and aligned to a XEN_PADDR_ALIGN
+ * boundary.
+ */
+static paddr_t __init get_xen_paddr(void)
+{
+    struct dt_mem_info *mi = &early_info.mem;
+    paddr_t min_size;
+    paddr_t paddr = 0, t;
+    int i;
+
+    min_size = (_end - _start + (XEN_PADDR_ALIGN-1)) & ~(XEN_PADDR_ALIGN-1);
+
+    /* Find the highest bank with enough space. */
+    for ( i = 0; i < mi->nr_banks; i++ )
+    {
+        if ( mi->bank[i].size >= min_size )
+        {
+            t = mi->bank[i].start + mi->bank[i].size - min_size;
+            if ( t > paddr )
+                paddr = t;
+        }
+    }
+
+    if ( !paddr )
+        early_panic("Not enough memory to relocate Xen\n");
+
+    return paddr;
+}
+
 static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
 {
     paddr_t ram_start;
@@ -156,7 +189,7 @@ void __init start_xen(unsigned long boot
 
     cmdline_parse(device_tree_bootargs(fdt));
 
-    setup_pagetables(boot_phys_offset);
+    setup_pagetables(boot_phys_offset, get_xen_paddr());
 
 #ifdef EARLY_UART_ADDRESS
     /* Map the UART */
diff -r e78fff21c038 -r 375a7e0e275f xen/common/device_tree.c
--- a/xen/common/device_tree.c	Thu Oct 11 15:56:57 2012 +0100
+++ b/xen/common/device_tree.c	Thu Oct 11 15:56:58 2012 +0100
@@ -273,38 +273,6 @@ size_t __init device_tree_early_init(con
     return fdt_totalsize(fdt);
 }
 
-/**
- * device_tree_get_xen_paddr - get physical address to relocate Xen to
- *
- * Xen is relocated to the top of RAM and aligned to a XEN_PADDR_ALIGN
- * boundary.
- */
-paddr_t __init device_tree_get_xen_paddr(void)
-{
-    struct dt_mem_info *mi = &early_info.mem;
-    paddr_t min_size;
-    paddr_t paddr = 0, t;
-    int i;
-
-    min_size = (_end - _start + (XEN_PADDR_ALIGN-1)) & ~(XEN_PADDR_ALIGN-1);
-
-    /* Find the highest bank with enough space. */
-    for ( i = 0; i < mi->nr_banks; i++ )
-    {
-        if ( mi->bank[i].size >= min_size )
-        {
-            t = mi->bank[i].start + mi->bank[i].size - min_size;
-            if ( t > paddr )
-                paddr = t;
-        }
-    }
-
-    if ( !paddr )
-        early_panic("Not enough memory to relocate Xen\n");
-
-    return paddr;
-}
-
 /*
  * Local variables:
  * mode: C
diff -r e78fff21c038 -r 375a7e0e275f xen/include/asm-arm/mm.h
--- a/xen/include/asm-arm/mm.h	Thu Oct 11 15:56:57 2012 +0100
+++ b/xen/include/asm-arm/mm.h	Thu Oct 11 15:56:58 2012 +0100
@@ -138,7 +138,7 @@ extern unsigned long max_page;
 extern unsigned long total_pages;
 
 /* Boot-time pagetable setup */
-extern void setup_pagetables(unsigned long boot_phys_offset);
+extern void setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr);
 /* MMU setup for seccondary CPUS (which already have paging enabled) */
 extern void __cpuinit mmu_init_secondary_cpu(void);
 /* Set up the xenheap: up to 1GB of contiguous, always-mapped memory.
diff -r e78fff21c038 -r 375a7e0e275f xen/include/xen/device_tree.h
--- a/xen/include/xen/device_tree.h	Thu Oct 11 15:56:57 2012 +0100
+++ b/xen/include/xen/device_tree.h	Thu Oct 11 15:56:58 2012 +0100
@@ -39,7 +39,6 @@ extern struct dt_early_info early_info;
 extern void *device_tree_flattened;
 
 size_t device_tree_early_init(const void *fdt);
-paddr_t device_tree_get_xen_paddr(void);
 
 void device_tree_get_reg(const u32 **cell, u32 address_cells, u32 size_cells,
                          u64 *start, u64 *size);

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

From xen-changelog-bounces@lists.xen.org Fri Oct 12 00:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Oct 2012 00:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TMSqQ-0006FF-IN; Fri, 12 Oct 2012 00:11:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMSqP-0006Ec-5h
	for xen-changelog@lists.xensource.com; Fri, 12 Oct 2012 00:11:13 +0000
Received: from [85.158.138.51:33987] by server-4.bemta-3.messagelabs.com id
	AB/F6-01405-F1067705; Fri, 12 Oct 2012 00:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-174.messagelabs.com!1350000670!34137160!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2239 invoked from network); 12 Oct 2012 00:11:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Oct 2012 00:11:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMSqL-0008TZ-UB
	for xen-changelog@lists.xensource.com; Fri, 12 Oct 2012 00:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TMSqL-0007Ys-OC
	for xen-changelog@lists.xensource.com; Fri, 12 Oct 2012 00:11:09 +0000
Message-Id: <E1TMSqL-0007Ys-OC@xenbits.xen.org>
Date: Fri, 12 Oct 2012 00:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: print a message if multiple
	banks of memory are present.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1349967419 -3600
# Node ID 632c1db3658a8a869b82a91b53a89c54506ddac8
# Parent  fbb8fc5ab0416c6a1a4a9460d6f8138dbe27c8ab
arm: print a message if multiple banks of memory are present.

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


diff -r fbb8fc5ab041 -r 632c1db3658a xen/arch/arm/setup.c
--- a/xen/arch/arm/setup.c	Thu Oct 11 15:56:59 2012 +0100
+++ b/xen/arch/arm/setup.c	Thu Oct 11 15:56:59 2012 +0100
@@ -114,6 +114,8 @@ static void __init setup_mm(unsigned lon
      * TODO: only using the first RAM bank for now.  The heaps and the
      * frame table assume RAM is physically contiguous.
      */
+    if ( early_info.mem.nr_banks > 1 )
+        early_printk("WARNING: Only using first bank of memory\n");
     ram_start = early_info.mem.bank[0].start;
     ram_size  = early_info.mem.bank[0].size;
     ram_end = ram_start + ram_size;

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

From xen-changelog-bounces@lists.xen.org Tue Oct 16 07:11:38 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 16 Oct 2012 07:11:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TO1J3-0005aF-Fn; Tue, 16 Oct 2012 07:11:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1J2-0005Zs-KJ
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:12 +0000
Received: from [85.158.139.83:18339] by server-14.bemta-5.messagelabs.com id
	8A/B4-24068-F880D705; Tue, 16 Oct 2012 07:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-182.messagelabs.com!1350371470!30489931!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11498 invoked from network); 16 Oct 2012 07:11:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2012 07:11:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1J0-0008RL-0F
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1Iz-0001FD-KC
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:09 +0000
Message-Id: <E1TO1Iz-0001FD-KC@xenbits.xen.org>
Date: Tue, 16 Oct 2012 07:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/amd: Fix xen_apic_write warnings
	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

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1350306216 -7200
# Node ID 983108e1b56bf809f3f5eaaebf18c4b613ff0865
# Parent  137dfbd3190e849b3a498d8b2ea282ebbf12e77d
x86/amd: Fix xen_apic_write warnings in Dom0

[    0.020294] ------------[ cut here ]------------
[    0.020311] WARNING: at arch/x86/xen/enlighten.c:730
xen_apic_write+0x15/0x17()
[    0.020318] Hardware name: empty
[    0.020323] Modules linked in:
[    0.020334] Pid: 1, comm: swapper/0 Not tainted 3.3.8 #7
[    0.020340] Call Trace:
[    0.020354]  [<ffffffff81050379>] warn_slowpath_common+0x80/0x98
[    0.020369]  [<ffffffff810503a6>] warn_slowpath_null+0x15/0x17
[    0.020378]  [<ffffffff810034df>] xen_apic_write+0x15/0x17
[    0.020392]  [<ffffffff8101cb2b>] perf_events_lapic_init+0x2e/0x30
[    0.020410]  [<ffffffff81ee4dd0>] init_hw_perf_events+0x250/0x407
[    0.020419]  [<ffffffff81ee4b80>] ? check_bugs+0x2d/0x2d
[    0.020430]  [<ffffffff81002181>] do_one_initcall+0x7a/0x131
[    0.020444]  [<ffffffff81edbbf9>] kernel_init+0x91/0x15d
[    0.020456]  [<ffffffff817caaa4>] kernel_thread_helper+0x4/0x10
[    0.020471]  [<ffffffff817c347c>] ? retint_restore_args+0x5/0x6
[    0.020481]  [<ffffffff817caaa0>] ? gs_change+0x13/0x13
[    0.020500] ---[ end trace a7919e7f17c0a725 ]---

Kernel function check_hw_exists() writes 0xabcd to msr 0xc0010201 (Performance Event
Counter 0) and read it again to check if it is running as dom0. Early amd cpus does
not reset perf counters during warm reboot. If the kernel is booted with bare metal
and then as a dom0, the content of msr 0xc0010201 will stay and the checking will
pass and PMU will be enabled unexpectedly.

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

Don't reset the counters when used for the NMI watchdog.

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


diff -r 137dfbd3190e -r 983108e1b56b xen/arch/x86/cpu/amd.c
--- a/xen/arch/x86/cpu/amd.c	Mon Oct 15 12:59:14 2012 +0200
+++ b/xen/arch/x86/cpu/amd.c	Mon Oct 15 15:03:36 2012 +0200
@@ -11,6 +11,7 @@
 #include <asm/hvm/support.h>
 #include <asm/setup.h> /* amd_init_cpu */
 #include <asm/acpi.h>
+#include <asm/apic.h>
 
 #include "cpu.h"
 
@@ -485,6 +486,17 @@ static void __devinit init_amd(struct cp
 	if (c->x86 > 0x11)
 		set_bit(X86_FEATURE_ARAT, c->x86_capability);
 
+	/*
+	 * Prior to Family 0x14, perf counters are not reset during warm reboot.
+	 * We have to reset them manually.
+	 */
+	if (nmi_watchdog != NMI_LOCAL_APIC && c->x86 < 0x14) {
+		wrmsrl(MSR_K7_PERFCTR0, 0);
+		wrmsrl(MSR_K7_PERFCTR1, 0);
+		wrmsrl(MSR_K7_PERFCTR2, 0);
+		wrmsrl(MSR_K7_PERFCTR3, 0);
+	}
+
 	if (cpuid_edx(0x80000007) & (1 << 10)) {
 		rdmsr(MSR_K7_HWCR, l, h);
 		l |= (1 << 27); /* Enable read-only APERF/MPERF bit */

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

From xen-changelog-bounces@lists.xen.org Tue Oct 16 07:11:38 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 16 Oct 2012 07:11:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TO1J3-0005aF-Fn; Tue, 16 Oct 2012 07:11:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1J2-0005Zs-KJ
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:12 +0000
Received: from [85.158.139.83:18339] by server-14.bemta-5.messagelabs.com id
	8A/B4-24068-F880D705; Tue, 16 Oct 2012 07:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-182.messagelabs.com!1350371470!30489931!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11498 invoked from network); 16 Oct 2012 07:11:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2012 07:11:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1J0-0008RL-0F
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1Iz-0001FD-KC
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:09 +0000
Message-Id: <E1TO1Iz-0001FD-KC@xenbits.xen.org>
Date: Tue, 16 Oct 2012 07:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/amd: Fix xen_apic_write warnings
	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

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1350306216 -7200
# Node ID 983108e1b56bf809f3f5eaaebf18c4b613ff0865
# Parent  137dfbd3190e849b3a498d8b2ea282ebbf12e77d
x86/amd: Fix xen_apic_write warnings in Dom0

[    0.020294] ------------[ cut here ]------------
[    0.020311] WARNING: at arch/x86/xen/enlighten.c:730
xen_apic_write+0x15/0x17()
[    0.020318] Hardware name: empty
[    0.020323] Modules linked in:
[    0.020334] Pid: 1, comm: swapper/0 Not tainted 3.3.8 #7
[    0.020340] Call Trace:
[    0.020354]  [<ffffffff81050379>] warn_slowpath_common+0x80/0x98
[    0.020369]  [<ffffffff810503a6>] warn_slowpath_null+0x15/0x17
[    0.020378]  [<ffffffff810034df>] xen_apic_write+0x15/0x17
[    0.020392]  [<ffffffff8101cb2b>] perf_events_lapic_init+0x2e/0x30
[    0.020410]  [<ffffffff81ee4dd0>] init_hw_perf_events+0x250/0x407
[    0.020419]  [<ffffffff81ee4b80>] ? check_bugs+0x2d/0x2d
[    0.020430]  [<ffffffff81002181>] do_one_initcall+0x7a/0x131
[    0.020444]  [<ffffffff81edbbf9>] kernel_init+0x91/0x15d
[    0.020456]  [<ffffffff817caaa4>] kernel_thread_helper+0x4/0x10
[    0.020471]  [<ffffffff817c347c>] ? retint_restore_args+0x5/0x6
[    0.020481]  [<ffffffff817caaa0>] ? gs_change+0x13/0x13
[    0.020500] ---[ end trace a7919e7f17c0a725 ]---

Kernel function check_hw_exists() writes 0xabcd to msr 0xc0010201 (Performance Event
Counter 0) and read it again to check if it is running as dom0. Early amd cpus does
not reset perf counters during warm reboot. If the kernel is booted with bare metal
and then as a dom0, the content of msr 0xc0010201 will stay and the checking will
pass and PMU will be enabled unexpectedly.

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

Don't reset the counters when used for the NMI watchdog.

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


diff -r 137dfbd3190e -r 983108e1b56b xen/arch/x86/cpu/amd.c
--- a/xen/arch/x86/cpu/amd.c	Mon Oct 15 12:59:14 2012 +0200
+++ b/xen/arch/x86/cpu/amd.c	Mon Oct 15 15:03:36 2012 +0200
@@ -11,6 +11,7 @@
 #include <asm/hvm/support.h>
 #include <asm/setup.h> /* amd_init_cpu */
 #include <asm/acpi.h>
+#include <asm/apic.h>
 
 #include "cpu.h"
 
@@ -485,6 +486,17 @@ static void __devinit init_amd(struct cp
 	if (c->x86 > 0x11)
 		set_bit(X86_FEATURE_ARAT, c->x86_capability);
 
+	/*
+	 * Prior to Family 0x14, perf counters are not reset during warm reboot.
+	 * We have to reset them manually.
+	 */
+	if (nmi_watchdog != NMI_LOCAL_APIC && c->x86 < 0x14) {
+		wrmsrl(MSR_K7_PERFCTR0, 0);
+		wrmsrl(MSR_K7_PERFCTR1, 0);
+		wrmsrl(MSR_K7_PERFCTR2, 0);
+		wrmsrl(MSR_K7_PERFCTR3, 0);
+	}
+
 	if (cpuid_edx(0x80000007) & (1 << 10)) {
 		rdmsr(MSR_K7_HWCR, l, h);
 		l |= (1 << 27); /* Enable read-only APERF/MPERF bit */

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

From xen-changelog-bounces@lists.xen.org Tue Oct 16 07:11:39 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 16 Oct 2012 07:11:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TO1J3-0005aA-DF; Tue, 16 Oct 2012 07:11:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1J2-0005Zr-HP
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:12 +0000
Received: from [85.158.143.99:7853] by server-2.bemta-4.messagelabs.com id
	79/EA-22268-0980D705; Tue, 16 Oct 2012 07:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1350371470!24658235!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17280 invoked from network); 16 Oct 2012 07:11:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2012 07:11:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1J0-0008RO-9X
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1J0-0001FT-5O
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:10 +0000
Message-Id: <E1TO1J0-0001FT-5O@xenbits.xen.org>
Date: Tue, 16 Oct 2012 07:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/xenoprof: fix kernel/user mode
	detection for HVM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jacob Shin <jacob.shin@amd.com>
# Date 1350306291 -7200
# Node ID 14e32621dbaf5b485b134ace4558e67c4c36e1ce
# Parent  983108e1b56bf809f3f5eaaebf18c4b613ff0865
x86/xenoprof: fix kernel/user mode detection for HVM

While trying oprofile under Xen, I noticed that HVM passive domain's
kernel addresses were showing up as user application. It turns out
under HVM get_cpu_user_regs()->cs contains 0x0000beef.

Signed-off-by: Jacob Shin <jacob.shin@amd.com>

Don't cast away const-ness. Use SS instead of CS to determine ring.
Special-case real and protected mode.

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


diff -r 983108e1b56b -r 14e32621dbaf xen/arch/x86/oprofile/xenoprof.c
--- a/xen/arch/x86/oprofile/xenoprof.c	Mon Oct 15 15:03:36 2012 +0200
+++ b/xen/arch/x86/oprofile/xenoprof.c	Mon Oct 15 15:04:51 2012 +0200
@@ -74,16 +74,26 @@ int compat_oprof_arch_counter(XEN_GUEST_
     return 0;
 }
 
-int xenoprofile_get_mode(const struct vcpu *v,
-                         const struct cpu_user_regs *regs)
+int xenoprofile_get_mode(struct vcpu *curr, const struct cpu_user_regs *regs)
 {
     if ( !guest_mode(regs) )
         return 2;
 
-    if ( is_hvm_vcpu(v) )
-        return ((regs->cs & 3) != 3);
+    if ( !is_hvm_vcpu(curr) )
+        return guest_kernel_mode(curr, regs);
 
-    return guest_kernel_mode(v, regs);  
+    switch ( hvm_guest_x86_mode(curr) )
+    {
+        struct segment_register ss;
+
+    case 0: /* real mode */
+        return 1;
+    case 1: /* vm86 mode */
+        return 0;
+    default:
+        hvm_get_segment_register(curr, x86_seg_ss, &ss);
+        return (ss.sel & 3) != 3;
+    }
 }
 
 /*
diff -r 983108e1b56b -r 14e32621dbaf xen/include/asm-x86/xenoprof.h
--- a/xen/include/asm-x86/xenoprof.h	Mon Oct 15 15:03:36 2012 +0200
+++ b/xen/include/asm-x86/xenoprof.h	Mon Oct 15 15:04:51 2012 +0200
@@ -51,7 +51,7 @@ struct cpu_user_regs;
 void ibs_init(void);
 extern u32 ibs_caps;
 
-int xenoprofile_get_mode(const struct vcpu *, const struct cpu_user_regs *);
+int xenoprofile_get_mode(struct vcpu *, const struct cpu_user_regs *);
 
 static inline int xenoprof_backtrace_supported(void)
 {

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

From xen-changelog-bounces@lists.xen.org Tue Oct 16 07:11:39 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 16 Oct 2012 07:11:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TO1J3-0005aA-DF; Tue, 16 Oct 2012 07:11:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1J2-0005Zr-HP
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:12 +0000
Received: from [85.158.143.99:7853] by server-2.bemta-4.messagelabs.com id
	79/EA-22268-0980D705; Tue, 16 Oct 2012 07:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1350371470!24658235!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17280 invoked from network); 16 Oct 2012 07:11:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2012 07:11:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1J0-0008RO-9X
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1J0-0001FT-5O
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:10 +0000
Message-Id: <E1TO1J0-0001FT-5O@xenbits.xen.org>
Date: Tue, 16 Oct 2012 07:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/xenoprof: fix kernel/user mode
	detection for HVM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jacob Shin <jacob.shin@amd.com>
# Date 1350306291 -7200
# Node ID 14e32621dbaf5b485b134ace4558e67c4c36e1ce
# Parent  983108e1b56bf809f3f5eaaebf18c4b613ff0865
x86/xenoprof: fix kernel/user mode detection for HVM

While trying oprofile under Xen, I noticed that HVM passive domain's
kernel addresses were showing up as user application. It turns out
under HVM get_cpu_user_regs()->cs contains 0x0000beef.

Signed-off-by: Jacob Shin <jacob.shin@amd.com>

Don't cast away const-ness. Use SS instead of CS to determine ring.
Special-case real and protected mode.

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


diff -r 983108e1b56b -r 14e32621dbaf xen/arch/x86/oprofile/xenoprof.c
--- a/xen/arch/x86/oprofile/xenoprof.c	Mon Oct 15 15:03:36 2012 +0200
+++ b/xen/arch/x86/oprofile/xenoprof.c	Mon Oct 15 15:04:51 2012 +0200
@@ -74,16 +74,26 @@ int compat_oprof_arch_counter(XEN_GUEST_
     return 0;
 }
 
-int xenoprofile_get_mode(const struct vcpu *v,
-                         const struct cpu_user_regs *regs)
+int xenoprofile_get_mode(struct vcpu *curr, const struct cpu_user_regs *regs)
 {
     if ( !guest_mode(regs) )
         return 2;
 
-    if ( is_hvm_vcpu(v) )
-        return ((regs->cs & 3) != 3);
+    if ( !is_hvm_vcpu(curr) )
+        return guest_kernel_mode(curr, regs);
 
-    return guest_kernel_mode(v, regs);  
+    switch ( hvm_guest_x86_mode(curr) )
+    {
+        struct segment_register ss;
+
+    case 0: /* real mode */
+        return 1;
+    case 1: /* vm86 mode */
+        return 0;
+    default:
+        hvm_get_segment_register(curr, x86_seg_ss, &ss);
+        return (ss.sel & 3) != 3;
+    }
 }
 
 /*
diff -r 983108e1b56b -r 14e32621dbaf xen/include/asm-x86/xenoprof.h
--- a/xen/include/asm-x86/xenoprof.h	Mon Oct 15 15:03:36 2012 +0200
+++ b/xen/include/asm-x86/xenoprof.h	Mon Oct 15 15:04:51 2012 +0200
@@ -51,7 +51,7 @@ struct cpu_user_regs;
 void ibs_init(void);
 extern u32 ibs_caps;
 
-int xenoprofile_get_mode(const struct vcpu *, const struct cpu_user_regs *);
+int xenoprofile_get_mode(struct vcpu *, const struct cpu_user_regs *);
 
 static inline int xenoprof_backtrace_supported(void)
 {

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

From xen-changelog-bounces@lists.xen.org Tue Oct 16 07:11:39 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 16 Oct 2012 07:11:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TO1J3-0005a5-At; Tue, 16 Oct 2012 07:11:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1J2-0005Zr-2o
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:12 +0000
Received: from [85.158.143.99:8417] by server-2.bemta-4.messagelabs.com id
	E2/EA-22268-F880D705; Tue, 16 Oct 2012 07:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-216.messagelabs.com!1350371469!26080718!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28758 invoked from network); 16 Oct 2012 07:11:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2012 07:11:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1Iz-0008RI-Li
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1Iy-0001Ey-Uo
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:09 +0000
Message-Id: <E1TO1Iy-0001Ey-Uo@xenbits.xen.org>
Date: Tue, 16 Oct 2012 07:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] AMD IOMMU: fix
	find_iommu_from_bdf_cap()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1350298754 -7200
# Node ID 137dfbd3190e849b3a498d8b2ea282ebbf12e77d
# Parent  e0e1350dfe9b7a6cacb1378f75d8e6536d22eb2d
AMD IOMMU: fix find_iommu_from_bdf_cap()

The arguments passed for the "cap_offset" parameter get read from 16-
bit fields, so the parameter should also have (at least) 16 bits.

While fixing this I also noticed that this was yet another case where
PCI segment information wasn't properly propagated, so a respective
first parameter gets added to the function at once.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Wei Wang <wei.wang2@amd.com>
---


diff -r e0e1350dfe9b -r 137dfbd3190e xen/drivers/passthrough/amd/iommu_acpi.c
--- a/xen/drivers/passthrough/amd/iommu_acpi.c	Thu Oct 11 15:57:00 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_acpi.c	Mon Oct 15 12:59:14 2012 +0200
@@ -86,12 +86,13 @@ static void __init add_ivrs_mapping_entr
 }
 
 static struct amd_iommu * __init find_iommu_from_bdf_cap(
-    u16 bdf, u8 cap_offset)
+    u16 seg, u16 bdf, u16 cap_offset)
 {
     struct amd_iommu *iommu;
 
     for_each_amd_iommu ( iommu )
-        if ( (iommu->bdf == bdf) && (iommu->cap_offset == cap_offset) )
+        if ( (iommu->seg == seg) && (iommu->bdf == bdf) &&
+             (iommu->cap_offset == cap_offset) )
             return iommu;
 
     return NULL;
@@ -319,10 +320,11 @@ static int __init parse_ivmd_device_iomm
     const struct acpi_ivrs_memory *ivmd_block,
     unsigned long base, unsigned long limit, u8 iw, u8 ir)
 {
+    int seg = 0; /* XXX */
     struct amd_iommu *iommu;
 
     /* find target IOMMU */
-    iommu = find_iommu_from_bdf_cap(ivmd_block->header.device_id,
+    iommu = find_iommu_from_bdf_cap(seg, ivmd_block->header.device_id,
                                     ivmd_block->aux_data);
     if ( !iommu )
     {
@@ -669,7 +671,8 @@ static int __init parse_ivhd_block(const
         return -ENODEV;
     }
 
-    iommu = find_iommu_from_bdf_cap(ivhd_block->header.device_id,
+    iommu = find_iommu_from_bdf_cap(ivhd_block->pci_segment_group,
+                                    ivhd_block->header.device_id,
                                     ivhd_block->capability_offset);
     if ( !iommu )
     {

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

From xen-changelog-bounces@lists.xen.org Tue Oct 16 07:11:39 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 16 Oct 2012 07:11:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TO1J3-0005a5-At; Tue, 16 Oct 2012 07:11:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1J2-0005Zr-2o
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:12 +0000
Received: from [85.158.143.99:8417] by server-2.bemta-4.messagelabs.com id
	E2/EA-22268-F880D705; Tue, 16 Oct 2012 07:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-216.messagelabs.com!1350371469!26080718!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28758 invoked from network); 16 Oct 2012 07:11:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2012 07:11:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1Iz-0008RI-Li
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1Iy-0001Ey-Uo
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:09 +0000
Message-Id: <E1TO1Iy-0001Ey-Uo@xenbits.xen.org>
Date: Tue, 16 Oct 2012 07:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] AMD IOMMU: fix
	find_iommu_from_bdf_cap()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1350298754 -7200
# Node ID 137dfbd3190e849b3a498d8b2ea282ebbf12e77d
# Parent  e0e1350dfe9b7a6cacb1378f75d8e6536d22eb2d
AMD IOMMU: fix find_iommu_from_bdf_cap()

The arguments passed for the "cap_offset" parameter get read from 16-
bit fields, so the parameter should also have (at least) 16 bits.

While fixing this I also noticed that this was yet another case where
PCI segment information wasn't properly propagated, so a respective
first parameter gets added to the function at once.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Wei Wang <wei.wang2@amd.com>
---


diff -r e0e1350dfe9b -r 137dfbd3190e xen/drivers/passthrough/amd/iommu_acpi.c
--- a/xen/drivers/passthrough/amd/iommu_acpi.c	Thu Oct 11 15:57:00 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_acpi.c	Mon Oct 15 12:59:14 2012 +0200
@@ -86,12 +86,13 @@ static void __init add_ivrs_mapping_entr
 }
 
 static struct amd_iommu * __init find_iommu_from_bdf_cap(
-    u16 bdf, u8 cap_offset)
+    u16 seg, u16 bdf, u16 cap_offset)
 {
     struct amd_iommu *iommu;
 
     for_each_amd_iommu ( iommu )
-        if ( (iommu->bdf == bdf) && (iommu->cap_offset == cap_offset) )
+        if ( (iommu->seg == seg) && (iommu->bdf == bdf) &&
+             (iommu->cap_offset == cap_offset) )
             return iommu;
 
     return NULL;
@@ -319,10 +320,11 @@ static int __init parse_ivmd_device_iomm
     const struct acpi_ivrs_memory *ivmd_block,
     unsigned long base, unsigned long limit, u8 iw, u8 ir)
 {
+    int seg = 0; /* XXX */
     struct amd_iommu *iommu;
 
     /* find target IOMMU */
-    iommu = find_iommu_from_bdf_cap(ivmd_block->header.device_id,
+    iommu = find_iommu_from_bdf_cap(seg, ivmd_block->header.device_id,
                                     ivmd_block->aux_data);
     if ( !iommu )
     {
@@ -669,7 +671,8 @@ static int __init parse_ivhd_block(const
         return -ENODEV;
     }
 
-    iommu = find_iommu_from_bdf_cap(ivhd_block->header.device_id,
+    iommu = find_iommu_from_bdf_cap(ivhd_block->pci_segment_group,
+                                    ivhd_block->header.device_id,
                                     ivhd_block->capability_offset);
     if ( !iommu )
     {

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

From xen-changelog-bounces@lists.xen.org Tue Oct 16 07:11:40 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 16 Oct 2012 07:11:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TO1J6-0005ai-Lk; Tue, 16 Oct 2012 07:11:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1J5-0005aP-75
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:15 +0000
Received: from [85.158.139.211:7212] by server-10.bemta-5.messagelabs.com id
	97/DA-01025-2980D705; Tue, 16 Oct 2012 07:11:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-206.messagelabs.com!1350371472!22434657!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7280 invoked from network); 16 Oct 2012 07:11:13 -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;
	16 Oct 2012 07:11:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1J2-0008Ra-Hp
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1J2-0001GT-AV
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:12 +0000
Message-Id: <E1TO1J2-0001GT-AV@xenbits.xen.org>
Date: Tue, 16 Oct 2012 07:11:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: Add versions of
	rcu_lock_*_domain without IS_PRIV
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1350316304 -3600
# Node ID c1c549c4fe9ebdc460cbf51e296edad157b6e518
# Parent  37bb894121c7e0d7661656656a6e0749b41f2298
xen: Add versions of rcu_lock_*_domain without IS_PRIV

These functions will be used to avoid duplication of IS_PRIV calls
that will be introduced in XSM hooks. This also fixes a build error
with XSM enabled introduced by 25925:d1c3375c3f11 which depends on
this patch.

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


diff -r 37bb894121c7 -r c1c549c4fe9e xen/common/domain.c
--- a/xen/common/domain.c	Mon Oct 15 17:41:39 2012 +0200
+++ b/xen/common/domain.c	Mon Oct 15 16:51:44 2012 +0100
@@ -420,6 +420,13 @@ struct domain *rcu_lock_domain_by_id(dom
     return d;
 }
 
+struct domain *rcu_lock_domain_by_any_id(domid_t dom)
+{
+    if ( dom == DOMID_SELF )
+        return rcu_lock_current_domain();
+    return rcu_lock_domain_by_id(dom);
+}
+
 int rcu_lock_target_domain_by_id(domid_t dom, struct domain **d)
 {
     if ( dom == DOMID_SELF )
@@ -454,6 +461,20 @@ int rcu_lock_remote_target_domain_by_id(
     return 0;
 }
 
+int rcu_lock_remote_domain_by_id(domid_t dom, struct domain **d)
+{
+    if ( (*d = rcu_lock_domain_by_id(dom)) == NULL )
+        return -ESRCH;
+
+    if ( *d == current->domain )
+    {
+        rcu_unlock_domain(*d);
+        return -EPERM;
+    }
+
+    return 0;
+}
+
 int domain_kill(struct domain *d)
 {
     int rc = 0;
diff -r 37bb894121c7 -r c1c549c4fe9e xen/include/xen/sched.h
--- a/xen/include/xen/sched.h	Mon Oct 15 17:41:39 2012 +0200
+++ b/xen/include/xen/sched.h	Mon Oct 15 16:51:44 2012 +0100
@@ -447,6 +447,11 @@ struct domain *domain_create(
 struct domain *rcu_lock_domain_by_id(domid_t dom);
 
 /*
+ * As above function, but resolves DOMID_SELF to current domain
+ */
+struct domain *rcu_lock_domain_by_any_id(domid_t dom);
+
+/*
  * As above function, but accounts for current domain context:
  *  - Translates target DOMID_SELF into caller's domain id; and
  *  - Checks that caller has permission to act on the target domain.
@@ -460,6 +465,12 @@ int rcu_lock_target_domain_by_id(domid_t
  */
 int rcu_lock_remote_target_domain_by_id(domid_t dom, struct domain **d);
 
+/*
+ * As rcu_lock_domain_by_id(), but will fail EPERM or ESRCH rather than resolve
+ * to local domain.
+ */
+int rcu_lock_remote_domain_by_id(domid_t dom, struct domain **d);
+
 /* Finish a RCU critical region started by rcu_lock_domain_by_id(). */
 static inline void rcu_unlock_domain(struct domain *d)
 {

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

From xen-changelog-bounces@lists.xen.org Tue Oct 16 07:11:40 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 16 Oct 2012 07:11:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TO1J6-0005ai-Lk; Tue, 16 Oct 2012 07:11:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1J5-0005aP-75
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:15 +0000
Received: from [85.158.139.211:7212] by server-10.bemta-5.messagelabs.com id
	97/DA-01025-2980D705; Tue, 16 Oct 2012 07:11:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-206.messagelabs.com!1350371472!22434657!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7280 invoked from network); 16 Oct 2012 07:11:13 -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;
	16 Oct 2012 07:11:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1J2-0008Ra-Hp
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1J2-0001GT-AV
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:12 +0000
Message-Id: <E1TO1J2-0001GT-AV@xenbits.xen.org>
Date: Tue, 16 Oct 2012 07:11:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: Add versions of
	rcu_lock_*_domain without IS_PRIV
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1350316304 -3600
# Node ID c1c549c4fe9ebdc460cbf51e296edad157b6e518
# Parent  37bb894121c7e0d7661656656a6e0749b41f2298
xen: Add versions of rcu_lock_*_domain without IS_PRIV

These functions will be used to avoid duplication of IS_PRIV calls
that will be introduced in XSM hooks. This also fixes a build error
with XSM enabled introduced by 25925:d1c3375c3f11 which depends on
this patch.

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


diff -r 37bb894121c7 -r c1c549c4fe9e xen/common/domain.c
--- a/xen/common/domain.c	Mon Oct 15 17:41:39 2012 +0200
+++ b/xen/common/domain.c	Mon Oct 15 16:51:44 2012 +0100
@@ -420,6 +420,13 @@ struct domain *rcu_lock_domain_by_id(dom
     return d;
 }
 
+struct domain *rcu_lock_domain_by_any_id(domid_t dom)
+{
+    if ( dom == DOMID_SELF )
+        return rcu_lock_current_domain();
+    return rcu_lock_domain_by_id(dom);
+}
+
 int rcu_lock_target_domain_by_id(domid_t dom, struct domain **d)
 {
     if ( dom == DOMID_SELF )
@@ -454,6 +461,20 @@ int rcu_lock_remote_target_domain_by_id(
     return 0;
 }
 
+int rcu_lock_remote_domain_by_id(domid_t dom, struct domain **d)
+{
+    if ( (*d = rcu_lock_domain_by_id(dom)) == NULL )
+        return -ESRCH;
+
+    if ( *d == current->domain )
+    {
+        rcu_unlock_domain(*d);
+        return -EPERM;
+    }
+
+    return 0;
+}
+
 int domain_kill(struct domain *d)
 {
     int rc = 0;
diff -r 37bb894121c7 -r c1c549c4fe9e xen/include/xen/sched.h
--- a/xen/include/xen/sched.h	Mon Oct 15 17:41:39 2012 +0200
+++ b/xen/include/xen/sched.h	Mon Oct 15 16:51:44 2012 +0100
@@ -447,6 +447,11 @@ struct domain *domain_create(
 struct domain *rcu_lock_domain_by_id(domid_t dom);
 
 /*
+ * As above function, but resolves DOMID_SELF to current domain
+ */
+struct domain *rcu_lock_domain_by_any_id(domid_t dom);
+
+/*
  * As above function, but accounts for current domain context:
  *  - Translates target DOMID_SELF into caller's domain id; and
  *  - Checks that caller has permission to act on the target domain.
@@ -460,6 +465,12 @@ int rcu_lock_target_domain_by_id(domid_t
  */
 int rcu_lock_remote_target_domain_by_id(domid_t dom, struct domain **d);
 
+/*
+ * As rcu_lock_domain_by_id(), but will fail EPERM or ESRCH rather than resolve
+ * to local domain.
+ */
+int rcu_lock_remote_domain_by_id(domid_t dom, struct domain **d);
+
 /* Finish a RCU critical region started by rcu_lock_domain_by_id(). */
 static inline void rcu_unlock_domain(struct domain *d)
 {

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

From xen-changelog-bounces@lists.xen.org Tue Oct 16 07:11:40 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 16 Oct 2012 07:11:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TO1J6-0005ad-J1; Tue, 16 Oct 2012 07:11:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1J4-0005aK-KX
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:14 +0000
Received: from [85.158.137.99:30344] by server-7.bemta-3.messagelabs.com id
	B0/7E-06991-1980D705; Tue, 16 Oct 2012 07:11:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-217.messagelabs.com!1350371471!16365711!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5043 invoked from network); 16 Oct 2012 07:11:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2012 07:11:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1J1-0008RU-CG
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1J1-0001Fx-88
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:11 +0000
Message-Id: <E1TO1J1-0001Fx-88@xenbits.xen.org>
Date: Tue, 16 Oct 2012 07:11:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] VT-d: drop bogus checks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1350315572 -7200
# Node ID 2e8a6c8fa89cfc0e2630f1088726e7c4805bc0c1
# Parent  177fdda0be568ccdb62697b64aa64ee20bc55bee
VT-d: drop bogus checks

There were a number of cases where an "iommu" retrieved got passed to
another function before being NULL-checked. While this by itself was
not a problem as the called function did the checks, it is confusing to
the reader and redundant in several cases (particularly with NULL-
checking the return value of iommu_ir_ctrl()). Drop the redundant
checks (also ones where the sole caller of a function did the checking
already), and at once make the three similar functions proper inline
instead of extern ones (they were prototyped in the wrong header file
anyway, so would have needed touching sooner or later).

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


diff -r 177fdda0be56 -r 2e8a6c8fa89c xen/drivers/passthrough/vtd/intremap.c
--- a/xen/drivers/passthrough/vtd/intremap.c	Mon Oct 15 16:38:11 2012 +0100
+++ b/xen/drivers/passthrough/vtd/intremap.c	Mon Oct 15 17:39:32 2012 +0200
@@ -217,13 +217,6 @@ static int remap_entry_to_ioapic_rte(
     unsigned long flags;
     struct ir_ctrl *ir_ctrl = iommu_ir_ctrl(iommu);
 
-    if ( ir_ctrl == NULL )
-    {
-        dprintk(XENLOG_ERR VTDPREFIX,
-                "remap_entry_to_ioapic_rte: ir_ctl is not ready\n");
-        return -EFAULT;
-    }
-
     if ( index < 0 || index > IREMAP_ENTRY_NR - 1 )
     {
         dprintk(XENLOG_ERR VTDPREFIX,
@@ -358,8 +351,7 @@ unsigned int io_apic_read_remap_rte(
     struct iommu *iommu = ioapic_to_iommu(IO_APIC_ID(apic));
     struct ir_ctrl *ir_ctrl = iommu_ir_ctrl(iommu);
 
-    if ( !iommu || !ir_ctrl || ir_ctrl->iremap_maddr == 0 ||
-        (ir_ctrl->iremap_num == 0) ||
+    if ( !ir_ctrl || !ir_ctrl->iremap_maddr || !ir_ctrl->iremap_num ||
         ( (index = apic_pin_2_ir_idx[apic][ioapic_pin]) < 0 ) )
         return __io_apic_read(apic, reg);
 
@@ -385,7 +377,7 @@ void io_apic_write_remap_rte(
     struct ir_ctrl *ir_ctrl = iommu_ir_ctrl(iommu);
     int saved_mask;
 
-    if ( !iommu || !ir_ctrl || ir_ctrl->iremap_maddr == 0 )
+    if ( !ir_ctrl || !ir_ctrl->iremap_maddr )
     {
         __io_apic_write(apic, reg, value);
         return;
@@ -475,13 +467,6 @@ static int remap_entry_to_msi_msg(
     unsigned long flags;
     struct ir_ctrl *ir_ctrl = iommu_ir_ctrl(iommu);
 
-    if ( ir_ctrl == NULL )
-    {
-        dprintk(XENLOG_ERR VTDPREFIX,
-                "remap_entry_to_msi_msg: ir_ctl == NULL");
-        return -EFAULT;
-    }
-
     remap_rte = (struct msi_msg_remap_entry *) msg;
     index = (remap_rte->address_lo.index_15 << 15) |
              remap_rte->address_lo.index_0_14;
@@ -644,7 +629,7 @@ void msi_msg_read_remap_rte(
     iommu = drhd->iommu;
 
     ir_ctrl = iommu_ir_ctrl(iommu);
-    if ( !iommu || !ir_ctrl || ir_ctrl->iremap_maddr == 0 )
+    if ( !ir_ctrl || !ir_ctrl->iremap_maddr )
         return;
 
     remap_entry_to_msi_msg(iommu, msg);
@@ -663,7 +648,7 @@ void msi_msg_write_remap_rte(
     iommu = drhd->iommu;
 
     ir_ctrl = iommu_ir_ctrl(iommu);
-    if ( !iommu || !ir_ctrl || ir_ctrl->iremap_maddr == 0 )
+    if ( !ir_ctrl || !ir_ctrl->iremap_maddr )
         return;
 
     msi_msg_to_remap_entry(iommu, pdev, msi_desc, msg);
diff -r 177fdda0be56 -r 2e8a6c8fa89c xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Mon Oct 15 16:38:11 2012 +0100
+++ b/xen/drivers/passthrough/vtd/iommu.c	Mon Oct 15 17:39:32 2012 +0200
@@ -153,21 +153,6 @@ static void __init free_intel_iommu(stru
     xfree(intel);
 }
 
-struct qi_ctrl *iommu_qi_ctrl(struct iommu *iommu)
-{
-    return iommu ? &iommu->intel->qi_ctrl : NULL;
-}
-
-struct ir_ctrl *iommu_ir_ctrl(struct iommu *iommu)
-{
-    return iommu ? &iommu->intel->ir_ctrl : NULL;
-}
-
-struct iommu_flush *iommu_get_flush(struct iommu *iommu)
-{
-    return iommu ? &iommu->intel->flush : NULL;
-}
-
 static int iommus_incoherent;
 static void __iommu_flush_cache(void *addr, unsigned int size)
 {
diff -r 177fdda0be56 -r 2e8a6c8fa89c xen/drivers/passthrough/vtd/iommu.h
--- a/xen/drivers/passthrough/vtd/iommu.h	Mon Oct 15 16:38:11 2012 +0100
+++ b/xen/drivers/passthrough/vtd/iommu.h	Mon Oct 15 17:39:32 2012 +0200
@@ -20,7 +20,7 @@
 #ifndef _INTEL_IOMMU_H_
 #define _INTEL_IOMMU_H_
 
-#include <xen/types.h>
+#include <xen/iommu.h>
 
 /*
  * Intel IOMMU register specification per version 1.0 public spec.
@@ -510,6 +510,21 @@ struct intel_iommu {
     struct acpi_drhd_unit *drhd;
 };
 
+static inline struct qi_ctrl *iommu_qi_ctrl(struct iommu *iommu)
+{
+    return iommu ? &iommu->intel->qi_ctrl : NULL;
+}
+
+static inline struct ir_ctrl *iommu_ir_ctrl(struct iommu *iommu)
+{
+    return iommu ? &iommu->intel->ir_ctrl : NULL;
+}
+
+static inline struct iommu_flush *iommu_get_flush(struct iommu *iommu)
+{
+    return iommu ? &iommu->intel->flush : NULL;
+}
+
 #define INTEL_IOMMU_DEBUG(fmt, args...) \
     do  \
     {   \
diff -r 177fdda0be56 -r 2e8a6c8fa89c xen/drivers/passthrough/vtd/utils.c
--- a/xen/drivers/passthrough/vtd/utils.c	Mon Oct 15 16:38:11 2012 +0100
+++ b/xen/drivers/passthrough/vtd/utils.c	Mon Oct 15 17:39:32 2012 +0200
@@ -267,8 +267,7 @@ static void dump_iommu_info(unsigned cha
         {
             iommu = ioapic_to_iommu(mp_ioapics[apic].mpc_apicid);
             ir_ctrl = iommu_ir_ctrl(iommu);
-            if ( !iommu || !ir_ctrl || ir_ctrl->iremap_maddr == 0 ||
-                ir_ctrl->iremap_num == 0 )
+            if ( !ir_ctrl || !ir_ctrl->iremap_maddr || !ir_ctrl->iremap_num )
                 continue;
 
             printk( "\nRedirection table of IOAPIC %x:\n", apic);
diff -r 177fdda0be56 -r 2e8a6c8fa89c xen/include/xen/iommu.h
--- a/xen/include/xen/iommu.h	Mon Oct 15 16:38:11 2012 +0100
+++ b/xen/include/xen/iommu.h	Mon Oct 15 17:39:32 2012 +0200
@@ -106,9 +106,6 @@ struct msi_desc;
 struct msi_msg;
 void msi_msg_read_remap_rte(struct msi_desc *msi_desc, struct msi_msg *msg);
 void msi_msg_write_remap_rte(struct msi_desc *msi_desc, struct msi_msg *msg);
-struct qi_ctrl *iommu_qi_ctrl(struct iommu *iommu);
-struct ir_ctrl *iommu_ir_ctrl(struct iommu *iommu);
-struct iommu_flush *iommu_get_flush(struct iommu *iommu);
 void hvm_dpci_isairq_eoi(struct domain *d, unsigned int isairq);
 struct hvm_irq_dpci *domain_get_irq_dpci(const struct domain *);
 void free_hvm_irq_dpci(struct hvm_irq_dpci *dpci);

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

From xen-changelog-bounces@lists.xen.org Tue Oct 16 07:11:40 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 16 Oct 2012 07:11:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TO1J6-0005ad-J1; Tue, 16 Oct 2012 07:11:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1J4-0005aK-KX
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:14 +0000
Received: from [85.158.137.99:30344] by server-7.bemta-3.messagelabs.com id
	B0/7E-06991-1980D705; Tue, 16 Oct 2012 07:11:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-217.messagelabs.com!1350371471!16365711!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5043 invoked from network); 16 Oct 2012 07:11:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2012 07:11:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1J1-0008RU-CG
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1J1-0001Fx-88
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:11 +0000
Message-Id: <E1TO1J1-0001Fx-88@xenbits.xen.org>
Date: Tue, 16 Oct 2012 07:11:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] VT-d: drop bogus checks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1350315572 -7200
# Node ID 2e8a6c8fa89cfc0e2630f1088726e7c4805bc0c1
# Parent  177fdda0be568ccdb62697b64aa64ee20bc55bee
VT-d: drop bogus checks

There were a number of cases where an "iommu" retrieved got passed to
another function before being NULL-checked. While this by itself was
not a problem as the called function did the checks, it is confusing to
the reader and redundant in several cases (particularly with NULL-
checking the return value of iommu_ir_ctrl()). Drop the redundant
checks (also ones where the sole caller of a function did the checking
already), and at once make the three similar functions proper inline
instead of extern ones (they were prototyped in the wrong header file
anyway, so would have needed touching sooner or later).

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


diff -r 177fdda0be56 -r 2e8a6c8fa89c xen/drivers/passthrough/vtd/intremap.c
--- a/xen/drivers/passthrough/vtd/intremap.c	Mon Oct 15 16:38:11 2012 +0100
+++ b/xen/drivers/passthrough/vtd/intremap.c	Mon Oct 15 17:39:32 2012 +0200
@@ -217,13 +217,6 @@ static int remap_entry_to_ioapic_rte(
     unsigned long flags;
     struct ir_ctrl *ir_ctrl = iommu_ir_ctrl(iommu);
 
-    if ( ir_ctrl == NULL )
-    {
-        dprintk(XENLOG_ERR VTDPREFIX,
-                "remap_entry_to_ioapic_rte: ir_ctl is not ready\n");
-        return -EFAULT;
-    }
-
     if ( index < 0 || index > IREMAP_ENTRY_NR - 1 )
     {
         dprintk(XENLOG_ERR VTDPREFIX,
@@ -358,8 +351,7 @@ unsigned int io_apic_read_remap_rte(
     struct iommu *iommu = ioapic_to_iommu(IO_APIC_ID(apic));
     struct ir_ctrl *ir_ctrl = iommu_ir_ctrl(iommu);
 
-    if ( !iommu || !ir_ctrl || ir_ctrl->iremap_maddr == 0 ||
-        (ir_ctrl->iremap_num == 0) ||
+    if ( !ir_ctrl || !ir_ctrl->iremap_maddr || !ir_ctrl->iremap_num ||
         ( (index = apic_pin_2_ir_idx[apic][ioapic_pin]) < 0 ) )
         return __io_apic_read(apic, reg);
 
@@ -385,7 +377,7 @@ void io_apic_write_remap_rte(
     struct ir_ctrl *ir_ctrl = iommu_ir_ctrl(iommu);
     int saved_mask;
 
-    if ( !iommu || !ir_ctrl || ir_ctrl->iremap_maddr == 0 )
+    if ( !ir_ctrl || !ir_ctrl->iremap_maddr )
     {
         __io_apic_write(apic, reg, value);
         return;
@@ -475,13 +467,6 @@ static int remap_entry_to_msi_msg(
     unsigned long flags;
     struct ir_ctrl *ir_ctrl = iommu_ir_ctrl(iommu);
 
-    if ( ir_ctrl == NULL )
-    {
-        dprintk(XENLOG_ERR VTDPREFIX,
-                "remap_entry_to_msi_msg: ir_ctl == NULL");
-        return -EFAULT;
-    }
-
     remap_rte = (struct msi_msg_remap_entry *) msg;
     index = (remap_rte->address_lo.index_15 << 15) |
              remap_rte->address_lo.index_0_14;
@@ -644,7 +629,7 @@ void msi_msg_read_remap_rte(
     iommu = drhd->iommu;
 
     ir_ctrl = iommu_ir_ctrl(iommu);
-    if ( !iommu || !ir_ctrl || ir_ctrl->iremap_maddr == 0 )
+    if ( !ir_ctrl || !ir_ctrl->iremap_maddr )
         return;
 
     remap_entry_to_msi_msg(iommu, msg);
@@ -663,7 +648,7 @@ void msi_msg_write_remap_rte(
     iommu = drhd->iommu;
 
     ir_ctrl = iommu_ir_ctrl(iommu);
-    if ( !iommu || !ir_ctrl || ir_ctrl->iremap_maddr == 0 )
+    if ( !ir_ctrl || !ir_ctrl->iremap_maddr )
         return;
 
     msi_msg_to_remap_entry(iommu, pdev, msi_desc, msg);
diff -r 177fdda0be56 -r 2e8a6c8fa89c xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Mon Oct 15 16:38:11 2012 +0100
+++ b/xen/drivers/passthrough/vtd/iommu.c	Mon Oct 15 17:39:32 2012 +0200
@@ -153,21 +153,6 @@ static void __init free_intel_iommu(stru
     xfree(intel);
 }
 
-struct qi_ctrl *iommu_qi_ctrl(struct iommu *iommu)
-{
-    return iommu ? &iommu->intel->qi_ctrl : NULL;
-}
-
-struct ir_ctrl *iommu_ir_ctrl(struct iommu *iommu)
-{
-    return iommu ? &iommu->intel->ir_ctrl : NULL;
-}
-
-struct iommu_flush *iommu_get_flush(struct iommu *iommu)
-{
-    return iommu ? &iommu->intel->flush : NULL;
-}
-
 static int iommus_incoherent;
 static void __iommu_flush_cache(void *addr, unsigned int size)
 {
diff -r 177fdda0be56 -r 2e8a6c8fa89c xen/drivers/passthrough/vtd/iommu.h
--- a/xen/drivers/passthrough/vtd/iommu.h	Mon Oct 15 16:38:11 2012 +0100
+++ b/xen/drivers/passthrough/vtd/iommu.h	Mon Oct 15 17:39:32 2012 +0200
@@ -20,7 +20,7 @@
 #ifndef _INTEL_IOMMU_H_
 #define _INTEL_IOMMU_H_
 
-#include <xen/types.h>
+#include <xen/iommu.h>
 
 /*
  * Intel IOMMU register specification per version 1.0 public spec.
@@ -510,6 +510,21 @@ struct intel_iommu {
     struct acpi_drhd_unit *drhd;
 };
 
+static inline struct qi_ctrl *iommu_qi_ctrl(struct iommu *iommu)
+{
+    return iommu ? &iommu->intel->qi_ctrl : NULL;
+}
+
+static inline struct ir_ctrl *iommu_ir_ctrl(struct iommu *iommu)
+{
+    return iommu ? &iommu->intel->ir_ctrl : NULL;
+}
+
+static inline struct iommu_flush *iommu_get_flush(struct iommu *iommu)
+{
+    return iommu ? &iommu->intel->flush : NULL;
+}
+
 #define INTEL_IOMMU_DEBUG(fmt, args...) \
     do  \
     {   \
diff -r 177fdda0be56 -r 2e8a6c8fa89c xen/drivers/passthrough/vtd/utils.c
--- a/xen/drivers/passthrough/vtd/utils.c	Mon Oct 15 16:38:11 2012 +0100
+++ b/xen/drivers/passthrough/vtd/utils.c	Mon Oct 15 17:39:32 2012 +0200
@@ -267,8 +267,7 @@ static void dump_iommu_info(unsigned cha
         {
             iommu = ioapic_to_iommu(mp_ioapics[apic].mpc_apicid);
             ir_ctrl = iommu_ir_ctrl(iommu);
-            if ( !iommu || !ir_ctrl || ir_ctrl->iremap_maddr == 0 ||
-                ir_ctrl->iremap_num == 0 )
+            if ( !ir_ctrl || !ir_ctrl->iremap_maddr || !ir_ctrl->iremap_num )
                 continue;
 
             printk( "\nRedirection table of IOAPIC %x:\n", apic);
diff -r 177fdda0be56 -r 2e8a6c8fa89c xen/include/xen/iommu.h
--- a/xen/include/xen/iommu.h	Mon Oct 15 16:38:11 2012 +0100
+++ b/xen/include/xen/iommu.h	Mon Oct 15 17:39:32 2012 +0200
@@ -106,9 +106,6 @@ struct msi_desc;
 struct msi_msg;
 void msi_msg_read_remap_rte(struct msi_desc *msi_desc, struct msi_msg *msg);
 void msi_msg_write_remap_rte(struct msi_desc *msi_desc, struct msi_msg *msg);
-struct qi_ctrl *iommu_qi_ctrl(struct iommu *iommu);
-struct ir_ctrl *iommu_ir_ctrl(struct iommu *iommu);
-struct iommu_flush *iommu_get_flush(struct iommu *iommu);
 void hvm_dpci_isairq_eoi(struct domain *d, unsigned int isairq);
 struct hvm_irq_dpci *domain_get_irq_dpci(const struct domain *);
 void free_hvm_irq_dpci(struct hvm_irq_dpci *dpci);

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

From xen-changelog-bounces@lists.xen.org Tue Oct 16 07:11:44 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 16 Oct 2012 07: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 1TO1JC-0005bk-SE; Tue, 16 Oct 2012 07:11:22 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1JB-0005ab-4f
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1350371473!8717306!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5579 invoked from network); 16 Oct 2012 07: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;
	16 Oct 2012 07:11:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1J1-0008RX-WE
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1J1-0001GE-PE
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:11 +0000
Message-Id: <E1TO1J1-0001GE-PE@xenbits.xen.org>
Date: Tue, 16 Oct 2012 07:11:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] IOMMU: remove vendor specific bits
	from generic 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 1350315699 -7200
# Node ID 37bb894121c7e0d7661656656a6e0749b41f2298
# Parent  2e8a6c8fa89cfc0e2630f1088726e7c4805bc0c1
IOMMU: remove vendor specific bits from generic code

- names of functions used independent of vendor should not have vendor
  specific names
- vendor specific declarations should not live inn generic headers
- other vendor specific items should not be used in generic code

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


diff -r 2e8a6c8fa89c -r 37bb894121c7 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Mon Oct 15 17:39:32 2012 +0200
+++ b/xen/arch/x86/domctl.c	Mon Oct 15 17:41:39 2012 +0200
@@ -776,7 +776,7 @@ long arch_do_domctl(
         if ( iommu_enabled )
         {
             spin_lock(&pcidevs_lock);
-            ret = pt_irq_create_bind_vtd(d, bind);
+            ret = pt_irq_create_bind(d, bind);
             spin_unlock(&pcidevs_lock);
         }
         if ( ret < 0 )
@@ -806,7 +806,7 @@ long arch_do_domctl(
         if ( iommu_enabled )
         {
             spin_lock(&pcidevs_lock);
-            ret = pt_irq_destroy_bind_vtd(d, bind);
+            ret = pt_irq_destroy_bind(d, bind);
             spin_unlock(&pcidevs_lock);
         }
         if ( ret < 0 )
diff -r 2e8a6c8fa89c -r 37bb894121c7 xen/drivers/passthrough/io.c
--- a/xen/drivers/passthrough/io.c	Mon Oct 15 17:39:32 2012 +0200
+++ b/xen/drivers/passthrough/io.c	Mon Oct 15 17:41:39 2012 +0200
@@ -95,7 +95,7 @@ void free_hvm_irq_dpci(struct hvm_irq_dp
     xfree(dpci);
 }
 
-int pt_irq_create_bind_vtd(
+int pt_irq_create_bind(
     struct domain *d, xen_domctl_bind_pt_irq_t *pt_irq_bind)
 {
     struct hvm_irq_dpci *hvm_irq_dpci = NULL;
@@ -277,14 +277,14 @@ int pt_irq_create_bind_vtd(
         spin_unlock(&d->event_lock);
 
         if ( iommu_verbose )
-            dprintk(VTDPREFIX,
+            dprintk(XENLOG_G_INFO,
                     "d%d: bind: m_gsi=%u g_gsi=%u device=%u intx=%u\n",
                     d->domain_id, pirq, guest_gsi, device, intx);
     }
     return 0;
 }
 
-int pt_irq_destroy_bind_vtd(
+int pt_irq_destroy_bind(
     struct domain *d, xen_domctl_bind_pt_irq_t *pt_irq_bind)
 {
     struct hvm_irq_dpci *hvm_irq_dpci = NULL;
@@ -302,7 +302,7 @@ int pt_irq_destroy_bind_vtd(
     link = hvm_pci_intx_link(device, intx);
 
     if ( iommu_verbose )
-        dprintk(VTDPREFIX,
+        dprintk(XENLOG_G_INFO,
                 "d%d: unbind: m_gsi=%u g_gsi=%u device=%u intx=%u\n",
                 d->domain_id, machine_gsi, guest_gsi, device, intx);
 
@@ -360,7 +360,7 @@ int pt_irq_destroy_bind_vtd(
     spin_unlock(&d->event_lock);
 
     if ( iommu_verbose )
-        dprintk(VTDPREFIX,
+        dprintk(XENLOG_G_INFO,
                 "d%d unmap: m_irq=%u device=%u intx=%u\n",
                 d->domain_id, machine_gsi, device, intx);
 
diff -r 2e8a6c8fa89c -r 37bb894121c7 xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c	Mon Oct 15 17:39:32 2012 +0200
+++ b/xen/drivers/passthrough/iommu.c	Mon Oct 15 17:41:39 2012 +0200
@@ -364,7 +364,7 @@ int deassign_device(struct domain *d, u1
 
     if ( pdev->domain != d )
     {
-        dprintk(XENLOG_ERR VTDPREFIX,
+        dprintk(XENLOG_G_ERR,
                 "d%d: deassign a device not owned\n", d->domain_id);
         return -EINVAL;
     }
@@ -372,8 +372,8 @@ int deassign_device(struct domain *d, u1
     ret = hd->platform_ops->reassign_device(d, dom0, seg, bus, devfn);
     if ( ret )
     {
-        dprintk(XENLOG_ERR VTDPREFIX,
-                "d%d: Deassign device (%04x:%02x:%02x.%u) failed!\n",
+        dprintk(XENLOG_G_ERR,
+                "d%d: deassign device (%04x:%02x:%02x.%u) failed\n",
                 d->domain_id, seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
         return ret;
     }
diff -r 2e8a6c8fa89c -r 37bb894121c7 xen/drivers/passthrough/vtd/extern.h
--- a/xen/drivers/passthrough/vtd/extern.h	Mon Oct 15 17:39:32 2012 +0200
+++ b/xen/drivers/passthrough/vtd/extern.h	Mon Oct 15 17:41:39 2012 +0200
@@ -24,6 +24,8 @@
 #include "dmar.h"
 #include <xen/keyhandler.h>
 
+#define VTDPREFIX "[VT-D]"
+
 extern bool_t rwbf_quirk;
 
 void print_iommu_regs(struct acpi_drhd_unit *drhd);
@@ -79,6 +81,15 @@ int domain_context_mapping_one(struct do
 int domain_context_unmap_one(struct domain *domain, struct iommu *iommu,
                              u8 bus, u8 devfn);
 
+unsigned int io_apic_read_remap_rte(unsigned int apic, unsigned int reg);
+void io_apic_write_remap_rte(unsigned int apic,
+                             unsigned int reg, unsigned int value);
+
+struct msi_desc;
+struct msi_msg;
+void msi_msg_read_remap_rte(struct msi_desc *, struct msi_msg *);
+void msi_msg_write_remap_rte(struct msi_desc *, struct msi_msg *);
+
 int is_igd_vt_enabled_quirk(void);
 void platform_quirks_init(void);
 void vtd_ops_preamble_quirk(struct iommu* iommu);
diff -r 2e8a6c8fa89c -r 37bb894121c7 xen/drivers/passthrough/vtd/iommu.h
--- a/xen/drivers/passthrough/vtd/iommu.h	Mon Oct 15 17:39:32 2012 +0200
+++ b/xen/drivers/passthrough/vtd/iommu.h	Mon Oct 15 17:41:39 2012 +0200
@@ -510,6 +510,22 @@ struct intel_iommu {
     struct acpi_drhd_unit *drhd;
 };
 
+struct iommu {
+    struct list_head list;
+    void __iomem *reg; /* Pointer to hardware regs, virtual addr */
+    u32	index;         /* Sequence number of iommu */
+    u32 nr_pt_levels;
+    u64	cap;
+    u64	ecap;
+    spinlock_t lock; /* protect context, domain ids */
+    spinlock_t register_lock; /* protect iommu register handling */
+    u64 root_maddr; /* root entry machine address */
+    int irq;
+    struct intel_iommu *intel;
+    unsigned long *domid_bitmap;  /* domain id bitmap */
+    u16 *domid_map;               /* domain id mapping array */
+};
+
 static inline struct qi_ctrl *iommu_qi_ctrl(struct iommu *iommu)
 {
     return iommu ? &iommu->intel->qi_ctrl : NULL;
diff -r 2e8a6c8fa89c -r 37bb894121c7 xen/include/xen/iommu.h
--- a/xen/include/xen/iommu.h	Mon Oct 15 17:39:32 2012 +0200
+++ b/xen/include/xen/iommu.h	Mon Oct 15 17:41:39 2012 +0200
@@ -48,22 +48,6 @@ extern struct rangeset *mmio_ro_ranges;
 #define PAGE_MASK_4K        (((u64)-1) << PAGE_SHIFT_4K)
 #define PAGE_ALIGN_4K(addr) (((addr) + PAGE_SIZE_4K - 1) & PAGE_MASK_4K)
 
-struct iommu {
-    struct list_head list;
-    void __iomem *reg; /* Pointer to hardware regs, virtual addr */
-    u32	index;         /* Sequence number of iommu */
-    u32 nr_pt_levels;
-    u64	cap;
-    u64	ecap;
-    spinlock_t lock; /* protect context, domain ids */
-    spinlock_t register_lock; /* protect iommu register handling */
-    u64 root_maddr; /* root entry machine address */
-    int irq;
-    struct intel_iommu *intel;
-    unsigned long *domid_bitmap;  /* domain id bitmap */
-    u16 *domid_map;               /* domain id mapping array */
-};
-
 int iommu_setup(void);
 int iommu_supports_eim(void);
 int iommu_enable_x2apic_IR(void);
@@ -94,25 +78,18 @@ void pt_pci_init(void);
 struct pirq;
 int hvm_do_IRQ_dpci(struct domain *, struct pirq *);
 int dpci_ioport_intercept(ioreq_t *p);
-int pt_irq_create_bind_vtd(struct domain *d,
-                           xen_domctl_bind_pt_irq_t *pt_irq_bind);
-int pt_irq_destroy_bind_vtd(struct domain *d,
-                            xen_domctl_bind_pt_irq_t *pt_irq_bind);
-unsigned int io_apic_read_remap_rte(unsigned int apic, unsigned int reg);
-void io_apic_write_remap_rte(unsigned int apic,
-                             unsigned int reg, unsigned int value);
+int pt_irq_create_bind(struct domain *, xen_domctl_bind_pt_irq_t *);
+int pt_irq_destroy_bind(struct domain *, xen_domctl_bind_pt_irq_t *);
 
-struct msi_desc;
-struct msi_msg;
-void msi_msg_read_remap_rte(struct msi_desc *msi_desc, struct msi_msg *msg);
-void msi_msg_write_remap_rte(struct msi_desc *msi_desc, struct msi_msg *msg);
 void hvm_dpci_isairq_eoi(struct domain *d, unsigned int isairq);
 struct hvm_irq_dpci *domain_get_irq_dpci(const struct domain *);
 void free_hvm_irq_dpci(struct hvm_irq_dpci *dpci);
 bool_t pt_irq_need_timer(uint32_t flags);
 
 #define PT_IRQ_TIME_OUT MILLISECS(8)
-#define VTDPREFIX "[VT-D]"
+
+struct msi_desc;
+struct msi_msg;
 
 struct iommu_ops {
     int (*init)(struct domain *d);

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

From xen-changelog-bounces@lists.xen.org Tue Oct 16 07:11:44 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 16 Oct 2012 07: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 1TO1JC-0005bk-SE; Tue, 16 Oct 2012 07:11:22 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1JB-0005ab-4f
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1350371473!8717306!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5579 invoked from network); 16 Oct 2012 07: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;
	16 Oct 2012 07:11:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1J1-0008RX-WE
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1J1-0001GE-PE
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:11 +0000
Message-Id: <E1TO1J1-0001GE-PE@xenbits.xen.org>
Date: Tue, 16 Oct 2012 07:11:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] IOMMU: remove vendor specific bits
	from generic 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 1350315699 -7200
# Node ID 37bb894121c7e0d7661656656a6e0749b41f2298
# Parent  2e8a6c8fa89cfc0e2630f1088726e7c4805bc0c1
IOMMU: remove vendor specific bits from generic code

- names of functions used independent of vendor should not have vendor
  specific names
- vendor specific declarations should not live inn generic headers
- other vendor specific items should not be used in generic code

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


diff -r 2e8a6c8fa89c -r 37bb894121c7 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Mon Oct 15 17:39:32 2012 +0200
+++ b/xen/arch/x86/domctl.c	Mon Oct 15 17:41:39 2012 +0200
@@ -776,7 +776,7 @@ long arch_do_domctl(
         if ( iommu_enabled )
         {
             spin_lock(&pcidevs_lock);
-            ret = pt_irq_create_bind_vtd(d, bind);
+            ret = pt_irq_create_bind(d, bind);
             spin_unlock(&pcidevs_lock);
         }
         if ( ret < 0 )
@@ -806,7 +806,7 @@ long arch_do_domctl(
         if ( iommu_enabled )
         {
             spin_lock(&pcidevs_lock);
-            ret = pt_irq_destroy_bind_vtd(d, bind);
+            ret = pt_irq_destroy_bind(d, bind);
             spin_unlock(&pcidevs_lock);
         }
         if ( ret < 0 )
diff -r 2e8a6c8fa89c -r 37bb894121c7 xen/drivers/passthrough/io.c
--- a/xen/drivers/passthrough/io.c	Mon Oct 15 17:39:32 2012 +0200
+++ b/xen/drivers/passthrough/io.c	Mon Oct 15 17:41:39 2012 +0200
@@ -95,7 +95,7 @@ void free_hvm_irq_dpci(struct hvm_irq_dp
     xfree(dpci);
 }
 
-int pt_irq_create_bind_vtd(
+int pt_irq_create_bind(
     struct domain *d, xen_domctl_bind_pt_irq_t *pt_irq_bind)
 {
     struct hvm_irq_dpci *hvm_irq_dpci = NULL;
@@ -277,14 +277,14 @@ int pt_irq_create_bind_vtd(
         spin_unlock(&d->event_lock);
 
         if ( iommu_verbose )
-            dprintk(VTDPREFIX,
+            dprintk(XENLOG_G_INFO,
                     "d%d: bind: m_gsi=%u g_gsi=%u device=%u intx=%u\n",
                     d->domain_id, pirq, guest_gsi, device, intx);
     }
     return 0;
 }
 
-int pt_irq_destroy_bind_vtd(
+int pt_irq_destroy_bind(
     struct domain *d, xen_domctl_bind_pt_irq_t *pt_irq_bind)
 {
     struct hvm_irq_dpci *hvm_irq_dpci = NULL;
@@ -302,7 +302,7 @@ int pt_irq_destroy_bind_vtd(
     link = hvm_pci_intx_link(device, intx);
 
     if ( iommu_verbose )
-        dprintk(VTDPREFIX,
+        dprintk(XENLOG_G_INFO,
                 "d%d: unbind: m_gsi=%u g_gsi=%u device=%u intx=%u\n",
                 d->domain_id, machine_gsi, guest_gsi, device, intx);
 
@@ -360,7 +360,7 @@ int pt_irq_destroy_bind_vtd(
     spin_unlock(&d->event_lock);
 
     if ( iommu_verbose )
-        dprintk(VTDPREFIX,
+        dprintk(XENLOG_G_INFO,
                 "d%d unmap: m_irq=%u device=%u intx=%u\n",
                 d->domain_id, machine_gsi, device, intx);
 
diff -r 2e8a6c8fa89c -r 37bb894121c7 xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c	Mon Oct 15 17:39:32 2012 +0200
+++ b/xen/drivers/passthrough/iommu.c	Mon Oct 15 17:41:39 2012 +0200
@@ -364,7 +364,7 @@ int deassign_device(struct domain *d, u1
 
     if ( pdev->domain != d )
     {
-        dprintk(XENLOG_ERR VTDPREFIX,
+        dprintk(XENLOG_G_ERR,
                 "d%d: deassign a device not owned\n", d->domain_id);
         return -EINVAL;
     }
@@ -372,8 +372,8 @@ int deassign_device(struct domain *d, u1
     ret = hd->platform_ops->reassign_device(d, dom0, seg, bus, devfn);
     if ( ret )
     {
-        dprintk(XENLOG_ERR VTDPREFIX,
-                "d%d: Deassign device (%04x:%02x:%02x.%u) failed!\n",
+        dprintk(XENLOG_G_ERR,
+                "d%d: deassign device (%04x:%02x:%02x.%u) failed\n",
                 d->domain_id, seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
         return ret;
     }
diff -r 2e8a6c8fa89c -r 37bb894121c7 xen/drivers/passthrough/vtd/extern.h
--- a/xen/drivers/passthrough/vtd/extern.h	Mon Oct 15 17:39:32 2012 +0200
+++ b/xen/drivers/passthrough/vtd/extern.h	Mon Oct 15 17:41:39 2012 +0200
@@ -24,6 +24,8 @@
 #include "dmar.h"
 #include <xen/keyhandler.h>
 
+#define VTDPREFIX "[VT-D]"
+
 extern bool_t rwbf_quirk;
 
 void print_iommu_regs(struct acpi_drhd_unit *drhd);
@@ -79,6 +81,15 @@ int domain_context_mapping_one(struct do
 int domain_context_unmap_one(struct domain *domain, struct iommu *iommu,
                              u8 bus, u8 devfn);
 
+unsigned int io_apic_read_remap_rte(unsigned int apic, unsigned int reg);
+void io_apic_write_remap_rte(unsigned int apic,
+                             unsigned int reg, unsigned int value);
+
+struct msi_desc;
+struct msi_msg;
+void msi_msg_read_remap_rte(struct msi_desc *, struct msi_msg *);
+void msi_msg_write_remap_rte(struct msi_desc *, struct msi_msg *);
+
 int is_igd_vt_enabled_quirk(void);
 void platform_quirks_init(void);
 void vtd_ops_preamble_quirk(struct iommu* iommu);
diff -r 2e8a6c8fa89c -r 37bb894121c7 xen/drivers/passthrough/vtd/iommu.h
--- a/xen/drivers/passthrough/vtd/iommu.h	Mon Oct 15 17:39:32 2012 +0200
+++ b/xen/drivers/passthrough/vtd/iommu.h	Mon Oct 15 17:41:39 2012 +0200
@@ -510,6 +510,22 @@ struct intel_iommu {
     struct acpi_drhd_unit *drhd;
 };
 
+struct iommu {
+    struct list_head list;
+    void __iomem *reg; /* Pointer to hardware regs, virtual addr */
+    u32	index;         /* Sequence number of iommu */
+    u32 nr_pt_levels;
+    u64	cap;
+    u64	ecap;
+    spinlock_t lock; /* protect context, domain ids */
+    spinlock_t register_lock; /* protect iommu register handling */
+    u64 root_maddr; /* root entry machine address */
+    int irq;
+    struct intel_iommu *intel;
+    unsigned long *domid_bitmap;  /* domain id bitmap */
+    u16 *domid_map;               /* domain id mapping array */
+};
+
 static inline struct qi_ctrl *iommu_qi_ctrl(struct iommu *iommu)
 {
     return iommu ? &iommu->intel->qi_ctrl : NULL;
diff -r 2e8a6c8fa89c -r 37bb894121c7 xen/include/xen/iommu.h
--- a/xen/include/xen/iommu.h	Mon Oct 15 17:39:32 2012 +0200
+++ b/xen/include/xen/iommu.h	Mon Oct 15 17:41:39 2012 +0200
@@ -48,22 +48,6 @@ extern struct rangeset *mmio_ro_ranges;
 #define PAGE_MASK_4K        (((u64)-1) << PAGE_SHIFT_4K)
 #define PAGE_ALIGN_4K(addr) (((addr) + PAGE_SIZE_4K - 1) & PAGE_MASK_4K)
 
-struct iommu {
-    struct list_head list;
-    void __iomem *reg; /* Pointer to hardware regs, virtual addr */
-    u32	index;         /* Sequence number of iommu */
-    u32 nr_pt_levels;
-    u64	cap;
-    u64	ecap;
-    spinlock_t lock; /* protect context, domain ids */
-    spinlock_t register_lock; /* protect iommu register handling */
-    u64 root_maddr; /* root entry machine address */
-    int irq;
-    struct intel_iommu *intel;
-    unsigned long *domid_bitmap;  /* domain id bitmap */
-    u16 *domid_map;               /* domain id mapping array */
-};
-
 int iommu_setup(void);
 int iommu_supports_eim(void);
 int iommu_enable_x2apic_IR(void);
@@ -94,25 +78,18 @@ void pt_pci_init(void);
 struct pirq;
 int hvm_do_IRQ_dpci(struct domain *, struct pirq *);
 int dpci_ioport_intercept(ioreq_t *p);
-int pt_irq_create_bind_vtd(struct domain *d,
-                           xen_domctl_bind_pt_irq_t *pt_irq_bind);
-int pt_irq_destroy_bind_vtd(struct domain *d,
-                            xen_domctl_bind_pt_irq_t *pt_irq_bind);
-unsigned int io_apic_read_remap_rte(unsigned int apic, unsigned int reg);
-void io_apic_write_remap_rte(unsigned int apic,
-                             unsigned int reg, unsigned int value);
+int pt_irq_create_bind(struct domain *, xen_domctl_bind_pt_irq_t *);
+int pt_irq_destroy_bind(struct domain *, xen_domctl_bind_pt_irq_t *);
 
-struct msi_desc;
-struct msi_msg;
-void msi_msg_read_remap_rte(struct msi_desc *msi_desc, struct msi_msg *msg);
-void msi_msg_write_remap_rte(struct msi_desc *msi_desc, struct msi_msg *msg);
 void hvm_dpci_isairq_eoi(struct domain *d, unsigned int isairq);
 struct hvm_irq_dpci *domain_get_irq_dpci(const struct domain *);
 void free_hvm_irq_dpci(struct hvm_irq_dpci *dpci);
 bool_t pt_irq_need_timer(uint32_t flags);
 
 #define PT_IRQ_TIME_OUT MILLISECS(8)
-#define VTDPREFIX "[VT-D]"
+
+struct msi_desc;
+struct msi_msg;
 
 struct iommu_ops {
     int (*init)(struct domain *d);

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

From xen-changelog-bounces@lists.xen.org Tue Oct 16 07:11:45 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 16 Oct 2012 07:11:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TO1JC-0005bf-Oz; Tue, 16 Oct 2012 07:11:22 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1JA-0005aW-QE
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1350371473!11060726!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21337 invoked from network); 16 Oct 2012 07:11:14 -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 2012 07:11:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1J1-0008RR-0J
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1J0-0001Fi-MF
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:10 +0000
Message-Id: <E1TO1J0-0001Fi-MF@xenbits.xen.org>
Date: Tue, 16 Oct 2012 07:11:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] More efficient TLB-flush filtering
	in alloc_heap_pages().
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1350315491 -3600
# Node ID 177fdda0be568ccdb62697b64aa64ee20bc55bee
# Parent  14e32621dbaf5b485b134ace4558e67c4c36e1ce
More efficient TLB-flush filtering in alloc_heap_pages().

Rather than per-cpu filtering for every page in a super-page
allocation, simply remember the most recent TLB timestamp across all
allocated pages, and filter on that, just once, at the end of the
function.

For large-CPU systems, doing 2MB allocations during domain creation,
this cuts down the domain creation time *massively*.

TODO: It may make sense to move the filtering out into some callers,
such as memory.c:populate_physmap() and
memory.c:increase_reservation(), so that the filtering can be moved
outside their loops, too.

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


diff -r 14e32621dbaf -r 177fdda0be56 xen/common/page_alloc.c
--- a/xen/common/page_alloc.c	Mon Oct 15 15:04:51 2012 +0200
+++ b/xen/common/page_alloc.c	Mon Oct 15 16:38:11 2012 +0100
@@ -414,9 +414,10 @@ static struct page_info *alloc_heap_page
     unsigned int first_node, i, j, zone = 0, nodemask_retry = 0;
     unsigned int node = (uint8_t)((memflags >> _MEMF_node) - 1);
     unsigned long request = 1UL << order;
-    cpumask_t mask;
     struct page_info *pg;
     nodemask_t nodemask = (d != NULL ) ? d->node_affinity : node_online_map;
+    bool_t need_tlbflush = 0;
+    uint32_t tlbflush_timestamp = 0;
 
     if ( node == NUMA_NO_NODE )
     {
@@ -530,22 +531,19 @@ static struct page_info *alloc_heap_page
     if ( d != NULL )
         d->last_alloc_node = node;
 
-    cpumask_clear(&mask);
-
     for ( i = 0; i < (1 << order); i++ )
     {
         /* Reference count must continuously be zero for free pages. */
         BUG_ON(pg[i].count_info != PGC_state_free);
         pg[i].count_info = PGC_state_inuse;
 
-        if ( pg[i].u.free.need_tlbflush )
+        if ( pg[i].u.free.need_tlbflush &&
+             (pg[i].tlbflush_timestamp <= tlbflush_current_time()) &&
+             (!need_tlbflush ||
+              (pg[i].tlbflush_timestamp > tlbflush_timestamp)) )
         {
-            /* Add in extra CPUs that need flushing because of this page. */
-            static cpumask_t extra_cpus_mask;
-
-            cpumask_andnot(&extra_cpus_mask, &cpu_online_map, &mask);
-            tlbflush_filter(extra_cpus_mask, pg[i].tlbflush_timestamp);
-            cpumask_or(&mask, &mask, &extra_cpus_mask);
+            need_tlbflush = 1;
+            tlbflush_timestamp = pg[i].tlbflush_timestamp;
         }
 
         /* Initialise fields which have other uses for free pages. */
@@ -555,10 +553,15 @@ static struct page_info *alloc_heap_page
 
     spin_unlock(&heap_lock);
 
-    if ( unlikely(!cpumask_empty(&mask)) )
+    if ( need_tlbflush )
     {
-        perfc_incr(need_flush_tlb_flush);
-        flush_tlb_mask(&mask);
+        cpumask_t mask = cpu_online_map;
+        tlbflush_filter(mask, tlbflush_timestamp);
+        if ( !cpumask_empty(&mask) )
+        {
+            perfc_incr(need_flush_tlb_flush);
+            flush_tlb_mask(&mask);
+        }
     }
 
     return pg;

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

From xen-changelog-bounces@lists.xen.org Tue Oct 16 07:11:45 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 16 Oct 2012 07:11:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TO1JC-0005bf-Oz; Tue, 16 Oct 2012 07:11:22 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1JA-0005aW-QE
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1350371473!11060726!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21337 invoked from network); 16 Oct 2012 07:11:14 -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 2012 07:11:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1J1-0008RR-0J
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TO1J0-0001Fi-MF
	for xen-changelog@lists.xensource.com; Tue, 16 Oct 2012 07:11:10 +0000
Message-Id: <E1TO1J0-0001Fi-MF@xenbits.xen.org>
Date: Tue, 16 Oct 2012 07:11:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] More efficient TLB-flush filtering
	in alloc_heap_pages().
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1350315491 -3600
# Node ID 177fdda0be568ccdb62697b64aa64ee20bc55bee
# Parent  14e32621dbaf5b485b134ace4558e67c4c36e1ce
More efficient TLB-flush filtering in alloc_heap_pages().

Rather than per-cpu filtering for every page in a super-page
allocation, simply remember the most recent TLB timestamp across all
allocated pages, and filter on that, just once, at the end of the
function.

For large-CPU systems, doing 2MB allocations during domain creation,
this cuts down the domain creation time *massively*.

TODO: It may make sense to move the filtering out into some callers,
such as memory.c:populate_physmap() and
memory.c:increase_reservation(), so that the filtering can be moved
outside their loops, too.

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


diff -r 14e32621dbaf -r 177fdda0be56 xen/common/page_alloc.c
--- a/xen/common/page_alloc.c	Mon Oct 15 15:04:51 2012 +0200
+++ b/xen/common/page_alloc.c	Mon Oct 15 16:38:11 2012 +0100
@@ -414,9 +414,10 @@ static struct page_info *alloc_heap_page
     unsigned int first_node, i, j, zone = 0, nodemask_retry = 0;
     unsigned int node = (uint8_t)((memflags >> _MEMF_node) - 1);
     unsigned long request = 1UL << order;
-    cpumask_t mask;
     struct page_info *pg;
     nodemask_t nodemask = (d != NULL ) ? d->node_affinity : node_online_map;
+    bool_t need_tlbflush = 0;
+    uint32_t tlbflush_timestamp = 0;
 
     if ( node == NUMA_NO_NODE )
     {
@@ -530,22 +531,19 @@ static struct page_info *alloc_heap_page
     if ( d != NULL )
         d->last_alloc_node = node;
 
-    cpumask_clear(&mask);
-
     for ( i = 0; i < (1 << order); i++ )
     {
         /* Reference count must continuously be zero for free pages. */
         BUG_ON(pg[i].count_info != PGC_state_free);
         pg[i].count_info = PGC_state_inuse;
 
-        if ( pg[i].u.free.need_tlbflush )
+        if ( pg[i].u.free.need_tlbflush &&
+             (pg[i].tlbflush_timestamp <= tlbflush_current_time()) &&
+             (!need_tlbflush ||
+              (pg[i].tlbflush_timestamp > tlbflush_timestamp)) )
         {
-            /* Add in extra CPUs that need flushing because of this page. */
-            static cpumask_t extra_cpus_mask;
-
-            cpumask_andnot(&extra_cpus_mask, &cpu_online_map, &mask);
-            tlbflush_filter(extra_cpus_mask, pg[i].tlbflush_timestamp);
-            cpumask_or(&mask, &mask, &extra_cpus_mask);
+            need_tlbflush = 1;
+            tlbflush_timestamp = pg[i].tlbflush_timestamp;
         }
 
         /* Initialise fields which have other uses for free pages. */
@@ -555,10 +553,15 @@ static struct page_info *alloc_heap_page
 
     spin_unlock(&heap_lock);
 
-    if ( unlikely(!cpumask_empty(&mask)) )
+    if ( need_tlbflush )
     {
-        perfc_incr(need_flush_tlb_flush);
-        flush_tlb_mask(&mask);
+        cpumask_t mask = cpu_online_map;
+        tlbflush_filter(mask, tlbflush_timestamp);
+        if ( !cpumask_empty(&mask) )
+        {
+            perfc_incr(need_flush_tlb_flush);
+            flush_tlb_mask(&mask);
+        }
     }
 
     return pg;

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

From xen-changelog-bounces@lists.xen.org Wed Oct 17 09:11:13 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Oct 2012 09:11:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TOPeg-0002en-7x; Wed, 17 Oct 2012 09:11:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TOPee-0002eG-Hm
	for xen-changelog@lists.xensource.com; Wed, 17 Oct 2012 09:11:08 +0000
Received: from [85.158.137.99:4511] by server-2.bemta-3.messagelabs.com id
	8D/06-00604-B267E705; Wed, 17 Oct 2012 09:11:07 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-217.messagelabs.com!1350465065!21928993!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5930 invoked from network); 17 Oct 2012 09:11:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Oct 2012 09:11:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TOPea-0002ol-U6
	for xen-changelog@lists.xensource.com; Wed, 17 Oct 2012 09:11:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TOPea-0001kL-Mg
	for xen-changelog@lists.xensource.com; Wed, 17 Oct 2012 09:11:04 +0000
Message-Id: <E1TOPea-0001kL-Mg@xenbits.xen.org>
Date: Wed, 17 Oct 2012 09:11:04 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] fix hypercall fallback code for
	very old hypervisors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1350464319 -7200
# Node ID c5d77641c7380dfe628491656d8a2001d08cd390
# Parent  9db2ee23611eb88e3f29fc177ded2fca2bcb89b9
fix hypercall fallback code for very old hypervisors

While copying the argument structures in HYPERVISOR_event_channel_op()
and HYPERVISOR_physdev_op() into the local variable is sufficiently
safe even if the actual structure is smaller than the container one,
copying back eventual output values the same way isn't: This may
collide with on-stack variables (particularly "rc") which may change
between the first and second memcpy() (i.e. the second memcpy() could
discard that change).

Move the fallback code into out-of-line functions, and handle all of
the operations known by this old a hypervisor individually: Some don't
require copying back anything at all, and for the rest use the
individual argument structures' sizes rather than the container's.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 9db2ee23611e -r c5d77641c738 drivers/pci/msi-xen.c
--- a/drivers/pci/msi-xen.c	Wed Oct 17 10:41:46 2012 +0200
+++ b/drivers/pci/msi-xen.c	Wed Oct 17 10:58:39 2012 +0200
@@ -15,6 +15,7 @@
 #include <linux/pci.h>
 #include <linux/proc_fs.h>
 
+#include <xen/interface/physdev.h>
 #include <xen/evtchn.h>
 
 #include <asm/errno.h>
diff -r 9db2ee23611e -r c5d77641c738 drivers/xen/core/Makefile
--- a/drivers/xen/core/Makefile	Wed Oct 17 10:41:46 2012 +0200
+++ b/drivers/xen/core/Makefile	Wed Oct 17 10:58:39 2012 +0200
@@ -2,7 +2,7 @@
 # Makefile for the linux kernel.
 #
 
-obj-y := evtchn.o gnttab.o features.o reboot.o machine_reboot.o
+obj-y := evtchn.o gnttab.o features.o reboot.o machine_reboot.o fallback.o
 
 obj-$(CONFIG_PCI)		+= pci.o
 obj-$(CONFIG_XEN_PRIVILEGED_GUEST) += firmware.o
diff -r 9db2ee23611e -r c5d77641c738 drivers/xen/core/fallback.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/drivers/xen/core/fallback.c	Wed Oct 17 10:58:39 2012 +0200
@@ -0,0 +1,84 @@
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <asm/bug.h>
+#include <asm/hypervisor.h>
+
+#if CONFIG_XEN_COMPAT <= 0x030002
+
+#include <xen/interface/event_channel.h>
+#include <xen/interface/physdev.h>
+
+int HYPERVISOR_event_channel_op_compat(int cmd, void *arg)
+{
+	struct evtchn_op op;
+	int rc;
+
+	op.cmd = cmd;
+	memcpy(&op.u, arg, sizeof(op.u));
+	rc = _hypercall1(int, event_channel_op_compat, &op);
+
+	switch (cmd) {
+	case EVTCHNOP_close:
+	case EVTCHNOP_send:
+	case EVTCHNOP_bind_vcpu:
+	case EVTCHNOP_unmask:
+		/* no output */
+		break;
+
+#define COPY_BACK(eop) \
+	case EVTCHNOP_##eop: \
+		memcpy(arg, &op.u.eop, sizeof(op.u.eop)); \
+		break
+
+	COPY_BACK(bind_interdomain);
+	COPY_BACK(bind_virq);
+	COPY_BACK(bind_pirq);
+	COPY_BACK(status);
+	COPY_BACK(alloc_unbound);
+	COPY_BACK(bind_ipi);
+#undef COPY_BACK
+
+	default:
+		WARN_ON(rc != -ENOSYS);
+		break;
+	}
+
+	return rc;
+}
+
+int HYPERVISOR_physdev_op_compat(int cmd, void *arg)
+{
+	struct physdev_op op;
+	int rc;
+
+	op.cmd = cmd;
+	memcpy(&op.u, arg, sizeof(op.u));
+	rc = _hypercall1(int, physdev_op_compat, &op);
+
+	switch (cmd) {
+	case PHYSDEVOP_IRQ_UNMASK_NOTIFY:
+	case PHYSDEVOP_set_iopl:
+	case PHYSDEVOP_set_iobitmap:
+	case PHYSDEVOP_apic_write:
+		/* no output */
+		break;
+
+#define COPY_BACK(pop, fld) \
+	case PHYSDEVOP_##pop: \
+		memcpy(arg, &op.u.fld, sizeof(op.u.fld)); \
+		break
+
+	COPY_BACK(irq_status_query, irq_status_query);
+	COPY_BACK(apic_read, apic_op);
+	COPY_BACK(ASSIGN_VECTOR, irq_op);
+#undef COPY_BACK
+
+	default:
+		WARN_ON(rc != -ENOSYS);
+		break;
+	}
+
+	return rc;
+}
+
+#endif /* CONFIG_XEN_COMPAT <= 0x030002 */
diff -r 9db2ee23611e -r c5d77641c738 include/asm-i386/mach-xen/asm/hypercall.h
--- a/include/asm-i386/mach-xen/asm/hypercall.h	Wed Oct 17 10:41:46 2012 +0200
+++ b/include/asm-i386/mach-xen/asm/hypercall.h	Wed Oct 17 10:58:39 2012 +0200
@@ -33,7 +33,6 @@
 #ifndef __HYPERCALL_H__
 #define __HYPERCALL_H__
 
-#include <linux/string.h> /* memcpy() */
 #include <linux/stringify.h>
 
 #ifndef __HYPERVISOR_H__
@@ -128,6 +127,11 @@
 	__res;							\
 })
 
+#if CONFIG_XEN_COMPAT <= 0x030002
+int __must_check HYPERVISOR_event_channel_op_compat(int, void *);
+int __must_check HYPERVISOR_physdev_op_compat(int, void *);
+#endif
+
 static inline int __must_check
 HYPERVISOR_set_trap_table(
 	const trap_info_t *table)
@@ -267,13 +271,8 @@ HYPERVISOR_event_channel_op(
 	int rc = _hypercall2(int, event_channel_op, cmd, arg);
 
 #if CONFIG_XEN_COMPAT <= 0x030002
-	if (unlikely(rc == -ENOSYS)) {
-		struct evtchn_op op;
-		op.cmd = cmd;
-		memcpy(&op.u, arg, sizeof(op.u));
-		rc = _hypercall1(int, event_channel_op_compat, &op);
-		memcpy(arg, &op.u, sizeof(op.u));
-	}
+	if (unlikely(rc == -ENOSYS))
+		rc = HYPERVISOR_event_channel_op_compat(cmd, arg);
 #endif
 
 	return rc;
@@ -300,13 +299,8 @@ HYPERVISOR_physdev_op(
 	int rc = _hypercall2(int, physdev_op, cmd, arg);
 
 #if CONFIG_XEN_COMPAT <= 0x030002
-	if (unlikely(rc == -ENOSYS)) {
-		struct physdev_op op;
-		op.cmd = cmd;
-		memcpy(&op.u, arg, sizeof(op.u));
-		rc = _hypercall1(int, physdev_op_compat, &op);
-		memcpy(arg, &op.u, sizeof(op.u));
-	}
+	if (unlikely(rc == -ENOSYS))
+		rc = HYPERVISOR_physdev_op_compat(cmd, arg);
 #endif
 
 	return rc;
diff -r 9db2ee23611e -r c5d77641c738 include/asm-i386/mach-xen/asm/hypervisor.h
--- a/include/asm-i386/mach-xen/asm/hypervisor.h	Wed Oct 17 10:41:46 2012 +0200
+++ b/include/asm-i386/mach-xen/asm/hypervisor.h	Wed Oct 17 10:58:39 2012 +0200
@@ -39,8 +39,6 @@
 #include <linux/errno.h>
 #include <xen/interface/xen.h>
 #include <xen/interface/platform.h>
-#include <xen/interface/event_channel.h>
-#include <xen/interface/physdev.h>
 #include <xen/interface/sched.h>
 #include <xen/interface/nmi.h>
 #include <xen/interface/tmem.h>

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

From xen-changelog-bounces@lists.xen.org Wed Oct 17 09:11:13 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Oct 2012 09:11:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TOPeg-0002en-7x; Wed, 17 Oct 2012 09:11:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TOPee-0002eG-Hm
	for xen-changelog@lists.xensource.com; Wed, 17 Oct 2012 09:11:08 +0000
Received: from [85.158.137.99:4511] by server-2.bemta-3.messagelabs.com id
	8D/06-00604-B267E705; Wed, 17 Oct 2012 09:11:07 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-217.messagelabs.com!1350465065!21928993!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5930 invoked from network); 17 Oct 2012 09:11:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Oct 2012 09:11:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TOPea-0002ol-U6
	for xen-changelog@lists.xensource.com; Wed, 17 Oct 2012 09:11:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TOPea-0001kL-Mg
	for xen-changelog@lists.xensource.com; Wed, 17 Oct 2012 09:11:04 +0000
Message-Id: <E1TOPea-0001kL-Mg@xenbits.xen.org>
Date: Wed, 17 Oct 2012 09:11:04 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] fix hypercall fallback code for
	very old hypervisors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1350464319 -7200
# Node ID c5d77641c7380dfe628491656d8a2001d08cd390
# Parent  9db2ee23611eb88e3f29fc177ded2fca2bcb89b9
fix hypercall fallback code for very old hypervisors

While copying the argument structures in HYPERVISOR_event_channel_op()
and HYPERVISOR_physdev_op() into the local variable is sufficiently
safe even if the actual structure is smaller than the container one,
copying back eventual output values the same way isn't: This may
collide with on-stack variables (particularly "rc") which may change
between the first and second memcpy() (i.e. the second memcpy() could
discard that change).

Move the fallback code into out-of-line functions, and handle all of
the operations known by this old a hypervisor individually: Some don't
require copying back anything at all, and for the rest use the
individual argument structures' sizes rather than the container's.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 9db2ee23611e -r c5d77641c738 drivers/pci/msi-xen.c
--- a/drivers/pci/msi-xen.c	Wed Oct 17 10:41:46 2012 +0200
+++ b/drivers/pci/msi-xen.c	Wed Oct 17 10:58:39 2012 +0200
@@ -15,6 +15,7 @@
 #include <linux/pci.h>
 #include <linux/proc_fs.h>
 
+#include <xen/interface/physdev.h>
 #include <xen/evtchn.h>
 
 #include <asm/errno.h>
diff -r 9db2ee23611e -r c5d77641c738 drivers/xen/core/Makefile
--- a/drivers/xen/core/Makefile	Wed Oct 17 10:41:46 2012 +0200
+++ b/drivers/xen/core/Makefile	Wed Oct 17 10:58:39 2012 +0200
@@ -2,7 +2,7 @@
 # Makefile for the linux kernel.
 #
 
-obj-y := evtchn.o gnttab.o features.o reboot.o machine_reboot.o
+obj-y := evtchn.o gnttab.o features.o reboot.o machine_reboot.o fallback.o
 
 obj-$(CONFIG_PCI)		+= pci.o
 obj-$(CONFIG_XEN_PRIVILEGED_GUEST) += firmware.o
diff -r 9db2ee23611e -r c5d77641c738 drivers/xen/core/fallback.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/drivers/xen/core/fallback.c	Wed Oct 17 10:58:39 2012 +0200
@@ -0,0 +1,84 @@
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <asm/bug.h>
+#include <asm/hypervisor.h>
+
+#if CONFIG_XEN_COMPAT <= 0x030002
+
+#include <xen/interface/event_channel.h>
+#include <xen/interface/physdev.h>
+
+int HYPERVISOR_event_channel_op_compat(int cmd, void *arg)
+{
+	struct evtchn_op op;
+	int rc;
+
+	op.cmd = cmd;
+	memcpy(&op.u, arg, sizeof(op.u));
+	rc = _hypercall1(int, event_channel_op_compat, &op);
+
+	switch (cmd) {
+	case EVTCHNOP_close:
+	case EVTCHNOP_send:
+	case EVTCHNOP_bind_vcpu:
+	case EVTCHNOP_unmask:
+		/* no output */
+		break;
+
+#define COPY_BACK(eop) \
+	case EVTCHNOP_##eop: \
+		memcpy(arg, &op.u.eop, sizeof(op.u.eop)); \
+		break
+
+	COPY_BACK(bind_interdomain);
+	COPY_BACK(bind_virq);
+	COPY_BACK(bind_pirq);
+	COPY_BACK(status);
+	COPY_BACK(alloc_unbound);
+	COPY_BACK(bind_ipi);
+#undef COPY_BACK
+
+	default:
+		WARN_ON(rc != -ENOSYS);
+		break;
+	}
+
+	return rc;
+}
+
+int HYPERVISOR_physdev_op_compat(int cmd, void *arg)
+{
+	struct physdev_op op;
+	int rc;
+
+	op.cmd = cmd;
+	memcpy(&op.u, arg, sizeof(op.u));
+	rc = _hypercall1(int, physdev_op_compat, &op);
+
+	switch (cmd) {
+	case PHYSDEVOP_IRQ_UNMASK_NOTIFY:
+	case PHYSDEVOP_set_iopl:
+	case PHYSDEVOP_set_iobitmap:
+	case PHYSDEVOP_apic_write:
+		/* no output */
+		break;
+
+#define COPY_BACK(pop, fld) \
+	case PHYSDEVOP_##pop: \
+		memcpy(arg, &op.u.fld, sizeof(op.u.fld)); \
+		break
+
+	COPY_BACK(irq_status_query, irq_status_query);
+	COPY_BACK(apic_read, apic_op);
+	COPY_BACK(ASSIGN_VECTOR, irq_op);
+#undef COPY_BACK
+
+	default:
+		WARN_ON(rc != -ENOSYS);
+		break;
+	}
+
+	return rc;
+}
+
+#endif /* CONFIG_XEN_COMPAT <= 0x030002 */
diff -r 9db2ee23611e -r c5d77641c738 include/asm-i386/mach-xen/asm/hypercall.h
--- a/include/asm-i386/mach-xen/asm/hypercall.h	Wed Oct 17 10:41:46 2012 +0200
+++ b/include/asm-i386/mach-xen/asm/hypercall.h	Wed Oct 17 10:58:39 2012 +0200
@@ -33,7 +33,6 @@
 #ifndef __HYPERCALL_H__
 #define __HYPERCALL_H__
 
-#include <linux/string.h> /* memcpy() */
 #include <linux/stringify.h>
 
 #ifndef __HYPERVISOR_H__
@@ -128,6 +127,11 @@
 	__res;							\
 })
 
+#if CONFIG_XEN_COMPAT <= 0x030002
+int __must_check HYPERVISOR_event_channel_op_compat(int, void *);
+int __must_check HYPERVISOR_physdev_op_compat(int, void *);
+#endif
+
 static inline int __must_check
 HYPERVISOR_set_trap_table(
 	const trap_info_t *table)
@@ -267,13 +271,8 @@ HYPERVISOR_event_channel_op(
 	int rc = _hypercall2(int, event_channel_op, cmd, arg);
 
 #if CONFIG_XEN_COMPAT <= 0x030002
-	if (unlikely(rc == -ENOSYS)) {
-		struct evtchn_op op;
-		op.cmd = cmd;
-		memcpy(&op.u, arg, sizeof(op.u));
-		rc = _hypercall1(int, event_channel_op_compat, &op);
-		memcpy(arg, &op.u, sizeof(op.u));
-	}
+	if (unlikely(rc == -ENOSYS))
+		rc = HYPERVISOR_event_channel_op_compat(cmd, arg);
 #endif
 
 	return rc;
@@ -300,13 +299,8 @@ HYPERVISOR_physdev_op(
 	int rc = _hypercall2(int, physdev_op, cmd, arg);
 
 #if CONFIG_XEN_COMPAT <= 0x030002
-	if (unlikely(rc == -ENOSYS)) {
-		struct physdev_op op;
-		op.cmd = cmd;
-		memcpy(&op.u, arg, sizeof(op.u));
-		rc = _hypercall1(int, physdev_op_compat, &op);
-		memcpy(arg, &op.u, sizeof(op.u));
-	}
+	if (unlikely(rc == -ENOSYS))
+		rc = HYPERVISOR_physdev_op_compat(cmd, arg);
 #endif
 
 	return rc;
diff -r 9db2ee23611e -r c5d77641c738 include/asm-i386/mach-xen/asm/hypervisor.h
--- a/include/asm-i386/mach-xen/asm/hypervisor.h	Wed Oct 17 10:41:46 2012 +0200
+++ b/include/asm-i386/mach-xen/asm/hypervisor.h	Wed Oct 17 10:58:39 2012 +0200
@@ -39,8 +39,6 @@
 #include <linux/errno.h>
 #include <xen/interface/xen.h>
 #include <xen/interface/platform.h>
-#include <xen/interface/event_channel.h>
-#include <xen/interface/physdev.h>
 #include <xen/interface/sched.h>
 #include <xen/interface/nmi.h>
 #include <xen/interface/tmem.h>

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

From xen-changelog-bounces@lists.xen.org Wed Oct 17 09:11:14 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Oct 2012 09: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 1TOPeh-0002f2-Ap; Wed, 17 Oct 2012 09:11:11 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TOPef-0002eV-Hs
	for xen-changelog@lists.xensource.com; Wed, 17 Oct 2012 09:11:09 +0000
Received: from [85.158.143.35:33462] by server-2.bemta-4.messagelabs.com id
	E5/BA-22268-C267E705; Wed, 17 Oct 2012 09:11:08 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-21.messagelabs.com!1350465065!15376234!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32485 invoked from network); 17 Oct 2012 09:11:06 -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;
	17 Oct 2012 09:11:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TOPea-0002oi-KW
	for xen-changelog@lists.xensource.com; Wed, 17 Oct 2012 09:11:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TOPea-0001k6-8Z
	for xen-changelog@lists.xensource.com; Wed, 17 Oct 2012 09:11:04 +0000
Message-Id: <E1TOPea-0001k6-8Z@xenbits.xen.org>
Date: Wed, 17 Oct 2012 09:11: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] xenbus: fix overflow check in
	xenbus_dev_write()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1350463306 -7200
# Node ID 9db2ee23611eb88e3f29fc177ded2fca2bcb89b9
# Parent  480fbb0fc4b54af94c5682fadb737c9df8af57ef
xenbus: fix overflow check in xenbus_dev_write()

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 480fbb0fc4b5 -r 9db2ee23611e drivers/xen/xenbus/xenbus_dev.c
--- a/drivers/xen/xenbus/xenbus_dev.c	Thu Oct 04 11:13:04 2012 +0200
+++ b/drivers/xen/xenbus/xenbus_dev.c	Wed Oct 17 10:41:46 2012 +0200
@@ -239,7 +239,7 @@ static ssize_t xenbus_dev_write(struct f
 	if (!is_xenstored_ready())
 		return -ENODEV;
 
-	if ((len + u->len) > sizeof(u->u.buffer)) {
+	if (len > sizeof(u->u.buffer) - u->len) {
 		rc = -EINVAL;
 		goto out;
 	}

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

From xen-changelog-bounces@lists.xen.org Wed Oct 17 09:11:14 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Oct 2012 09: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 1TOPeh-0002f2-Ap; Wed, 17 Oct 2012 09:11:11 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TOPef-0002eV-Hs
	for xen-changelog@lists.xensource.com; Wed, 17 Oct 2012 09:11:09 +0000
Received: from [85.158.143.35:33462] by server-2.bemta-4.messagelabs.com id
	E5/BA-22268-C267E705; Wed, 17 Oct 2012 09:11:08 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-21.messagelabs.com!1350465065!15376234!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32485 invoked from network); 17 Oct 2012 09:11:06 -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;
	17 Oct 2012 09:11:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TOPea-0002oi-KW
	for xen-changelog@lists.xensource.com; Wed, 17 Oct 2012 09:11:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TOPea-0001k6-8Z
	for xen-changelog@lists.xensource.com; Wed, 17 Oct 2012 09:11:04 +0000
Message-Id: <E1TOPea-0001k6-8Z@xenbits.xen.org>
Date: Wed, 17 Oct 2012 09:11: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] xenbus: fix overflow check in
	xenbus_dev_write()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1350463306 -7200
# Node ID 9db2ee23611eb88e3f29fc177ded2fca2bcb89b9
# Parent  480fbb0fc4b54af94c5682fadb737c9df8af57ef
xenbus: fix overflow check in xenbus_dev_write()

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 480fbb0fc4b5 -r 9db2ee23611e drivers/xen/xenbus/xenbus_dev.c
--- a/drivers/xen/xenbus/xenbus_dev.c	Thu Oct 04 11:13:04 2012 +0200
+++ b/drivers/xen/xenbus/xenbus_dev.c	Wed Oct 17 10:41:46 2012 +0200
@@ -239,7 +239,7 @@ static ssize_t xenbus_dev_write(struct f
 	if (!is_xenstored_ready())
 		return -ENODEV;
 
-	if ((len + u->len) > sizeof(u->u.buffer)) {
+	if (len > sizeof(u->u.buffer) - u->len) {
 		rc = -EINVAL;
 		goto out;
 	}

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 09:44:14 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 09: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 1TP97h-0007Hp-E5; Fri, 19 Oct 2012 09:44:09 +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 1TP97g-0007Hk-AG
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 09:44:08 +0000
Received: from [85.158.138.51:20432] by server-3.bemta-3.messagelabs.com id
	5F/0F-09368-7E021805; Fri, 19 Oct 2012 09:44:07 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-174.messagelabs.com!1350639845!33300619!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4931 invoked from network); 19 Oct 2012 09:44:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 09:44:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TP97c-000561-Nj
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 09:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TP97c-00050i-8u
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 09:44:04 +0000
Message-Id: <E1TP97c-00050i-8u@xenbits.xen.org>
Date: Fri, 19 Oct 2012 09:44:03 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] x86-64: add missing change for
	1199:c5d77641c738
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1350639402 -7200
# Node ID bd485861bc4206d51400333919787d7f6a79aa3c
# Parent  c5d77641c7380dfe628491656d8a2001d08cd390
x86-64: add missing change for 1199:c5d77641c738

The change to include/asm-i386/mach-xen/asm/hypercall.h needs to be
mirrored to include/asm-x86_64/mach-xen/asm/hypercall.h.

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


diff -r c5d77641c738 -r bd485861bc42 include/asm-x86_64/mach-xen/asm/hypercall.h
--- a/include/asm-x86_64/mach-xen/asm/hypercall.h	Wed Oct 17 10:58:39 2012 +0200
+++ b/include/asm-x86_64/mach-xen/asm/hypercall.h	Fri Oct 19 11:36:42 2012 +0200
@@ -37,7 +37,6 @@
 #ifndef __HYPERCALL_H__
 #define __HYPERCALL_H__
 
-#include <linux/string.h> /* memcpy() */
 #include <linux/stringify.h>
 #include <xen/interface/arch-x86/xen-mca.h>
 
@@ -135,6 +134,11 @@
 	__res;							\
 })
 
+#if CONFIG_XEN_COMPAT <= 0x030002
+int __must_check HYPERVISOR_event_channel_op_compat(int, void *);
+int __must_check HYPERVISOR_physdev_op_compat(int, void *);
+#endif
+
 static inline int __must_check
 HYPERVISOR_set_trap_table(
 	const trap_info_t *table)
@@ -272,13 +276,8 @@ HYPERVISOR_event_channel_op(
 	int rc = _hypercall2(int, event_channel_op, cmd, arg);
 
 #if CONFIG_XEN_COMPAT <= 0x030002
-	if (unlikely(rc == -ENOSYS)) {
-		struct evtchn_op op;
-		op.cmd = cmd;
-		memcpy(&op.u, arg, sizeof(op.u));
-		rc = _hypercall1(int, event_channel_op_compat, &op);
-		memcpy(arg, &op.u, sizeof(op.u));
-	}
+	if (unlikely(rc == -ENOSYS))
+		rc = HYPERVISOR_event_channel_op_compat(cmd, arg);
 #endif
 
 	return rc;
@@ -305,13 +304,8 @@ HYPERVISOR_physdev_op(
 	int rc = _hypercall2(int, physdev_op, cmd, arg);
 
 #if CONFIG_XEN_COMPAT <= 0x030002
-	if (unlikely(rc == -ENOSYS)) {
-		struct physdev_op op;
-		op.cmd = cmd;
-		memcpy(&op.u, arg, sizeof(op.u));
-		rc = _hypercall1(int, physdev_op_compat, &op);
-		memcpy(arg, &op.u, sizeof(op.u));
-	}
+	if (unlikely(rc == -ENOSYS))
+		rc = HYPERVISOR_physdev_op_compat(cmd, arg);
 #endif
 
 	return rc;

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 09:44:14 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 09: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 1TP97h-0007Hp-E5; Fri, 19 Oct 2012 09:44:09 +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 1TP97g-0007Hk-AG
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 09:44:08 +0000
Received: from [85.158.138.51:20432] by server-3.bemta-3.messagelabs.com id
	5F/0F-09368-7E021805; Fri, 19 Oct 2012 09:44:07 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-174.messagelabs.com!1350639845!33300619!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4931 invoked from network); 19 Oct 2012 09:44:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 09:44:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TP97c-000561-Nj
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 09:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TP97c-00050i-8u
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 09:44:04 +0000
Message-Id: <E1TP97c-00050i-8u@xenbits.xen.org>
Date: Fri, 19 Oct 2012 09:44:03 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] x86-64: add missing change for
	1199:c5d77641c738
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1350639402 -7200
# Node ID bd485861bc4206d51400333919787d7f6a79aa3c
# Parent  c5d77641c7380dfe628491656d8a2001d08cd390
x86-64: add missing change for 1199:c5d77641c738

The change to include/asm-i386/mach-xen/asm/hypercall.h needs to be
mirrored to include/asm-x86_64/mach-xen/asm/hypercall.h.

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


diff -r c5d77641c738 -r bd485861bc42 include/asm-x86_64/mach-xen/asm/hypercall.h
--- a/include/asm-x86_64/mach-xen/asm/hypercall.h	Wed Oct 17 10:58:39 2012 +0200
+++ b/include/asm-x86_64/mach-xen/asm/hypercall.h	Fri Oct 19 11:36:42 2012 +0200
@@ -37,7 +37,6 @@
 #ifndef __HYPERCALL_H__
 #define __HYPERCALL_H__
 
-#include <linux/string.h> /* memcpy() */
 #include <linux/stringify.h>
 #include <xen/interface/arch-x86/xen-mca.h>
 
@@ -135,6 +134,11 @@
 	__res;							\
 })
 
+#if CONFIG_XEN_COMPAT <= 0x030002
+int __must_check HYPERVISOR_event_channel_op_compat(int, void *);
+int __must_check HYPERVISOR_physdev_op_compat(int, void *);
+#endif
+
 static inline int __must_check
 HYPERVISOR_set_trap_table(
 	const trap_info_t *table)
@@ -272,13 +276,8 @@ HYPERVISOR_event_channel_op(
 	int rc = _hypercall2(int, event_channel_op, cmd, arg);
 
 #if CONFIG_XEN_COMPAT <= 0x030002
-	if (unlikely(rc == -ENOSYS)) {
-		struct evtchn_op op;
-		op.cmd = cmd;
-		memcpy(&op.u, arg, sizeof(op.u));
-		rc = _hypercall1(int, event_channel_op_compat, &op);
-		memcpy(arg, &op.u, sizeof(op.u));
-	}
+	if (unlikely(rc == -ENOSYS))
+		rc = HYPERVISOR_event_channel_op_compat(cmd, arg);
 #endif
 
 	return rc;
@@ -305,13 +304,8 @@ HYPERVISOR_physdev_op(
 	int rc = _hypercall2(int, physdev_op, cmd, arg);
 
 #if CONFIG_XEN_COMPAT <= 0x030002
-	if (unlikely(rc == -ENOSYS)) {
-		struct physdev_op op;
-		op.cmd = cmd;
-		memcpy(&op.u, arg, sizeof(op.u));
-		rc = _hypercall1(int, physdev_op_compat, &op);
-		memcpy(arg, &op.u, sizeof(op.u));
-	}
+	if (unlikely(rc == -ENOSYS))
+		rc = HYPERVISOR_physdev_op_compat(cmd, arg);
 #endif
 
 	return rc;

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 16:00:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 16:00:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPEze-0002G5-F7; Fri, 19 Oct 2012 16:00:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPEzd-0002Fv-9M
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 16:00:13 +0000
Received: from [85.158.138.51:24320] by server-8.bemta-3.messagelabs.com id
	51/12-10525-C0971805; Fri, 19 Oct 2012 16:00:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1350662410!34958709!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4519 invoked from network); 19 Oct 2012 16:00:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 16:00:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPEzZ-0001F9-TE
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 16:00:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPEzY-0006HB-5r
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 16:00:09 +0000
Message-Id: <E1TPEzY-0006HB-5r@xenbits.xen.org>
Date: Fri, 19 Oct 2012 16:00:07 +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] PV passthru: assign SR-IOV
	virtual functions to separate virtual slots
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Laszlo Ersek <lersek@redhat.com>
# Date 1350661572 -7200
# Node ID 0dbf07f0bdbfea42ba2f43a7e4786394ece74515
# Parent  bd485861bc4206d51400333919787d7f6a79aa3c
PV passthru: assign SR-IOV virtual functions to separate virtual slots

VFs are reported as single-function devices in PCI_HEADER_TYPE, which
causes pci_scan_slot() in the PV domU to skip all VFs beyond #0 in the
pciback-provided slot. Avoid this by assigning each VF to a separate
virtual slot.

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r bd485861bc42 -r 0dbf07f0bdbf drivers/xen/pciback/vpci.c
--- a/drivers/xen/pciback/vpci.c	Fri Oct 19 11:36:42 2012 +0200
+++ b/drivers/xen/pciback/vpci.c	Fri Oct 19 17:46:12 2012 +0200
@@ -89,9 +89,15 @@ int pciback_add_pci_dev(struct pciback_d
 
 	spin_lock_irqsave(&vpci_dev->lock, flags);
 
-	/* Keep multi-function devices together on the virtual PCI bus */
-	for (slot = 0; slot < PCI_SLOT_MAX; slot++) {
-		if (!list_empty(&vpci_dev->dev_list[slot])) {
+	/*
+	 * Keep multi-function devices together on the virtual PCI bus, except
+	 * virtual functions.
+	 */
+	if (!dev->is_virtfn) {
+		for (slot = 0; slot < PCI_SLOT_MAX; slot++) {
+			if (list_empty(&vpci_dev->dev_list[slot]))
+				continue;
+
 			t = list_entry(list_first(&vpci_dev->dev_list[slot]),
 				       struct pci_dev_entry, list);
 
@@ -116,7 +122,7 @@ int pciback_add_pci_dev(struct pciback_d
 			       pci_name(dev), slot);
 			list_add_tail(&dev_entry->list,
 				      &vpci_dev->dev_list[slot]);
-			func = PCI_FUNC(dev->devfn);
+			func = dev->is_virtfn ? 0 : PCI_FUNC(dev->devfn);
 			goto unlock;
 		}
 	}

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 16:00:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 16:00:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPEze-0002G5-F7; Fri, 19 Oct 2012 16:00:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPEzd-0002Fv-9M
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 16:00:13 +0000
Received: from [85.158.138.51:24320] by server-8.bemta-3.messagelabs.com id
	51/12-10525-C0971805; Fri, 19 Oct 2012 16:00:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1350662410!34958709!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4519 invoked from network); 19 Oct 2012 16:00:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 16:00:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPEzZ-0001F9-TE
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 16:00:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPEzY-0006HB-5r
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 16:00:09 +0000
Message-Id: <E1TPEzY-0006HB-5r@xenbits.xen.org>
Date: Fri, 19 Oct 2012 16:00:07 +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] PV passthru: assign SR-IOV
	virtual functions to separate virtual slots
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Laszlo Ersek <lersek@redhat.com>
# Date 1350661572 -7200
# Node ID 0dbf07f0bdbfea42ba2f43a7e4786394ece74515
# Parent  bd485861bc4206d51400333919787d7f6a79aa3c
PV passthru: assign SR-IOV virtual functions to separate virtual slots

VFs are reported as single-function devices in PCI_HEADER_TYPE, which
causes pci_scan_slot() in the PV domU to skip all VFs beyond #0 in the
pciback-provided slot. Avoid this by assigning each VF to a separate
virtual slot.

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r bd485861bc42 -r 0dbf07f0bdbf drivers/xen/pciback/vpci.c
--- a/drivers/xen/pciback/vpci.c	Fri Oct 19 11:36:42 2012 +0200
+++ b/drivers/xen/pciback/vpci.c	Fri Oct 19 17:46:12 2012 +0200
@@ -89,9 +89,15 @@ int pciback_add_pci_dev(struct pciback_d
 
 	spin_lock_irqsave(&vpci_dev->lock, flags);
 
-	/* Keep multi-function devices together on the virtual PCI bus */
-	for (slot = 0; slot < PCI_SLOT_MAX; slot++) {
-		if (!list_empty(&vpci_dev->dev_list[slot])) {
+	/*
+	 * Keep multi-function devices together on the virtual PCI bus, except
+	 * virtual functions.
+	 */
+	if (!dev->is_virtfn) {
+		for (slot = 0; slot < PCI_SLOT_MAX; slot++) {
+			if (list_empty(&vpci_dev->dev_list[slot]))
+				continue;
+
 			t = list_entry(list_first(&vpci_dev->dev_list[slot]),
 				       struct pci_dev_entry, list);
 
@@ -116,7 +122,7 @@ int pciback_add_pci_dev(struct pciback_d
 			       pci_name(dev), slot);
 			list_add_tail(&dev_entry->list,
 				      &vpci_dev->dev_list[slot]);
-			func = PCI_FUNC(dev->devfn);
+			func = dev->is_virtfn ? 0 : PCI_FUNC(dev->devfn);
 			goto unlock;
 		}
 	}

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 16:00:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 16:00:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPEzf-0002GA-Hz; Fri, 19 Oct 2012 16:00:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPEze-0002Fv-5l
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 16:00:14 +0000
Received: from [85.158.138.51:9383] by server-8.bemta-3.messagelabs.com id
	2B/12-10525-D0971805; Fri, 19 Oct 2012 16:00:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-174.messagelabs.com!1350662411!27438431!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13200 invoked from network); 19 Oct 2012 16:00:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 16:00:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPEza-0001FC-Hz
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 16:00:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPEza-0006HZ-5S
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 16:00:10 +0000
Message-Id: <E1TPEza-0006HZ-5S@xenbits.xen.org>
Date: Fri, 19 Oct 2012 16:00:09 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] x86: don't corrupt %eip when
	returning from a signal handler
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User David Vrabel <david.vrabel@citrix.com>
# Date 1350662240 -7200
# Node ID f695483240db110763b89c6821a2357929f2ec1e
# Parent  0dbf07f0bdbfea42ba2f43a7e4786394ece74515
x86: don't corrupt %eip when returning from a signal handler

In 32 bit guests, if a userspace process has %eax == -ERESTARTSYS
(-512) or -ERESTARTNOINTR (-513) when it is interrupted by an event
/and/ the process has a pending signal then %eip (and %eax) are
corrupted when returning to the main process after handling the
signal.  The application may then crash with SIGSEGV or a SIGILL or it
may have subtly incorrect behaviour (depending on what instruction it
returned to).

The occurs because handle_signal() is incorrectly thinking that there
is a system call that needs to restarted so it adjusts %eip and %eax
to re-execute the system call instruction (even though user space had
not done a system call).

If %eax == -514 (-ERESTARTNOHAND (-514) or -ERESTART_RESTARTBLOCK
(-516) then handle_signal() only corrupted %eax (by setting it to
-EINTR).  This may cause the application to crash or have incorrect
behaviour.

handle_signal() assumes that regs->orig_ax >= 0 means a system call so
any kernel entry point that is not for a system call must push a
negative value for orig_ax.  For example, for physical interrupts on
bare metal the inverse of the vector is pushed and page_fault() sets
regs->orig_ax to -1, overwriting the hardware provided error code.

xen_hypervisor_callback() was incorrectly pushing 0 for orig_ax
instead of -1.

Classic Xen kernels pushed %eax which works as %eax cannot be both
non-negative and -RESTARTSYS (etc.), but using -1 is consistent with
other non-system call entry points.

There were similar bugs in xen_failsafe_callback(), if the fault was
corrected and normal return path was used.  64 bit guests would push 0
which is broken.  32 bit guests would push %eax which is safe (see
previous paragraph), but for consistency this is also changed to -1.

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

While on x86-64 the situation is the same for the forward port code,
on ix86 it is inverse to the description above (which isn't correct
either, as that v2 patch modified the wrong push) - the failsafe
callback is broken, while the "normal" callback is being changed only
for consistency.

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


diff -r 0dbf07f0bdbf -r f695483240db arch/i386/kernel/entry-xen.S
--- a/arch/i386/kernel/entry-xen.S	Fri Oct 19 17:46:12 2012 +0200
+++ b/arch/i386/kernel/entry-xen.S	Fri Oct 19 17:57:20 2012 +0200
@@ -787,7 +787,7 @@ error_code:
 # so we can simply throw away the new one.
 ENTRY(hypervisor_callback)
 	RING0_INT_FRAME
-	pushl %eax
+	pushl $-1
 	CFI_ADJUST_CFA_OFFSET 4
 	SAVE_ALL
 	testb $2,CS(%esp)
@@ -877,7 +877,7 @@ 4:	mov 16(%esp),%gs
 	jmp iret_exc
 5:	addl $16,%esp		# EAX == 0 => Category 1 (Bad segment)
 	RING0_INT_FRAME
-	pushl $0
+	pushl $-1
 	SAVE_ALL
 	jmp ret_from_exception
 .section .fixup,"ax";		\
diff -r 0dbf07f0bdbf -r f695483240db arch/x86_64/kernel/entry-xen.S
--- a/arch/x86_64/kernel/entry-xen.S	Fri Oct 19 17:46:12 2012 +0200
+++ b/arch/x86_64/kernel/entry-xen.S	Fri Oct 19 17:57:20 2012 +0200
@@ -1032,7 +1032,7 @@ 1:	/* Segment mismatch => Category 1 (Ba
 	CFI_RESTORE r11
 	addq $0x30,%rsp
 	CFI_ADJUST_CFA_OFFSET -0x30
-	pushq $0
+	pushq $-1
 	CFI_ADJUST_CFA_OFFSET 8
 	SAVE_ALL
 	jmp error_exit

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 16:00:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 16:00:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPEzf-0002GA-Hz; Fri, 19 Oct 2012 16:00:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPEze-0002Fv-5l
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 16:00:14 +0000
Received: from [85.158.138.51:9383] by server-8.bemta-3.messagelabs.com id
	2B/12-10525-D0971805; Fri, 19 Oct 2012 16:00:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-174.messagelabs.com!1350662411!27438431!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13200 invoked from network); 19 Oct 2012 16:00:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 16:00:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPEza-0001FC-Hz
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 16:00:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPEza-0006HZ-5S
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 16:00:10 +0000
Message-Id: <E1TPEza-0006HZ-5S@xenbits.xen.org>
Date: Fri, 19 Oct 2012 16:00:09 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] x86: don't corrupt %eip when
	returning from a signal handler
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User David Vrabel <david.vrabel@citrix.com>
# Date 1350662240 -7200
# Node ID f695483240db110763b89c6821a2357929f2ec1e
# Parent  0dbf07f0bdbfea42ba2f43a7e4786394ece74515
x86: don't corrupt %eip when returning from a signal handler

In 32 bit guests, if a userspace process has %eax == -ERESTARTSYS
(-512) or -ERESTARTNOINTR (-513) when it is interrupted by an event
/and/ the process has a pending signal then %eip (and %eax) are
corrupted when returning to the main process after handling the
signal.  The application may then crash with SIGSEGV or a SIGILL or it
may have subtly incorrect behaviour (depending on what instruction it
returned to).

The occurs because handle_signal() is incorrectly thinking that there
is a system call that needs to restarted so it adjusts %eip and %eax
to re-execute the system call instruction (even though user space had
not done a system call).

If %eax == -514 (-ERESTARTNOHAND (-514) or -ERESTART_RESTARTBLOCK
(-516) then handle_signal() only corrupted %eax (by setting it to
-EINTR).  This may cause the application to crash or have incorrect
behaviour.

handle_signal() assumes that regs->orig_ax >= 0 means a system call so
any kernel entry point that is not for a system call must push a
negative value for orig_ax.  For example, for physical interrupts on
bare metal the inverse of the vector is pushed and page_fault() sets
regs->orig_ax to -1, overwriting the hardware provided error code.

xen_hypervisor_callback() was incorrectly pushing 0 for orig_ax
instead of -1.

Classic Xen kernels pushed %eax which works as %eax cannot be both
non-negative and -RESTARTSYS (etc.), but using -1 is consistent with
other non-system call entry points.

There were similar bugs in xen_failsafe_callback(), if the fault was
corrected and normal return path was used.  64 bit guests would push 0
which is broken.  32 bit guests would push %eax which is safe (see
previous paragraph), but for consistency this is also changed to -1.

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

While on x86-64 the situation is the same for the forward port code,
on ix86 it is inverse to the description above (which isn't correct
either, as that v2 patch modified the wrong push) - the failsafe
callback is broken, while the "normal" callback is being changed only
for consistency.

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


diff -r 0dbf07f0bdbf -r f695483240db arch/i386/kernel/entry-xen.S
--- a/arch/i386/kernel/entry-xen.S	Fri Oct 19 17:46:12 2012 +0200
+++ b/arch/i386/kernel/entry-xen.S	Fri Oct 19 17:57:20 2012 +0200
@@ -787,7 +787,7 @@ error_code:
 # so we can simply throw away the new one.
 ENTRY(hypervisor_callback)
 	RING0_INT_FRAME
-	pushl %eax
+	pushl $-1
 	CFI_ADJUST_CFA_OFFSET 4
 	SAVE_ALL
 	testb $2,CS(%esp)
@@ -877,7 +877,7 @@ 4:	mov 16(%esp),%gs
 	jmp iret_exc
 5:	addl $16,%esp		# EAX == 0 => Category 1 (Bad segment)
 	RING0_INT_FRAME
-	pushl $0
+	pushl $-1
 	SAVE_ALL
 	jmp ret_from_exception
 .section .fixup,"ax";		\
diff -r 0dbf07f0bdbf -r f695483240db arch/x86_64/kernel/entry-xen.S
--- a/arch/x86_64/kernel/entry-xen.S	Fri Oct 19 17:46:12 2012 +0200
+++ b/arch/x86_64/kernel/entry-xen.S	Fri Oct 19 17:57:20 2012 +0200
@@ -1032,7 +1032,7 @@ 1:	/* Segment mismatch => Category 1 (Ba
 	CFI_RESTORE r11
 	addq $0x30,%rsp
 	CFI_ADJUST_CFA_OFFSET -0x30
-	pushq $0
+	pushq $-1
 	CFI_ADJUST_CFA_OFFSET 8
 	SAVE_ALL
 	jmp error_exit

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmg-0008DP-KL; Fri, 19 Oct 2012 22:11:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmf-0008Cp-4k
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:13 +0000
Received: from [85.158.143.35:51985] by server-3.bemta-4.messagelabs.com id
	62/C5-03544-000D1805; Fri, 19 Oct 2012 22:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-21.messagelabs.com!1350684670!11671173!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15575 invoked from network); 19 Oct 2012 22:11:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmb-0005UZ-TH
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmb-0008R9-IH
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:09 +0000
Message-Id: <E1TPKmb-0008R9-IH@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] ACPI/APEI: fix ERST MOVE_DATA
	instruction implementation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Huang Ying <ying.huang@intel.com>
# Date 1350475926 -7200
# Node ID ec8a091efcce717584b00ce76e3cec40a6247ebc
# Parent  4b4c0c7a6031820ab521fdd6764cb0df157f44bf
ACPI/APEI: fix ERST MOVE_DATA instruction implementation

The src_base and dst_base fields in apei_exec_context are physical
address, so they should be ioremaped before being used in ERST
MOVE_DATA instruction.

Reported-by: Javier Martinez Canillas <martinez.javier@gmail.com>
Reported-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Huang Ying <ying.huang@intel.com>

Replace use of ioremap() by __acpi_map_table()/set_fixmap(). Fix error
handling.

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


diff -r 4b4c0c7a6031 -r ec8a091efcce xen/drivers/acpi/apei/erst.c
--- a/xen/drivers/acpi/apei/erst.c	Wed Oct 17 11:23:10 2012 +0200
+++ b/xen/drivers/acpi/apei/erst.c	Wed Oct 17 14:12:06 2012 +0200
@@ -247,15 +247,64 @@ static int erst_exec_move_data(struct ap
 {
 	int rc;
 	u64 offset;
+#ifdef CONFIG_X86
+	enum fixed_addresses idx;
+#endif
+	void *src, *dst;
+
+	/* ioremap does not work in interrupt context */
+	if (in_irq()) {
+		printk(KERN_WARNING
+		       "MOVE_DATA cannot be used in interrupt context\n");
+		return -EBUSY;
+	}
 
 	rc = __apei_exec_read_register(entry, &offset);
 	if (rc)
 		return rc;
-	memmove((void *)(unsigned long)(ctx->dst_base + offset),
-		(void *)(unsigned long)(ctx->src_base + offset),
-		ctx->var2);
 
-	return 0;
+#ifdef CONFIG_X86
+	switch (ctx->var2) {
+	case 0:
+		return 0;
+	case 1 ... PAGE_SIZE:
+		break;
+	default:
+		printk(KERN_WARNING
+		       "MOVE_DATA cannot be used for %#"PRIx64" bytes of data\n",
+		       ctx->var2);
+		return -EOPNOTSUPP;
+	}
+
+	src = __acpi_map_table(ctx->src_base + offset, ctx->var2);
+#else
+	src = ioremap(ctx->src_base + offset, ctx->var2);
+#endif
+	if (!src)
+		return -ENOMEM;
+
+#ifdef CONFIG_X86
+	BUILD_BUG_ON(FIX_ACPI_PAGES < 4);
+	idx = virt_to_fix((unsigned long)src + 2 * PAGE_SIZE);
+	offset += ctx->dst_base;
+	dst = (void *)fix_to_virt(idx) + (offset & ~PAGE_MASK);
+	set_fixmap(idx, offset);
+	if (PFN_DOWN(offset) != PFN_DOWN(offset + ctx->var2 - 1)) {
+		idx = virt_to_fix((unsigned long)dst + PAGE_SIZE);
+		set_fixmap(idx, offset + PAGE_SIZE);
+	}
+#else
+	dst = ioremap(ctx->dst_base + offset, ctx->var2);
+#endif
+	if (dst) {
+		memmove(dst, src, ctx->var2);
+		iounmap(dst);
+	} else
+		rc = -ENOMEM;
+
+	iounmap(src);
+
+	return rc;
 }
 
 static struct apei_exec_ins_type erst_ins_type[] = {

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmf-0008Cu-BI; Fri, 19 Oct 2012 22:11:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmd-0008Ce-M7
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:11 +0000
Received: from [85.158.137.99:21627] by server-6.bemta-3.messagelabs.com id
	B0/64-32375-EFFC1805; Fri, 19 Oct 2012 22:11:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-217.messagelabs.com!1350684669!22192095!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25649 invoked from network); 19 Oct 2012 22:11:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKma-0005UT-PJ
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKma-0008Qf-FG
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:08 +0000
Message-Id: <E1TPKma-0008Qf-FG@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] ACPI: fix APEI related table size
	checking
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Huang Ying <ying.huang@intel.com>
# Date 1350401196 -7200
# Node ID 4fc87c2f31a02c770655518c9e4d389302564f00
# Parent  c1c549c4fe9ebdc460cbf51e296edad157b6e518
ACPI: fix APEI related table size checking

On Huang Ying's machine:

erst_tab->header_length == sizeof(struct acpi_table_einj)

but Yinghai reported that on his machine,

erst_tab->header_length == sizeof(struct acpi_table_einj) -
sizeof(struct acpi_table_header)

To make erst table size checking code works on all systems, both
testing are treated as PASS.

Same situation applies to einj_tab->header_length, so corresponding
table size checking is changed in similar way too.

Originally-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Huang Ying <ying.huang@intel.com>

- use switch() for better readability
- add comment explaining why a formally invalid size it also being
  accepted
- check erst_tab->header.length before even looking at
  erst_tab->header_length
- prefer sizeof(*erst_tab) over sizeof(struct acpi_table_erst)

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


diff -r c1c549c4fe9e -r 4fc87c2f31a0 xen/drivers/acpi/apei/erst.c
--- a/xen/drivers/acpi/apei/erst.c	Mon Oct 15 16:51:44 2012 +0100
+++ b/xen/drivers/acpi/apei/erst.c	Tue Oct 16 17:26:36 2012 +0200
@@ -715,12 +715,23 @@ int erst_clear(u64 record_id)
 
 static int __init erst_check_table(struct acpi_table_erst *erst_tab)
 {
-	if (erst_tab->header_length != sizeof(struct acpi_table_erst))
+	if (erst_tab->header.length < sizeof(*erst_tab))
 		return -EINVAL;
-	if (erst_tab->header.length < sizeof(struct acpi_table_erst))
+
+	switch (erst_tab->header_length) {
+	case sizeof(*erst_tab) - sizeof(erst_tab->header):
+	/*
+	 * While invalid per specification, there are (early?) systems
+	 * indicating the full header size here, so accept that value too.
+	 */
+	case sizeof(*erst_tab):
+		break;
+	default:
 		return -EINVAL;
+	}
+
 	if (erst_tab->entries !=
-	    (erst_tab->header.length - sizeof(struct acpi_table_erst)) /
+	    (erst_tab->header.length - sizeof(*erst_tab)) /
 	    sizeof(struct acpi_erst_entry))
 		return -EINVAL;
 

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmg-0008DI-Hd; Fri, 19 Oct 2012 22:11:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKme-0008Co-Um
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:13 +0000
Received: from [85.158.139.211:51711] by server-9.bemta-5.messagelabs.com id
	5F/79-23053-000D1805; Fri, 19 Oct 2012 22:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-206.messagelabs.com!1350684670!23007599!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13506 invoked from network); 19 Oct 2012 22:11:11 -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;
	19 Oct 2012 22:11:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmc-0005Uc-Hv
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmc-0008RP-2x
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:10 +0000
Message-Id: <E1TPKmc-0008RP-2x@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/HPET: obtain proper lock for
	changing IRQ 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

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1350476000 -7200
# Node ID 1f4be6ee4619c88c273cb457d8e7f1eee49d00dd
# Parent  ec8a091efcce717584b00ce76e3cec40a6247ebc
x86/HPET: obtain proper lock for changing IRQ affinity

The IRQ descriptor lock should be held while adjusting the affinity of
any IRQ; the HPET channel lock isn't sufficient to protect namely
against races with moving the IRQ to a different CPU.

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


diff -r ec8a091efcce -r 1f4be6ee4619 xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c	Wed Oct 17 14:12:06 2012 +0200
+++ b/xen/arch/x86/hpet.c	Wed Oct 17 14:13:20 2012 +0200
@@ -436,6 +436,16 @@ static struct hpet_event_channel *hpet_g
     return ch;
 }
 
+static void set_channel_irq_affinity(const struct hpet_event_channel *ch)
+{
+    struct irq_desc *desc = irq_to_desc(ch->irq);
+
+    ASSERT(!local_irq_is_enabled());
+    spin_lock(&desc->lock);
+    hpet_msi_set_affinity(desc, cpumask_of(ch->cpu));
+    spin_unlock(&desc->lock);
+}
+
 static void hpet_attach_channel(unsigned int cpu,
                                 struct hpet_event_channel *ch)
 {
@@ -450,7 +460,7 @@ static void hpet_attach_channel(unsigned
     if ( ch->cpu != cpu )
         return;
 
-    hpet_msi_set_affinity(irq_to_desc(ch->irq), cpumask_of(ch->cpu));
+    set_channel_irq_affinity(ch);
 }
 
 static void hpet_detach_channel(unsigned int cpu,
@@ -472,7 +482,7 @@ static void hpet_detach_channel(unsigned
     }
 
     ch->cpu = cpumask_first(ch->cpumask);
-    hpet_msi_set_affinity(irq_to_desc(ch->irq), cpumask_of(ch->cpu));
+    set_channel_irq_affinity(ch);
 }
 
 #include <asm/mc146818rtc.h>

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmi-0008E5-So; Fri, 19 Oct 2012 22:11:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmh-0008DM-53
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:15 +0000
Received: from [85.158.139.211:51767] by server-8.bemta-5.messagelabs.com id
	7B/ED-23193-200D1805; Fri, 19 Oct 2012 22:11:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-206.messagelabs.com!1350684673!22975925!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3159 invoked from network); 19 Oct 2012 22:11:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKme-0005Ur-Qu
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKme-0008Se-Pb
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:12 +0000
Message-Id: <E1TPKme-0008Se-Pb@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: change the limit of nr_extents
	to UINT_MAX >> MEMOP_EXTENT_SHIFT
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1350488630 -3600
# Node ID ed6c135011958a18c0392713f9a357d3281546a7
# Parent  a324eea3bbc87cdfb314ac4d09c67b58d18c3f4a
xen: change the limit of nr_extents to UINT_MAX >> MEMOP_EXTENT_SHIFT

Currently do_memory_op has a different maximum limit for nr_extents on
32 bit and 64 bit.
Change the limit to UINT_MAX >> MEMOP_EXTENT_SHIFT, so that it is the
same in both cases.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r a324eea3bbc8 -r ed6c13501195 xen/common/memory.c
--- a/xen/common/memory.c	Wed Oct 17 16:43:49 2012 +0100
+++ b/xen/common/memory.c	Wed Oct 17 16:43:50 2012 +0100
@@ -540,7 +540,7 @@ long do_memory_op(unsigned long cmd, XEN
             return start_extent;
 
         /* Is size too large for us to encode a continuation? */
-        if ( reservation.nr_extents > (ULONG_MAX >> MEMOP_EXTENT_SHIFT) )
+        if ( reservation.nr_extents > (UINT_MAX >> MEMOP_EXTENT_SHIFT) )
             return start_extent;
 
         if ( unlikely(start_extent >= reservation.nr_extents) )

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmi-0008EE-Vz; Fri, 19 Oct 2012 22:11:16 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmh-0008DJ-5F
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:15 +0000
Received: from [193.109.254.147:25319] by server-5.bemta-14.messagelabs.com id
	E8/AE-18309-200D1805; Fri, 19 Oct 2012 22:11:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-27.messagelabs.com!1350684672!2884411!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29155 invoked from network); 19 Oct 2012 22:11:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmd-0005Ul-Rb
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmd-0008S8-N2
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:11 +0000
Message-Id: <E1TPKmd-0008S8-N2@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: tools: add arm to foreign
	structs checking
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1350488628 -3600
# Node ID 980863b9fa4bb5c71a8831d7030816bd5cd8de57
# Parent  b146705d70b3c8e135cfc06a38875e45fd34d638
arm: tools: add arm to foreign structs checking

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


diff -r b146705d70b3 -r 980863b9fa4b tools/include/xen-foreign/Makefile
--- a/tools/include/xen-foreign/Makefile	Wed Oct 17 16:43:47 2012 +0100
+++ b/tools/include/xen-foreign/Makefile	Wed Oct 17 16:43:48 2012 +0100
@@ -3,7 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk
 
 ROOT = $(XEN_ROOT)/xen/include/public
 
-architectures := x86_32 x86_64
+architectures := arm x86_32 x86_64
 headers := $(patsubst %, %.h, $(architectures))
 
 .PHONY: all clean check-headers
@@ -22,6 +22,9 @@ check-headers: checker
 	diff -u reference.size tmp.size
 	rm tmp.size
 
+arm.h: mkheader.py structs.py $(ROOT)/arch-arm.h
+	$(PYTHON) $< $* $@ $(filter %.h,$^)
+
 x86_32.h: mkheader.py structs.py $(ROOT)/arch-x86/xen-x86_32.h $(ROOT)/arch-x86/xen.h $(ROOT)/xen.h
 	$(PYTHON) $< $* $@ $(filter %.h,$^)
 
diff -r b146705d70b3 -r 980863b9fa4b tools/include/xen-foreign/mkheader.py
--- a/tools/include/xen-foreign/mkheader.py	Wed Oct 17 16:43:47 2012 +0100
+++ b/tools/include/xen-foreign/mkheader.py	Wed Oct 17 16:43:48 2012 +0100
@@ -16,6 +16,13 @@ inttypes = {};
 header = {};
 footer = {};
 
+#arm
+inttypes["arm"] = {
+    "unsigned long" : "uint32_t",
+    "long"          : "uint32_t",
+    "xen_pfn_t"     : "uint64_t",
+};
+
 # x86_32
 inttypes["x86_32"] = {
     "unsigned long" : "uint32_t",
diff -r b146705d70b3 -r 980863b9fa4b tools/include/xen-foreign/reference.size
--- a/tools/include/xen-foreign/reference.size	Wed Oct 17 16:43:47 2012 +0100
+++ b/tools/include/xen-foreign/reference.size	Wed Oct 17 16:43:48 2012 +0100
@@ -1,13 +1,13 @@
 
-structs                   |  x86_32  x86_64
+structs                   |     arm  x86_32  x86_64
 
-start_info                |    1112    1168
-trap_info                 |       8      16
-cpu_user_regs             |      68     200
-vcpu_guest_context        |    2800    5168
-arch_vcpu_info            |      24      16
-vcpu_time_info            |      32      32
-vcpu_info                 |      64      64
-arch_shared_info          |     268     280
-shared_info               |    2584    3368
+start_info                |       -    1112    1168
+trap_info                 |       -       8      16
+cpu_user_regs             |     160      68     200
+vcpu_guest_context        |     180    2800    5168
+arch_vcpu_info            |       -      24      16
+vcpu_time_info            |       -      32      32
+vcpu_info                 |       -      64      64
+arch_shared_info          |       -     268     280
+shared_info               |       -    2584    3368
 
diff -r b146705d70b3 -r 980863b9fa4b tools/include/xen-foreign/structs.py
--- a/tools/include/xen-foreign/structs.py	Wed Oct 17 16:43:47 2012 +0100
+++ b/tools/include/xen-foreign/structs.py	Wed Oct 17 16:43:48 2012 +0100
@@ -13,9 +13,14 @@ structs = [ "start_info",
             "arch_shared_info",
             "shared_info" ];
 
-defines = [ "__i386__",
+defines = [ "__arm__",
+            "__i386__",
             "__x86_64__",
 
+            # arm
+            # None
+
+            # x86_{32,64}
             "FLAT_RING1_CS",
             "FLAT_RING1_DS",
             "FLAT_RING1_SS",

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmi-0008E5-So; Fri, 19 Oct 2012 22:11:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmh-0008DM-53
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:15 +0000
Received: from [85.158.139.211:51767] by server-8.bemta-5.messagelabs.com id
	7B/ED-23193-200D1805; Fri, 19 Oct 2012 22:11:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-206.messagelabs.com!1350684673!22975925!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3159 invoked from network); 19 Oct 2012 22:11:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKme-0005Ur-Qu
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKme-0008Se-Pb
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:12 +0000
Message-Id: <E1TPKme-0008Se-Pb@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: change the limit of nr_extents
	to UINT_MAX >> MEMOP_EXTENT_SHIFT
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1350488630 -3600
# Node ID ed6c135011958a18c0392713f9a357d3281546a7
# Parent  a324eea3bbc87cdfb314ac4d09c67b58d18c3f4a
xen: change the limit of nr_extents to UINT_MAX >> MEMOP_EXTENT_SHIFT

Currently do_memory_op has a different maximum limit for nr_extents on
32 bit and 64 bit.
Change the limit to UINT_MAX >> MEMOP_EXTENT_SHIFT, so that it is the
same in both cases.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r a324eea3bbc8 -r ed6c13501195 xen/common/memory.c
--- a/xen/common/memory.c	Wed Oct 17 16:43:49 2012 +0100
+++ b/xen/common/memory.c	Wed Oct 17 16:43:50 2012 +0100
@@ -540,7 +540,7 @@ long do_memory_op(unsigned long cmd, XEN
             return start_extent;
 
         /* Is size too large for us to encode a continuation? */
-        if ( reservation.nr_extents > (ULONG_MAX >> MEMOP_EXTENT_SHIFT) )
+        if ( reservation.nr_extents > (UINT_MAX >> MEMOP_EXTENT_SHIFT) )
             return start_extent;
 
         if ( unlikely(start_extent >= reservation.nr_extents) )

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmi-0008EE-Vz; Fri, 19 Oct 2012 22:11:16 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmh-0008DJ-5F
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:15 +0000
Received: from [193.109.254.147:25319] by server-5.bemta-14.messagelabs.com id
	E8/AE-18309-200D1805; Fri, 19 Oct 2012 22:11:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-27.messagelabs.com!1350684672!2884411!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29155 invoked from network); 19 Oct 2012 22:11:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmd-0005Ul-Rb
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmd-0008S8-N2
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:11 +0000
Message-Id: <E1TPKmd-0008S8-N2@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: tools: add arm to foreign
	structs checking
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1350488628 -3600
# Node ID 980863b9fa4bb5c71a8831d7030816bd5cd8de57
# Parent  b146705d70b3c8e135cfc06a38875e45fd34d638
arm: tools: add arm to foreign structs checking

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


diff -r b146705d70b3 -r 980863b9fa4b tools/include/xen-foreign/Makefile
--- a/tools/include/xen-foreign/Makefile	Wed Oct 17 16:43:47 2012 +0100
+++ b/tools/include/xen-foreign/Makefile	Wed Oct 17 16:43:48 2012 +0100
@@ -3,7 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk
 
 ROOT = $(XEN_ROOT)/xen/include/public
 
-architectures := x86_32 x86_64
+architectures := arm x86_32 x86_64
 headers := $(patsubst %, %.h, $(architectures))
 
 .PHONY: all clean check-headers
@@ -22,6 +22,9 @@ check-headers: checker
 	diff -u reference.size tmp.size
 	rm tmp.size
 
+arm.h: mkheader.py structs.py $(ROOT)/arch-arm.h
+	$(PYTHON) $< $* $@ $(filter %.h,$^)
+
 x86_32.h: mkheader.py structs.py $(ROOT)/arch-x86/xen-x86_32.h $(ROOT)/arch-x86/xen.h $(ROOT)/xen.h
 	$(PYTHON) $< $* $@ $(filter %.h,$^)
 
diff -r b146705d70b3 -r 980863b9fa4b tools/include/xen-foreign/mkheader.py
--- a/tools/include/xen-foreign/mkheader.py	Wed Oct 17 16:43:47 2012 +0100
+++ b/tools/include/xen-foreign/mkheader.py	Wed Oct 17 16:43:48 2012 +0100
@@ -16,6 +16,13 @@ inttypes = {};
 header = {};
 footer = {};
 
+#arm
+inttypes["arm"] = {
+    "unsigned long" : "uint32_t",
+    "long"          : "uint32_t",
+    "xen_pfn_t"     : "uint64_t",
+};
+
 # x86_32
 inttypes["x86_32"] = {
     "unsigned long" : "uint32_t",
diff -r b146705d70b3 -r 980863b9fa4b tools/include/xen-foreign/reference.size
--- a/tools/include/xen-foreign/reference.size	Wed Oct 17 16:43:47 2012 +0100
+++ b/tools/include/xen-foreign/reference.size	Wed Oct 17 16:43:48 2012 +0100
@@ -1,13 +1,13 @@
 
-structs                   |  x86_32  x86_64
+structs                   |     arm  x86_32  x86_64
 
-start_info                |    1112    1168
-trap_info                 |       8      16
-cpu_user_regs             |      68     200
-vcpu_guest_context        |    2800    5168
-arch_vcpu_info            |      24      16
-vcpu_time_info            |      32      32
-vcpu_info                 |      64      64
-arch_shared_info          |     268     280
-shared_info               |    2584    3368
+start_info                |       -    1112    1168
+trap_info                 |       -       8      16
+cpu_user_regs             |     160      68     200
+vcpu_guest_context        |     180    2800    5168
+arch_vcpu_info            |       -      24      16
+vcpu_time_info            |       -      32      32
+vcpu_info                 |       -      64      64
+arch_shared_info          |       -     268     280
+shared_info               |       -    2584    3368
 
diff -r b146705d70b3 -r 980863b9fa4b tools/include/xen-foreign/structs.py
--- a/tools/include/xen-foreign/structs.py	Wed Oct 17 16:43:47 2012 +0100
+++ b/tools/include/xen-foreign/structs.py	Wed Oct 17 16:43:48 2012 +0100
@@ -13,9 +13,14 @@ structs = [ "start_info",
             "arch_shared_info",
             "shared_info" ];
 
-defines = [ "__i386__",
+defines = [ "__arm__",
+            "__i386__",
             "__x86_64__",
 
+            # arm
+            # None
+
+            # x86_{32,64}
             "FLAT_RING1_CS",
             "FLAT_RING1_DS",
             "FLAT_RING1_SS",

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmg-0008DI-Hd; Fri, 19 Oct 2012 22:11:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKme-0008Co-Um
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:13 +0000
Received: from [85.158.139.211:51711] by server-9.bemta-5.messagelabs.com id
	5F/79-23053-000D1805; Fri, 19 Oct 2012 22:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-206.messagelabs.com!1350684670!23007599!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13506 invoked from network); 19 Oct 2012 22:11:11 -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;
	19 Oct 2012 22:11:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmc-0005Uc-Hv
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmc-0008RP-2x
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:10 +0000
Message-Id: <E1TPKmc-0008RP-2x@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/HPET: obtain proper lock for
	changing IRQ 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

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1350476000 -7200
# Node ID 1f4be6ee4619c88c273cb457d8e7f1eee49d00dd
# Parent  ec8a091efcce717584b00ce76e3cec40a6247ebc
x86/HPET: obtain proper lock for changing IRQ affinity

The IRQ descriptor lock should be held while adjusting the affinity of
any IRQ; the HPET channel lock isn't sufficient to protect namely
against races with moving the IRQ to a different CPU.

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


diff -r ec8a091efcce -r 1f4be6ee4619 xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c	Wed Oct 17 14:12:06 2012 +0200
+++ b/xen/arch/x86/hpet.c	Wed Oct 17 14:13:20 2012 +0200
@@ -436,6 +436,16 @@ static struct hpet_event_channel *hpet_g
     return ch;
 }
 
+static void set_channel_irq_affinity(const struct hpet_event_channel *ch)
+{
+    struct irq_desc *desc = irq_to_desc(ch->irq);
+
+    ASSERT(!local_irq_is_enabled());
+    spin_lock(&desc->lock);
+    hpet_msi_set_affinity(desc, cpumask_of(ch->cpu));
+    spin_unlock(&desc->lock);
+}
+
 static void hpet_attach_channel(unsigned int cpu,
                                 struct hpet_event_channel *ch)
 {
@@ -450,7 +460,7 @@ static void hpet_attach_channel(unsigned
     if ( ch->cpu != cpu )
         return;
 
-    hpet_msi_set_affinity(irq_to_desc(ch->irq), cpumask_of(ch->cpu));
+    set_channel_irq_affinity(ch);
 }
 
 static void hpet_detach_channel(unsigned int cpu,
@@ -472,7 +482,7 @@ static void hpet_detach_channel(unsigned
     }
 
     ch->cpu = cpumask_first(ch->cpumask);
-    hpet_msi_set_affinity(irq_to_desc(ch->irq), cpumask_of(ch->cpu));
+    set_channel_irq_affinity(ch);
 }
 
 #include <asm/mc146818rtc.h>

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmf-0008D4-Dy; Fri, 19 Oct 2012 22:11:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKme-0008Cf-3R
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:12 +0000
Received: from [85.158.137.99:46222] by server-2.bemta-3.messagelabs.com id
	F0/0D-00604-FFFC1805; Fri, 19 Oct 2012 22:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-217.messagelabs.com!1350684669!17569706!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21510 invoked from network); 19 Oct 2012 22:11:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmb-0005UW-A1
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmb-0008Qu-1B
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:09 +0000
Message-Id: <E1TPKmb-0008Qu-1B@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/oprof: adjust off-by-one counter
	range checks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1350465790 -7200
# Node ID 4b4c0c7a6031820ab521fdd6764cb0df157f44bf
# Parent  4fc87c2f31a02c770655518c9e4d389302564f00
x86/oprof: adjust off-by-one counter range checks

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


diff -r 4fc87c2f31a0 -r 4b4c0c7a6031 xen/arch/x86/oprofile/xenoprof.c
--- a/xen/arch/x86/oprofile/xenoprof.c	Tue Oct 16 17:26:36 2012 +0200
+++ b/xen/arch/x86/oprofile/xenoprof.c	Wed Oct 17 11:23:10 2012 +0200
@@ -24,7 +24,7 @@ int xenoprof_arch_counter(XEN_GUEST_HAND
     if ( copy_from_guest(&counter, arg, 1) )
         return -EFAULT;
 
-    if ( counter.ind > OP_MAX_COUNTER )
+    if ( counter.ind >= OP_MAX_COUNTER )
         return -E2BIG;
 
     counter_config[counter.ind].count     = counter.count;
@@ -61,7 +61,7 @@ int compat_oprof_arch_counter(XEN_GUEST_
     if ( copy_from_guest(&counter, arg, 1) )
         return -EFAULT;
 
-    if ( counter.ind > OP_MAX_COUNTER )
+    if ( counter.ind >= OP_MAX_COUNTER )
         return -E2BIG;
 
     counter_config[counter.ind].count     = counter.count;

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmg-0008DP-KL; Fri, 19 Oct 2012 22:11:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmf-0008Cp-4k
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:13 +0000
Received: from [85.158.143.35:51985] by server-3.bemta-4.messagelabs.com id
	62/C5-03544-000D1805; Fri, 19 Oct 2012 22:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-21.messagelabs.com!1350684670!11671173!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15575 invoked from network); 19 Oct 2012 22:11:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmb-0005UZ-TH
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmb-0008R9-IH
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:09 +0000
Message-Id: <E1TPKmb-0008R9-IH@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] ACPI/APEI: fix ERST MOVE_DATA
	instruction implementation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Huang Ying <ying.huang@intel.com>
# Date 1350475926 -7200
# Node ID ec8a091efcce717584b00ce76e3cec40a6247ebc
# Parent  4b4c0c7a6031820ab521fdd6764cb0df157f44bf
ACPI/APEI: fix ERST MOVE_DATA instruction implementation

The src_base and dst_base fields in apei_exec_context are physical
address, so they should be ioremaped before being used in ERST
MOVE_DATA instruction.

Reported-by: Javier Martinez Canillas <martinez.javier@gmail.com>
Reported-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Huang Ying <ying.huang@intel.com>

Replace use of ioremap() by __acpi_map_table()/set_fixmap(). Fix error
handling.

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


diff -r 4b4c0c7a6031 -r ec8a091efcce xen/drivers/acpi/apei/erst.c
--- a/xen/drivers/acpi/apei/erst.c	Wed Oct 17 11:23:10 2012 +0200
+++ b/xen/drivers/acpi/apei/erst.c	Wed Oct 17 14:12:06 2012 +0200
@@ -247,15 +247,64 @@ static int erst_exec_move_data(struct ap
 {
 	int rc;
 	u64 offset;
+#ifdef CONFIG_X86
+	enum fixed_addresses idx;
+#endif
+	void *src, *dst;
+
+	/* ioremap does not work in interrupt context */
+	if (in_irq()) {
+		printk(KERN_WARNING
+		       "MOVE_DATA cannot be used in interrupt context\n");
+		return -EBUSY;
+	}
 
 	rc = __apei_exec_read_register(entry, &offset);
 	if (rc)
 		return rc;
-	memmove((void *)(unsigned long)(ctx->dst_base + offset),
-		(void *)(unsigned long)(ctx->src_base + offset),
-		ctx->var2);
 
-	return 0;
+#ifdef CONFIG_X86
+	switch (ctx->var2) {
+	case 0:
+		return 0;
+	case 1 ... PAGE_SIZE:
+		break;
+	default:
+		printk(KERN_WARNING
+		       "MOVE_DATA cannot be used for %#"PRIx64" bytes of data\n",
+		       ctx->var2);
+		return -EOPNOTSUPP;
+	}
+
+	src = __acpi_map_table(ctx->src_base + offset, ctx->var2);
+#else
+	src = ioremap(ctx->src_base + offset, ctx->var2);
+#endif
+	if (!src)
+		return -ENOMEM;
+
+#ifdef CONFIG_X86
+	BUILD_BUG_ON(FIX_ACPI_PAGES < 4);
+	idx = virt_to_fix((unsigned long)src + 2 * PAGE_SIZE);
+	offset += ctx->dst_base;
+	dst = (void *)fix_to_virt(idx) + (offset & ~PAGE_MASK);
+	set_fixmap(idx, offset);
+	if (PFN_DOWN(offset) != PFN_DOWN(offset + ctx->var2 - 1)) {
+		idx = virt_to_fix((unsigned long)dst + PAGE_SIZE);
+		set_fixmap(idx, offset + PAGE_SIZE);
+	}
+#else
+	dst = ioremap(ctx->dst_base + offset, ctx->var2);
+#endif
+	if (dst) {
+		memmove(dst, src, ctx->var2);
+		iounmap(dst);
+	} else
+		rc = -ENOMEM;
+
+	iounmap(src);
+
+	return rc;
 }
 
 static struct apei_exec_ins_type erst_ins_type[] = {

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmh-0008Dk-Np; Fri, 19 Oct 2012 22:11:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmf-0008D3-VL
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:14 +0000
Received: from [85.158.137.99:21663] by server-9.bemta-3.messagelabs.com id
	17/E5-16841-100D1805; Fri, 19 Oct 2012 22:11:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-217.messagelabs.com!1350684671!17569708!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21528 invoked from network); 19 Oct 2012 22:11:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmc-0005Uf-T2
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmc-0008Re-KB
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:10 +0000
Message-Id: <E1TPKmc-0008Re-KB@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: implement
	XENMEM_add_to_physmap_range
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1350488626 -3600
# Node ID bbe9860189490b04a20595328c391b40717fc9cd
# Parent  1f4be6ee4619c88c273cb457d8e7f1eee49d00dd
xen: arm: implement XENMEM_add_to_physmap_range

This allows for foreign mappings as well as batching, fitting all that
into XENMEM_add_to_physmap wasn't possible.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 1f4be6ee4619 -r bbe986018949 xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c	Wed Oct 17 14:13:20 2012 +0200
+++ b/xen/arch/arm/mm.c	Wed Oct 17 16:43:46 2012 +0100
@@ -25,6 +25,8 @@
 #include <xen/mm.h>
 #include <xen/preempt.h>
 #include <xen/errno.h>
+#include <xen/softirq.h>
+#include <xen/event.h>
 #include <xen/guest_access.h>
 #include <xen/domain_page.h>
 #include <asm/page.h>
@@ -459,37 +461,96 @@ void share_xen_page_with_guest(struct pa
     spin_unlock(&d->page_alloc_lock);
 }
 
-static int xenmem_add_to_physmap_once(
+static int xenmem_add_to_physmap_one(
     struct domain *d,
-    const struct xen_add_to_physmap *xatp)
+    uint16_t space,
+    domid_t foreign_domid,
+    unsigned long idx,
+    xen_pfn_t gpfn)
 {
     unsigned long mfn = 0;
     int rc;
 
-    switch ( xatp->space )
+    switch ( space )
     {
-        case XENMAPSPACE_shared_info:
-            if ( xatp->idx == 0 )
-                mfn = virt_to_mfn(d->shared_info);
-            break;
-        default:
-            return -ENOSYS;
+    case XENMAPSPACE_shared_info:
+        if ( idx == 0 )
+            mfn = virt_to_mfn(d->shared_info);
+        break;
+    case XENMAPSPACE_gmfn_foreign:
+    {
+        paddr_t maddr;
+        struct domain *od;
+        rc = rcu_lock_target_domain_by_id(foreign_domid, &od);
+        if ( rc < 0 )
+            return rc;
+
+        maddr = p2m_lookup(od, idx << PAGE_SHIFT);
+        if ( maddr == INVALID_PADDR )
+        {
+            dump_p2m_lookup(od, idx << PAGE_SHIFT);
+            rcu_unlock_domain(od);
+            return -EINVAL;
+        }
+
+        mfn = maddr >> PAGE_SHIFT;
+
+        rcu_unlock_domain(od);
+        break;
+    }
+
+    default:
+        return -ENOSYS;
     }
 
     domain_lock(d);
 
     /* Map at new location. */
-    rc = guest_physmap_add_page(d, xatp->gpfn, mfn, 0);
+    rc = guest_physmap_add_page(d, gpfn, mfn, 0);
 
     domain_unlock(d);
 
     return rc;
 }
 
-static int xenmem_add_to_physmap(struct domain *d,
-                                 struct xen_add_to_physmap *xatp)
+static int xenmem_add_to_physmap_range(struct domain *d,
+                                       struct xen_add_to_physmap_range *xatpr)
 {
-    return xenmem_add_to_physmap_once(d, xatp);
+    int rc;
+
+    /* Process entries in reverse order to allow continuations */
+    while ( xatpr->size > 0 )
+    {
+        xen_ulong_t idx;
+        xen_pfn_t gpfn;
+
+        rc = copy_from_guest_offset(&idx, xatpr->idxs, xatpr->size-1, 1);
+        if ( rc < 0 )
+            goto out;
+
+        rc = copy_from_guest_offset(&gpfn, xatpr->gpfns, xatpr->size-1, 1);
+        if ( rc < 0 )
+            goto out;
+
+        rc = xenmem_add_to_physmap_one(d, xatpr->space,
+                                       xatpr->foreign_domid,
+                                       idx, gpfn);
+
+        xatpr->size--;
+
+        /* Check for continuation if it's not the last interation */
+        if ( xatpr->size > 0 && hypercall_preempt_check() )
+        {
+            rc = -EAGAIN;
+            goto out;
+        }
+    }
+
+    rc = 0;
+
+out:
+    return rc;
+
 }
 
 long arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg)
@@ -506,17 +567,48 @@ long arch_memory_op(int op, XEN_GUEST_HA
         if ( copy_from_guest(&xatp, arg, 1) )
             return -EFAULT;
 
+        /* This one is only supported by add_to_physmap_range */
+        if ( xatp.space == XENMAPSPACE_gmfn_foreign )
+            return -EINVAL;
+
         rc = rcu_lock_target_domain_by_id(xatp.domid, &d);
         if ( rc != 0 )
             return rc;
 
-        rc = xenmem_add_to_physmap(d, &xatp);
+        rc = xenmem_add_to_physmap_one(d, xatp.space, DOMID_INVALID,
+                                       xatp.idx, xatp.gpfn);
 
         rcu_unlock_domain(d);
 
         return rc;
     }
 
+    case XENMEM_add_to_physmap_range:
+    {
+        struct xen_add_to_physmap_range xatpr;
+        struct domain *d;
+
+        if ( copy_from_guest(&xatpr, arg, 1) )
+            return -EFAULT;
+
+        rc = rcu_lock_target_domain_by_id(xatpr.domid, &d);
+        if ( rc != 0 )
+            return rc;
+
+        rc = xenmem_add_to_physmap_range(d, &xatpr);
+
+        rcu_unlock_domain(d);
+
+        if ( rc && copy_to_guest(arg, &xatpr, 1) )
+            rc = -EFAULT;
+
+        if ( rc == -EAGAIN )
+            rc = hypercall_create_continuation(
+                __HYPERVISOR_memory_op, "ih", op, arg);
+
+        return rc;
+    }
+
     default:
         return -ENOSYS;
     }
diff -r 1f4be6ee4619 -r bbe986018949 xen/include/public/memory.h
--- a/xen/include/public/memory.h	Wed Oct 17 14:13:20 2012 +0200
+++ b/xen/include/public/memory.h	Wed Oct 17 16:43:46 2012 +0100
@@ -198,6 +198,15 @@ struct xen_machphys_mapping {
 typedef struct xen_machphys_mapping xen_machphys_mapping_t;
 DEFINE_XEN_GUEST_HANDLE(xen_machphys_mapping_t);
 
+/* Source mapping space. */
+/* ` enum phys_map_space { */
+#define XENMAPSPACE_shared_info  0 /* shared info page */
+#define XENMAPSPACE_grant_table  1 /* grant table page */
+#define XENMAPSPACE_gmfn         2 /* GMFN */
+#define XENMAPSPACE_gmfn_range   3 /* GMFN range */
+#define XENMAPSPACE_gmfn_foreign 4 /* GMFN from another dom */
+/* ` } */
+
 /*
  * Sets the GPFN at which a particular page appears in the specified guest's
  * pseudophysical address space.
@@ -211,24 +220,39 @@ struct xen_add_to_physmap {
     /* Number of pages to go through for gmfn_range */
     uint16_t    size;
 
-    /* Source mapping space. */
-#define XENMAPSPACE_shared_info 0 /* shared info page */
-#define XENMAPSPACE_grant_table 1 /* grant table page */
-#define XENMAPSPACE_gmfn        2 /* GMFN */
-#define XENMAPSPACE_gmfn_range  3 /* GMFN range */
-    unsigned int space;
+    unsigned int space; /* => enum phys_map_space */
 
 #define XENMAPIDX_grant_table_status 0x80000000
 
-    /* Index into source mapping space. */
+    /* Index into space being mapped. */
     xen_ulong_t idx;
 
-    /* GPFN where the source mapping page should appear. */
+    /* GPFN in domid where the source mapping page should appear. */
     xen_pfn_t     gpfn;
 };
 typedef struct xen_add_to_physmap xen_add_to_physmap_t;
 DEFINE_XEN_GUEST_HANDLE(xen_add_to_physmap_t);
 
+/* A batched version of add_to_physmap. */
+#define XENMEM_add_to_physmap_range 23
+struct xen_add_to_physmap_range {
+    /* Which domain to change the mapping for. */
+    domid_t domid;
+    uint16_t space; /* => enum phys_map_space */
+
+    /* Number of pages to go through */
+    uint16_t size;
+    domid_t foreign_domid; /* IFF gmfn_foreign */
+
+    /* Indexes into space being mapped. */
+    XEN_GUEST_HANDLE(xen_ulong_t) idxs;
+
+    /* GPFN in domdwhere the source mapping page should appear. */
+    XEN_GUEST_HANDLE(xen_pfn_t) gpfns;
+};
+typedef struct xen_add_to_physmap_range xen_add_to_physmap_range_t;
+DEFINE_XEN_GUEST_HANDLE(xen_add_to_physmap_range_t);
+
 /*
  * Unmaps the page appearing at a particular GPFN from the specified guest's
  * pseudophysical address space.
diff -r 1f4be6ee4619 -r bbe986018949 xen/include/public/xen.h
--- a/xen/include/public/xen.h	Wed Oct 17 14:13:20 2012 +0200
+++ b/xen/include/public/xen.h	Wed Oct 17 16:43:46 2012 +0100
@@ -49,6 +49,7 @@ DEFINE_XEN_GUEST_HANDLE(void);
 
 DEFINE_XEN_GUEST_HANDLE(uint64_t);
 DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
+DEFINE_XEN_GUEST_HANDLE(xen_ulong_t);
 #endif
 
 /*

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmf-0008D4-Dy; Fri, 19 Oct 2012 22:11:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKme-0008Cf-3R
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:12 +0000
Received: from [85.158.137.99:46222] by server-2.bemta-3.messagelabs.com id
	F0/0D-00604-FFFC1805; Fri, 19 Oct 2012 22:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-217.messagelabs.com!1350684669!17569706!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21510 invoked from network); 19 Oct 2012 22:11:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmb-0005UW-A1
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmb-0008Qu-1B
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:09 +0000
Message-Id: <E1TPKmb-0008Qu-1B@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/oprof: adjust off-by-one counter
	range checks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1350465790 -7200
# Node ID 4b4c0c7a6031820ab521fdd6764cb0df157f44bf
# Parent  4fc87c2f31a02c770655518c9e4d389302564f00
x86/oprof: adjust off-by-one counter range checks

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


diff -r 4fc87c2f31a0 -r 4b4c0c7a6031 xen/arch/x86/oprofile/xenoprof.c
--- a/xen/arch/x86/oprofile/xenoprof.c	Tue Oct 16 17:26:36 2012 +0200
+++ b/xen/arch/x86/oprofile/xenoprof.c	Wed Oct 17 11:23:10 2012 +0200
@@ -24,7 +24,7 @@ int xenoprof_arch_counter(XEN_GUEST_HAND
     if ( copy_from_guest(&counter, arg, 1) )
         return -EFAULT;
 
-    if ( counter.ind > OP_MAX_COUNTER )
+    if ( counter.ind >= OP_MAX_COUNTER )
         return -E2BIG;
 
     counter_config[counter.ind].count     = counter.count;
@@ -61,7 +61,7 @@ int compat_oprof_arch_counter(XEN_GUEST_
     if ( copy_from_guest(&counter, arg, 1) )
         return -EFAULT;
 
-    if ( counter.ind > OP_MAX_COUNTER )
+    if ( counter.ind >= OP_MAX_COUNTER )
         return -E2BIG;
 
     counter_config[counter.ind].count     = counter.count;

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmf-0008Cu-BI; Fri, 19 Oct 2012 22:11:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmd-0008Ce-M7
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:11 +0000
Received: from [85.158.137.99:21627] by server-6.bemta-3.messagelabs.com id
	B0/64-32375-EFFC1805; Fri, 19 Oct 2012 22:11:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-217.messagelabs.com!1350684669!22192095!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25649 invoked from network); 19 Oct 2012 22:11:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKma-0005UT-PJ
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKma-0008Qf-FG
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:08 +0000
Message-Id: <E1TPKma-0008Qf-FG@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] ACPI: fix APEI related table size
	checking
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Huang Ying <ying.huang@intel.com>
# Date 1350401196 -7200
# Node ID 4fc87c2f31a02c770655518c9e4d389302564f00
# Parent  c1c549c4fe9ebdc460cbf51e296edad157b6e518
ACPI: fix APEI related table size checking

On Huang Ying's machine:

erst_tab->header_length == sizeof(struct acpi_table_einj)

but Yinghai reported that on his machine,

erst_tab->header_length == sizeof(struct acpi_table_einj) -
sizeof(struct acpi_table_header)

To make erst table size checking code works on all systems, both
testing are treated as PASS.

Same situation applies to einj_tab->header_length, so corresponding
table size checking is changed in similar way too.

Originally-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Huang Ying <ying.huang@intel.com>

- use switch() for better readability
- add comment explaining why a formally invalid size it also being
  accepted
- check erst_tab->header.length before even looking at
  erst_tab->header_length
- prefer sizeof(*erst_tab) over sizeof(struct acpi_table_erst)

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


diff -r c1c549c4fe9e -r 4fc87c2f31a0 xen/drivers/acpi/apei/erst.c
--- a/xen/drivers/acpi/apei/erst.c	Mon Oct 15 16:51:44 2012 +0100
+++ b/xen/drivers/acpi/apei/erst.c	Tue Oct 16 17:26:36 2012 +0200
@@ -715,12 +715,23 @@ int erst_clear(u64 record_id)
 
 static int __init erst_check_table(struct acpi_table_erst *erst_tab)
 {
-	if (erst_tab->header_length != sizeof(struct acpi_table_erst))
+	if (erst_tab->header.length < sizeof(*erst_tab))
 		return -EINVAL;
-	if (erst_tab->header.length < sizeof(struct acpi_table_erst))
+
+	switch (erst_tab->header_length) {
+	case sizeof(*erst_tab) - sizeof(erst_tab->header):
+	/*
+	 * While invalid per specification, there are (early?) systems
+	 * indicating the full header size here, so accept that value too.
+	 */
+	case sizeof(*erst_tab):
+		break;
+	default:
 		return -EINVAL;
+	}
+
 	if (erst_tab->entries !=
-	    (erst_tab->header.length - sizeof(struct acpi_table_erst)) /
+	    (erst_tab->header.length - sizeof(*erst_tab)) /
 	    sizeof(struct acpi_erst_entry))
 		return -EINVAL;
 

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmh-0008Dk-Np; Fri, 19 Oct 2012 22:11:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmf-0008D3-VL
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:14 +0000
Received: from [85.158.137.99:21663] by server-9.bemta-3.messagelabs.com id
	17/E5-16841-100D1805; Fri, 19 Oct 2012 22:11:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-217.messagelabs.com!1350684671!17569708!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21528 invoked from network); 19 Oct 2012 22:11:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmc-0005Uf-T2
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmc-0008Re-KB
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:10 +0000
Message-Id: <E1TPKmc-0008Re-KB@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: implement
	XENMEM_add_to_physmap_range
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1350488626 -3600
# Node ID bbe9860189490b04a20595328c391b40717fc9cd
# Parent  1f4be6ee4619c88c273cb457d8e7f1eee49d00dd
xen: arm: implement XENMEM_add_to_physmap_range

This allows for foreign mappings as well as batching, fitting all that
into XENMEM_add_to_physmap wasn't possible.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 1f4be6ee4619 -r bbe986018949 xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c	Wed Oct 17 14:13:20 2012 +0200
+++ b/xen/arch/arm/mm.c	Wed Oct 17 16:43:46 2012 +0100
@@ -25,6 +25,8 @@
 #include <xen/mm.h>
 #include <xen/preempt.h>
 #include <xen/errno.h>
+#include <xen/softirq.h>
+#include <xen/event.h>
 #include <xen/guest_access.h>
 #include <xen/domain_page.h>
 #include <asm/page.h>
@@ -459,37 +461,96 @@ void share_xen_page_with_guest(struct pa
     spin_unlock(&d->page_alloc_lock);
 }
 
-static int xenmem_add_to_physmap_once(
+static int xenmem_add_to_physmap_one(
     struct domain *d,
-    const struct xen_add_to_physmap *xatp)
+    uint16_t space,
+    domid_t foreign_domid,
+    unsigned long idx,
+    xen_pfn_t gpfn)
 {
     unsigned long mfn = 0;
     int rc;
 
-    switch ( xatp->space )
+    switch ( space )
     {
-        case XENMAPSPACE_shared_info:
-            if ( xatp->idx == 0 )
-                mfn = virt_to_mfn(d->shared_info);
-            break;
-        default:
-            return -ENOSYS;
+    case XENMAPSPACE_shared_info:
+        if ( idx == 0 )
+            mfn = virt_to_mfn(d->shared_info);
+        break;
+    case XENMAPSPACE_gmfn_foreign:
+    {
+        paddr_t maddr;
+        struct domain *od;
+        rc = rcu_lock_target_domain_by_id(foreign_domid, &od);
+        if ( rc < 0 )
+            return rc;
+
+        maddr = p2m_lookup(od, idx << PAGE_SHIFT);
+        if ( maddr == INVALID_PADDR )
+        {
+            dump_p2m_lookup(od, idx << PAGE_SHIFT);
+            rcu_unlock_domain(od);
+            return -EINVAL;
+        }
+
+        mfn = maddr >> PAGE_SHIFT;
+
+        rcu_unlock_domain(od);
+        break;
+    }
+
+    default:
+        return -ENOSYS;
     }
 
     domain_lock(d);
 
     /* Map at new location. */
-    rc = guest_physmap_add_page(d, xatp->gpfn, mfn, 0);
+    rc = guest_physmap_add_page(d, gpfn, mfn, 0);
 
     domain_unlock(d);
 
     return rc;
 }
 
-static int xenmem_add_to_physmap(struct domain *d,
-                                 struct xen_add_to_physmap *xatp)
+static int xenmem_add_to_physmap_range(struct domain *d,
+                                       struct xen_add_to_physmap_range *xatpr)
 {
-    return xenmem_add_to_physmap_once(d, xatp);
+    int rc;
+
+    /* Process entries in reverse order to allow continuations */
+    while ( xatpr->size > 0 )
+    {
+        xen_ulong_t idx;
+        xen_pfn_t gpfn;
+
+        rc = copy_from_guest_offset(&idx, xatpr->idxs, xatpr->size-1, 1);
+        if ( rc < 0 )
+            goto out;
+
+        rc = copy_from_guest_offset(&gpfn, xatpr->gpfns, xatpr->size-1, 1);
+        if ( rc < 0 )
+            goto out;
+
+        rc = xenmem_add_to_physmap_one(d, xatpr->space,
+                                       xatpr->foreign_domid,
+                                       idx, gpfn);
+
+        xatpr->size--;
+
+        /* Check for continuation if it's not the last interation */
+        if ( xatpr->size > 0 && hypercall_preempt_check() )
+        {
+            rc = -EAGAIN;
+            goto out;
+        }
+    }
+
+    rc = 0;
+
+out:
+    return rc;
+
 }
 
 long arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg)
@@ -506,17 +567,48 @@ long arch_memory_op(int op, XEN_GUEST_HA
         if ( copy_from_guest(&xatp, arg, 1) )
             return -EFAULT;
 
+        /* This one is only supported by add_to_physmap_range */
+        if ( xatp.space == XENMAPSPACE_gmfn_foreign )
+            return -EINVAL;
+
         rc = rcu_lock_target_domain_by_id(xatp.domid, &d);
         if ( rc != 0 )
             return rc;
 
-        rc = xenmem_add_to_physmap(d, &xatp);
+        rc = xenmem_add_to_physmap_one(d, xatp.space, DOMID_INVALID,
+                                       xatp.idx, xatp.gpfn);
 
         rcu_unlock_domain(d);
 
         return rc;
     }
 
+    case XENMEM_add_to_physmap_range:
+    {
+        struct xen_add_to_physmap_range xatpr;
+        struct domain *d;
+
+        if ( copy_from_guest(&xatpr, arg, 1) )
+            return -EFAULT;
+
+        rc = rcu_lock_target_domain_by_id(xatpr.domid, &d);
+        if ( rc != 0 )
+            return rc;
+
+        rc = xenmem_add_to_physmap_range(d, &xatpr);
+
+        rcu_unlock_domain(d);
+
+        if ( rc && copy_to_guest(arg, &xatpr, 1) )
+            rc = -EFAULT;
+
+        if ( rc == -EAGAIN )
+            rc = hypercall_create_continuation(
+                __HYPERVISOR_memory_op, "ih", op, arg);
+
+        return rc;
+    }
+
     default:
         return -ENOSYS;
     }
diff -r 1f4be6ee4619 -r bbe986018949 xen/include/public/memory.h
--- a/xen/include/public/memory.h	Wed Oct 17 14:13:20 2012 +0200
+++ b/xen/include/public/memory.h	Wed Oct 17 16:43:46 2012 +0100
@@ -198,6 +198,15 @@ struct xen_machphys_mapping {
 typedef struct xen_machphys_mapping xen_machphys_mapping_t;
 DEFINE_XEN_GUEST_HANDLE(xen_machphys_mapping_t);
 
+/* Source mapping space. */
+/* ` enum phys_map_space { */
+#define XENMAPSPACE_shared_info  0 /* shared info page */
+#define XENMAPSPACE_grant_table  1 /* grant table page */
+#define XENMAPSPACE_gmfn         2 /* GMFN */
+#define XENMAPSPACE_gmfn_range   3 /* GMFN range */
+#define XENMAPSPACE_gmfn_foreign 4 /* GMFN from another dom */
+/* ` } */
+
 /*
  * Sets the GPFN at which a particular page appears in the specified guest's
  * pseudophysical address space.
@@ -211,24 +220,39 @@ struct xen_add_to_physmap {
     /* Number of pages to go through for gmfn_range */
     uint16_t    size;
 
-    /* Source mapping space. */
-#define XENMAPSPACE_shared_info 0 /* shared info page */
-#define XENMAPSPACE_grant_table 1 /* grant table page */
-#define XENMAPSPACE_gmfn        2 /* GMFN */
-#define XENMAPSPACE_gmfn_range  3 /* GMFN range */
-    unsigned int space;
+    unsigned int space; /* => enum phys_map_space */
 
 #define XENMAPIDX_grant_table_status 0x80000000
 
-    /* Index into source mapping space. */
+    /* Index into space being mapped. */
     xen_ulong_t idx;
 
-    /* GPFN where the source mapping page should appear. */
+    /* GPFN in domid where the source mapping page should appear. */
     xen_pfn_t     gpfn;
 };
 typedef struct xen_add_to_physmap xen_add_to_physmap_t;
 DEFINE_XEN_GUEST_HANDLE(xen_add_to_physmap_t);
 
+/* A batched version of add_to_physmap. */
+#define XENMEM_add_to_physmap_range 23
+struct xen_add_to_physmap_range {
+    /* Which domain to change the mapping for. */
+    domid_t domid;
+    uint16_t space; /* => enum phys_map_space */
+
+    /* Number of pages to go through */
+    uint16_t size;
+    domid_t foreign_domid; /* IFF gmfn_foreign */
+
+    /* Indexes into space being mapped. */
+    XEN_GUEST_HANDLE(xen_ulong_t) idxs;
+
+    /* GPFN in domdwhere the source mapping page should appear. */
+    XEN_GUEST_HANDLE(xen_pfn_t) gpfns;
+};
+typedef struct xen_add_to_physmap_range xen_add_to_physmap_range_t;
+DEFINE_XEN_GUEST_HANDLE(xen_add_to_physmap_range_t);
+
 /*
  * Unmaps the page appearing at a particular GPFN from the specified guest's
  * pseudophysical address space.
diff -r 1f4be6ee4619 -r bbe986018949 xen/include/public/xen.h
--- a/xen/include/public/xen.h	Wed Oct 17 14:13:20 2012 +0200
+++ b/xen/include/public/xen.h	Wed Oct 17 16:43:46 2012 +0100
@@ -49,6 +49,7 @@ DEFINE_XEN_GUEST_HANDLE(void);
 
 DEFINE_XEN_GUEST_HANDLE(uint64_t);
 DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
+DEFINE_XEN_GUEST_HANDLE(xen_ulong_t);
 #endif
 
 /*

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmj-0008EJ-1w; Fri, 19 Oct 2012 22:11:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmh-0008DH-7q
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:15 +0000
Received: from [85.158.137.99:21700] by server-7.bemta-3.messagelabs.com id
	40/FD-06991-200D1805; Fri, 19 Oct 2012 22:11:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-217.messagelabs.com!1350684672!22323046!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32126 invoked from network); 19 Oct 2012 22:11:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKme-0005Uo-Cz
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKme-0008SP-8R
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:12 +0000
Message-Id: <E1TPKme-0008SP-8R@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: xen_ulong_t substitution
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1350488629 -3600
# Node ID a324eea3bbc87cdfb314ac4d09c67b58d18c3f4a
# Parent  980863b9fa4bb5c71a8831d7030816bd5cd8de57
xen: xen_ulong_t substitution

There is still an unwanted unsigned long in the xen public interface:
replace it with xen_ulong_t.

Also typedef xen_ulong_t to uint64_t on ARM.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 980863b9fa4b -r a324eea3bbc8 tools/python/xen/lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c	Wed Oct 17 16:43:48 2012 +0100
+++ b/tools/python/xen/lowlevel/xc/xc.c	Wed Oct 17 16:43:49 2012 +0100
@@ -1439,7 +1439,7 @@ static PyObject *pyxc_xeninfo(XcObject *
     if ( xc_version(self->xc_handle, XENVER_commandline, &xen_commandline) != 0 )
         return pyxc_error_to_exception(self->xc_handle);
 
-    snprintf(str, sizeof(str), "virt_start=0x%lx", p_parms.virt_start);
+    snprintf(str, sizeof(str), "virt_start=0x%"PRI_xen_ulong, p_parms.virt_start);
 
     xen_pagesize = xc_version(self->xc_handle, XENVER_pagesize, NULL);
     if (xen_pagesize < 0 )
diff -r 980863b9fa4b -r a324eea3bbc8 xen/include/public/arch-arm.h
--- a/xen/include/public/arch-arm.h	Wed Oct 17 16:43:48 2012 +0100
+++ b/xen/include/public/arch-arm.h	Wed Oct 17 16:43:49 2012 +0100
@@ -122,7 +122,8 @@ typedef uint64_t xen_pfn_t;
 /* Only one. All other VCPUS must use VCPUOP_register_vcpu_info */
 #define XEN_LEGACY_MAX_VCPUS 1
 
-typedef uint32_t xen_ulong_t;
+typedef uint64_t xen_ulong_t;
+#define PRI_xen_ulong PRIx64
 
 struct vcpu_guest_context {
 #define _VGCF_online                   0
diff -r 980863b9fa4b -r a324eea3bbc8 xen/include/public/arch-x86/xen.h
--- a/xen/include/public/arch-x86/xen.h	Wed Oct 17 16:43:48 2012 +0100
+++ b/xen/include/public/arch-x86/xen.h	Wed Oct 17 16:43:49 2012 +0100
@@ -85,6 +85,7 @@ typedef unsigned long xen_pfn_t;
 #ifndef __ASSEMBLY__
 
 typedef unsigned long xen_ulong_t;
+#define PRI_xen_ulong "lx"
 
 /*
  * ` enum neg_errnoval
diff -r 980863b9fa4b -r a324eea3bbc8 xen/include/public/version.h
--- a/xen/include/public/version.h	Wed Oct 17 16:43:48 2012 +0100
+++ b/xen/include/public/version.h	Wed Oct 17 16:43:49 2012 +0100
@@ -28,6 +28,8 @@
 #ifndef __XEN_PUBLIC_VERSION_H__
 #define __XEN_PUBLIC_VERSION_H__
 
+#include "xen.h"
+
 /* NB. All ops return zero on success, except XENVER_{version,pagesize} */
 
 /* arg == NULL; returns major:minor (16:16). */
@@ -58,7 +60,7 @@ typedef char xen_changeset_info_t[64];
 
 #define XENVER_platform_parameters 5
 struct xen_platform_parameters {
-    unsigned long virt_start;
+    xen_ulong_t virt_start;
 };
 typedef struct xen_platform_parameters xen_platform_parameters_t;
 

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmk-0008Ei-7k; Fri, 19 Oct 2012 22:11:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmi-0008Ds-HO
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:16 +0000
Received: from [85.158.143.99:31893] by server-1.bemta-4.messagelabs.com id
	7E/6B-19134-300D1805; Fri, 19 Oct 2012 22:11:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1350684673!34491807!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15745 invoked from network); 19 Oct 2012 22:11:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmf-0005Uu-BU
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmf-0008St-A3
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:13 +0000
Message-Id: <E1TPKmf-0008St-A3@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: introduce XEN_GUEST_HANDLE_PARAM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1350488631 -3600
# Node ID 1eb4b2f7465f8c7c15fe1d6a198d53dda30372a9
# Parent  ed6c135011958a18c0392713f9a357d3281546a7
xen: introduce XEN_GUEST_HANDLE_PARAM

XEN_GUEST_HANDLE_PARAM is going to be used to distinguish guest pointers
stored in memory from guest pointers as hypercall parameters.

guest_handle_* macros default to XEN_GUEST_HANDLE_PARAM as return type.
Two new guest_handle_to_param and guest_handle_from_param macros are
introduced to do conversions.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r ed6c13501195 -r 1eb4b2f7465f xen/include/asm-arm/guest_access.h
--- a/xen/include/asm-arm/guest_access.h	Wed Oct 17 16:43:50 2012 +0100
+++ b/xen/include/asm-arm/guest_access.h	Wed Oct 17 16:43:51 2012 +0100
@@ -27,16 +27,40 @@ unsigned long raw_clear_guest(void *to, 
 #define guest_handle_add_offset(hnd, nr) ((hnd).p += (nr))
 #define guest_handle_subtract_offset(hnd, nr) ((hnd).p -= (nr))
 
-/* Cast a guest handle to the specified type of handle. */
+/* Cast a guest handle (either XEN_GUEST_HANDLE or XEN_GUEST_HANDLE_PARAM)
+ * to the specified type of XEN_GUEST_HANDLE_PARAM. */
 #define guest_handle_cast(hnd, type) ({         \
     type *_x = (hnd).p;                         \
-    (XEN_GUEST_HANDLE(type)) { _x };            \
+    (XEN_GUEST_HANDLE_PARAM(type)) { _x };            \
+})
+
+/* Cast a XEN_GUEST_HANDLE to XEN_GUEST_HANDLE_PARAM */
+#define guest_handle_to_param(hnd, type) ({                  \
+    typeof((hnd).p) _x = (hnd).p;                            \
+    XEN_GUEST_HANDLE_PARAM(type) _y = { _x };                \
+    /* type checking: make sure that the pointers inside     \
+     * XEN_GUEST_HANDLE and XEN_GUEST_HANDLE_PARAM are of    \
+     * the same type, then return hnd */                     \
+    (void)(&_x == &_y.p);                                    \
+    _y;                                                      \
+})
+
+
+/* Cast a XEN_GUEST_HANDLE_PARAM to XEN_GUEST_HANDLE */
+#define guest_handle_from_param(hnd, type) ({               \
+    typeof((hnd).p) _x = (hnd).p;                           \
+    XEN_GUEST_HANDLE(type) _y = { _x };                     \
+    /* type checking: make sure that the pointers inside    \
+     * XEN_GUEST_HANDLE and XEN_GUEST_HANDLE_PARAM are of   \
+     * the same type, then return hnd */                    \
+    (void)(&_x == &_y.p);                                   \
+    _y;                                                     \
 })
 
 #define guest_handle_from_ptr(ptr, type)        \
-    ((XEN_GUEST_HANDLE(type)) { (type *)ptr })
+    ((XEN_GUEST_HANDLE_PARAM(type)) { (type *)ptr })
 #define const_guest_handle_from_ptr(ptr, type)  \
-    ((XEN_GUEST_HANDLE(const_##type)) { (const type *)ptr })
+    ((XEN_GUEST_HANDLE_PARAM(const_##type)) { (const type *)ptr })
 
 /*
  * Copy an array of objects to guest context via a guest handle,
diff -r ed6c13501195 -r 1eb4b2f7465f xen/include/asm-x86/guest_access.h
--- a/xen/include/asm-x86/guest_access.h	Wed Oct 17 16:43:50 2012 +0100
+++ b/xen/include/asm-x86/guest_access.h	Wed Oct 17 16:43:51 2012 +0100
@@ -45,19 +45,40 @@
 #define guest_handle_add_offset(hnd, nr) ((hnd).p += (nr))
 #define guest_handle_subtract_offset(hnd, nr) ((hnd).p -= (nr))
 
-/* Cast a guest handle to the specified type of handle. */
+/* Cast a guest handle (either XEN_GUEST_HANDLE or XEN_GUEST_HANDLE_PARAM)
+ * to the specified type of XEN_GUEST_HANDLE_PARAM. */
 #define guest_handle_cast(hnd, type) ({         \
     type *_x = (hnd).p;                         \
-    (XEN_GUEST_HANDLE(type)) { _x };            \
+    (XEN_GUEST_HANDLE_PARAM(type)) { _x };            \
+})
+
+/* Cast a XEN_GUEST_HANDLE to XEN_GUEST_HANDLE_PARAM */
+#define guest_handle_to_param(hnd, type) ({                  \
+    /* type checking: make sure that the pointers inside     \
+     * XEN_GUEST_HANDLE and XEN_GUEST_HANDLE_PARAM are of    \
+     * the same type, then return hnd */                     \
+    (void)((typeof(&(hnd).p)) 0 ==                           \
+        (typeof(&((XEN_GUEST_HANDLE_PARAM(type)) {}).p)) 0); \
+    (hnd);                                                   \
+})
+
+/* Cast a XEN_GUEST_HANDLE_PARAM to XEN_GUEST_HANDLE */
+#define guest_handle_from_param(hnd, type) ({                \
+    /* type checking: make sure that the pointers inside     \
+     * XEN_GUEST_HANDLE and XEN_GUEST_HANDLE_PARAM are of    \
+     * the same type, then return hnd */                     \
+    (void)((typeof(&(hnd).p)) 0 ==                           \
+        (typeof(&((XEN_GUEST_HANDLE_PARAM(type)) {}).p)) 0); \
+    (hnd);                                                   \
 })
 
 #define guest_handle_for_field(hnd, type, fld)          \
     ((XEN_GUEST_HANDLE(type)) { &(hnd).p->fld })
 
 #define guest_handle_from_ptr(ptr, type)        \
-    ((XEN_GUEST_HANDLE(type)) { (type *)ptr })
+    ((XEN_GUEST_HANDLE_PARAM(type)) { (type *)ptr })
 #define const_guest_handle_from_ptr(ptr, type)  \
-    ((XEN_GUEST_HANDLE(const_##type)) { (const type *)ptr })
+    ((XEN_GUEST_HANDLE_PARAM(const_##type)) { (const type *)ptr })
 
 /*
  * Copy an array of objects to guest context via a guest handle,
diff -r ed6c13501195 -r 1eb4b2f7465f xen/include/public/arch-arm.h
--- a/xen/include/public/arch-arm.h	Wed Oct 17 16:43:50 2012 +0100
+++ b/xen/include/public/arch-arm.h	Wed Oct 17 16:43:51 2012 +0100
@@ -51,18 +51,36 @@
 
 #define XEN_HYPERCALL_TAG   0XEA1
 
+#define uint64_aligned_t uint64_t __attribute__((aligned(8)))
 
 #ifndef __ASSEMBLY__
-#define ___DEFINE_XEN_GUEST_HANDLE(name, type) \
-    typedef struct { type *p; } __guest_handle_ ## name
+#define ___DEFINE_XEN_GUEST_HANDLE(name, type)                  \
+    typedef union { type *p; unsigned long q; }                 \
+        __guest_handle_ ## name;                                \
+    typedef union { type *p; uint64_aligned_t q; }              \
+        __guest_handle_64_ ## name;
 
+/*
+ * XEN_GUEST_HANDLE represents a guest pointer, when passed as a field
+ * in a struct in memory. On ARM is always 8 bytes sizes and 8 bytes
+ * aligned.
+ * XEN_GUEST_HANDLE_PARAM represent a guest pointer, when passed as an
+ * hypercall argument. It is 4 bytes on aarch and 8 bytes on aarch64.
+ */
 #define __DEFINE_XEN_GUEST_HANDLE(name, type) \
     ___DEFINE_XEN_GUEST_HANDLE(name, type);   \
     ___DEFINE_XEN_GUEST_HANDLE(const_##name, const type)
 #define DEFINE_XEN_GUEST_HANDLE(name)   __DEFINE_XEN_GUEST_HANDLE(name, name)
-#define __XEN_GUEST_HANDLE(name)        __guest_handle_ ## name
+#define __XEN_GUEST_HANDLE(name)        __guest_handle_64_ ## name
 #define XEN_GUEST_HANDLE(name)          __XEN_GUEST_HANDLE(name)
-#define set_xen_guest_handle_raw(hnd, val)  do { (hnd).p = val; } while (0)
+/* this is going to be changed on 64 bit */
+#define XEN_GUEST_HANDLE_PARAM(name)   XEN_GUEST_HANDLE(name)
+#define set_xen_guest_handle_raw(hnd, val)                  \
+    do {                                                    \
+        typeof(&(hnd)) _sxghr_tmp = &(hnd);                 \
+        _sxghr_tmp->q = 0;                                  \
+        _sxghr_tmp->p = val;                                \
+    } while ( 0 )
 #ifdef __XEN_TOOLS__
 #define get_xen_guest_handle(val, hnd)  do { val = (hnd).p; } while (0)
 #endif
diff -r ed6c13501195 -r 1eb4b2f7465f xen/include/public/arch-x86/xen.h
--- a/xen/include/public/arch-x86/xen.h	Wed Oct 17 16:43:50 2012 +0100
+++ b/xen/include/public/arch-x86/xen.h	Wed Oct 17 16:43:51 2012 +0100
@@ -38,12 +38,21 @@
     typedef type * __guest_handle_ ## name
 #endif
 
+/*
+ * XEN_GUEST_HANDLE represents a guest pointer, when passed as a field
+ * in a struct in memory.
+ * XEN_GUEST_HANDLE_PARAM represent a guest pointer, when passed as an
+ * hypercall argument.
+ * XEN_GUEST_HANDLE_PARAM and XEN_GUEST_HANDLE are the same on X86 but
+ * they might not be on other architectures.
+ */
 #define __DEFINE_XEN_GUEST_HANDLE(name, type) \
     ___DEFINE_XEN_GUEST_HANDLE(name, type);   \
     ___DEFINE_XEN_GUEST_HANDLE(const_##name, const type)
 #define DEFINE_XEN_GUEST_HANDLE(name)   __DEFINE_XEN_GUEST_HANDLE(name, name)
 #define __XEN_GUEST_HANDLE(name)        __guest_handle_ ## name
 #define XEN_GUEST_HANDLE(name)          __XEN_GUEST_HANDLE(name)
+#define XEN_GUEST_HANDLE_PARAM(name)    XEN_GUEST_HANDLE(name)
 #define set_xen_guest_handle_raw(hnd, val)  do { (hnd).p = val; } while (0)
 #ifdef __XEN_TOOLS__
 #define get_xen_guest_handle(val, hnd)  do { val = (hnd).p; } while (0)
diff -r ed6c13501195 -r 1eb4b2f7465f xen/include/xen/xencomm.h
--- a/xen/include/xen/xencomm.h	Wed Oct 17 16:43:50 2012 +0100
+++ b/xen/include/xen/xencomm.h	Wed Oct 17 16:43:51 2012 +0100
@@ -66,11 +66,31 @@ static inline unsigned long xencomm_inli
 /* Cast a guest handle to the specified type of handle. */
 #define guest_handle_cast(hnd, type) ({         \
     type *_x = (hnd).p;                         \
-    XEN_GUEST_HANDLE(type) _y;                  \
+    XEN_GUEST_HANDLE_PARAM(type) _y;            \
     set_xen_guest_handle(_y, _x);               \
     _y;                                         \
 })
 
+/* Cast a XEN_GUEST_HANDLE to XEN_GUEST_HANDLE_PARAM */
+#define guest_handle_to_param(hnd, type) ({                  \
+    /* type checking: make sure that the pointers inside     \
+     * XEN_GUEST_HANDLE and XEN_GUEST_HANDLE_PARAM are of    \
+     * the same type, then return hnd */                     \
+    (void)((typeof(&(hnd).p)) 0 ==                           \
+        (typeof(&((XEN_GUEST_HANDLE_PARAM(type)) {}).p)) 0); \
+    (hnd);                                                   \
+})
+
+/* Cast a XEN_GUEST_HANDLE_PARAM to XEN_GUEST_HANDLE */
+#define guest_handle_from_param(hnd, type) ({                \
+    /* type checking: make sure that the pointers inside     \
+     * XEN_GUEST_HANDLE and XEN_GUEST_HANDLE_PARAM are of    \
+     * the same type, then return hnd */                     \
+    (void)((typeof(&(hnd).p)) 0 ==                           \
+        (typeof(&((XEN_GUEST_HANDLE_PARAM(type)) {}).p)) 0); \
+    (hnd);                                                   \
+})
+
 /* Since we run in real mode, we can safely access all addresses. That also
  * means our __routines are identical to our "normal" routines. */
 #define guest_handle_okay(hnd, nr) 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 19 22:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmk-0008Ec-4p; Fri, 19 Oct 2012 22:11:18 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmi-0008Dj-Ar
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:16 +0000
Received: from [193.109.254.147:30043] by server-7.bemta-14.messagelabs.com id
	99/46-24122-300D1805; Fri, 19 Oct 2012 22:11:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-27.messagelabs.com!1350684671!5539672!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10348 invoked from network); 19 Oct 2012 22:11:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmd-0005Ui-Af
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmd-0008Rt-5Z
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:11 +0000
Message-Id: <E1TPKmd-0008Rt-5Z@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen/arm: grant table
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1350488627 -3600
# Node ID b146705d70b3c8e135cfc06a38875e45fd34d638
# Parent  bbe9860189490b04a20595328c391b40717fc9cd
xen/arm: grant table

Implement XENMAPSPACE_grant_table and grant_table_op.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
[ ijc -- fixed reject in traps.c, grant table op is a 3 argument
         hypercall, rebased over "xen: arm: implement
         XENMEM_add_to_physmap_range"
]
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r bbe986018949 -r b146705d70b3 xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c	Wed Oct 17 16:43:46 2012 +0100
+++ b/xen/arch/arm/mm.c	Wed Oct 17 16:43:47 2012 +0100
@@ -25,6 +25,7 @@
 #include <xen/mm.h>
 #include <xen/preempt.h>
 #include <xen/errno.h>
+#include <xen/grant_table.h>
 #include <xen/softirq.h>
 #include <xen/event.h>
 #include <xen/guest_access.h>
@@ -473,6 +474,31 @@ static int xenmem_add_to_physmap_one(
 
     switch ( space )
     {
+    case XENMAPSPACE_grant_table:
+        spin_lock(&d->grant_table->lock);
+
+        if ( d->grant_table->gt_version == 0 )
+            d->grant_table->gt_version = 1;
+
+        if ( d->grant_table->gt_version == 2 &&
+                (idx & XENMAPIDX_grant_table_status) )
+        {
+            idx &= ~XENMAPIDX_grant_table_status;
+            if ( idx < nr_status_frames(d->grant_table) )
+                mfn = virt_to_mfn(d->grant_table->status[idx]);
+        }
+        else
+        {
+            if ( (idx >= nr_grant_frames(d->grant_table)) &&
+                    (idx < max_nr_grant_frames) )
+                gnttab_grow_table(d, idx + 1);
+
+            if ( idx < nr_grant_frames(d->grant_table) )
+                mfn = virt_to_mfn(d->grant_table->shared_raw[idx]);
+        }
+
+        spin_unlock(&d->grant_table->lock);
+        break;
     case XENMAPSPACE_shared_info:
         if ( idx == 0 )
             mfn = virt_to_mfn(d->shared_info);
diff -r bbe986018949 -r b146705d70b3 xen/arch/arm/traps.c
--- a/xen/arch/arm/traps.c	Wed Oct 17 16:43:46 2012 +0100
+++ b/xen/arch/arm/traps.c	Wed Oct 17 16:43:47 2012 +0100
@@ -438,6 +438,7 @@ static arm_hypercall_t arm_hypercall_tab
     HYPERCALL(physdev_op, 2),
     HYPERCALL(sysctl, 2),
     HYPERCALL(hvm_op, 2),
+    HYPERCALL(grant_table_op, 3),
 };
 
 static void do_debug_trap(struct cpu_user_regs *regs, unsigned int code)

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmk-0008F1-DD; Fri, 19 Oct 2012 22:11:18 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmj-0008Dj-7m
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:17 +0000
Received: from [193.109.254.147:11077] by server-7.bemta-14.messagelabs.com id
	5B/46-24122-400D1805; Fri, 19 Oct 2012 22:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1350684675!15309709!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26104 invoked from network); 19 Oct 2012 22:11:15 -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;
	19 Oct 2012 22:11:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmg-0005V0-NW
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmg-0008TN-KW
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:14 +0000
Message-Id: <E1TPKmg-0008TN-KW@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: more XEN_GUEST_HANDLE_PARAM
	substitutions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1350488633 -3600
# Node ID 2a1083b1d0c24f943a1e0bca335fc11aabf6536e
# Parent  9eafdcd5ff0b55acaf65dd482179a3ca1db78482
xen: more XEN_GUEST_HANDLE_PARAM substitutions

More substitutions in this patch, not as obvious as the ones in the
previous patch.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 9eafdcd5ff0b -r 2a1083b1d0c2 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Wed Oct 17 16:43:53 2012 +0100
+++ b/xen/arch/x86/mm.c	Wed Oct 17 16:43:53 2012 +0100
@@ -2913,7 +2913,9 @@ long do_mmuext_op(
         {
             cpumask_t pmask;
 
-            if ( unlikely(vcpumask_to_pcpumask(d, op.arg2.vcpumask, &pmask)) )
+            if ( unlikely(vcpumask_to_pcpumask(d,
+                            guest_handle_to_param(op.arg2.vcpumask, const_void),
+                            &pmask)) )
             {
                 okay = 0;
                 break;
@@ -4195,6 +4197,7 @@ static int handle_iomem_range(unsigned l
     if ( s > ctxt->s )
     {
         e820entry_t ent;
+        XEN_GUEST_HANDLE_PARAM(e820entry_t) buffer_param;
         XEN_GUEST_HANDLE(e820entry_t) buffer;
 
         if ( ctxt->n + 1 >= ctxt->map.nr_entries )
@@ -4202,7 +4205,8 @@ static int handle_iomem_range(unsigned l
         ent.addr = (uint64_t)ctxt->s << PAGE_SHIFT;
         ent.size = (uint64_t)(s - ctxt->s) << PAGE_SHIFT;
         ent.type = E820_RESERVED;
-        buffer = guest_handle_cast(ctxt->map.buffer, e820entry_t);
+        buffer_param = guest_handle_cast(ctxt->map.buffer, e820entry_t);
+        buffer = guest_handle_from_param(buffer_param, e820entry_t);
         if ( __copy_to_guest_offset(buffer, ctxt->n, &ent, 1) )
             return -EFAULT;
         ctxt->n++;
@@ -4499,6 +4503,7 @@ long arch_memory_op(int op, XEN_GUEST_HA
     {
         struct memory_map_context ctxt;
         XEN_GUEST_HANDLE(e820entry_t) buffer;
+        XEN_GUEST_HANDLE_PARAM(e820entry_t) buffer_param;
         unsigned int i;
 
         if ( !IS_PRIV(current->domain) )
@@ -4513,7 +4518,8 @@ long arch_memory_op(int op, XEN_GUEST_HA
         if ( ctxt.map.nr_entries < e820.nr_map + 1 )
             return -EINVAL;
 
-        buffer = guest_handle_cast(ctxt.map.buffer, e820entry_t);
+        buffer_param = guest_handle_cast(ctxt.map.buffer, e820entry_t);
+        buffer = guest_handle_from_param(buffer_param, e820entry_t);
         if ( !guest_handle_okay(buffer, ctxt.map.nr_entries) )
             return -EFAULT;
 
diff -r 9eafdcd5ff0b -r 2a1083b1d0c2 xen/arch/x86/oprofile/backtrace.c
--- a/xen/arch/x86/oprofile/backtrace.c	Wed Oct 17 16:43:53 2012 +0100
+++ b/xen/arch/x86/oprofile/backtrace.c	Wed Oct 17 16:43:53 2012 +0100
@@ -74,8 +74,11 @@ dump_guest_backtrace(struct vcpu *vcpu, 
     }
     else
     {
-        XEN_GUEST_HANDLE(const_frame_head_t) guest_head =
+        XEN_GUEST_HANDLE(const_frame_head_t) guest_head;
+        XEN_GUEST_HANDLE_PARAM(const_frame_head_t) guest_head_param =
             const_guest_handle_from_ptr(head, frame_head_t);
+        guest_head = guest_handle_from_param(guest_head_param,
+					     const_frame_head_t);
 
         /* Also check accessibility of one struct frame_head beyond */
         if (!guest_handle_okay(guest_head, 2))
diff -r 9eafdcd5ff0b -r 2a1083b1d0c2 xen/arch/x86/platform_hypercall.c
--- a/xen/arch/x86/platform_hypercall.c	Wed Oct 17 16:43:53 2012 +0100
+++ b/xen/arch/x86/platform_hypercall.c	Wed Oct 17 16:43:53 2012 +0100
@@ -61,7 +61,7 @@ long cpu_down_helper(void *data);
 long core_parking_helper(void *data);
 uint32_t get_cur_idle_nums(void);
 
-ret_t do_platform_op(XEN_GUEST_HANDLE(xen_platform_op_t) u_xenpf_op)
+ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
 {
     ret_t ret = 0;
     struct xen_platform_op curop, *op = &curop;
@@ -186,7 +186,9 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe
             }
         }
 
-        ret = microcode_update(data, op->u.microcode.length);
+        ret = microcode_update(
+                guest_handle_to_param(data, const_void),
+                op->u.microcode.length);
         spin_unlock(&vcpu_alloc_lock);
     }
     break;
@@ -454,7 +456,9 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe
             XEN_GUEST_HANDLE(uint32) pdc;
 
             guest_from_compat_handle(pdc, op->u.set_pminfo.u.pdc);
-            ret = acpi_set_pdc_bits(op->u.set_pminfo.id, pdc);
+            ret = acpi_set_pdc_bits(
+                    op->u.set_pminfo.id,
+                    guest_handle_to_param(pdc, uint32));
         }
         break;
 
diff -r 9eafdcd5ff0b -r 2a1083b1d0c2 xen/arch/x86/x86_64/cpu_idle.c
--- a/xen/arch/x86/x86_64/cpu_idle.c	Wed Oct 17 16:43:53 2012 +0100
+++ b/xen/arch/x86/x86_64/cpu_idle.c	Wed Oct 17 16:43:53 2012 +0100
@@ -57,10 +57,12 @@ static int copy_from_compat_state(xen_pr
 {
 #define XLAT_processor_cx_HNDL_dp(_d_, _s_) do { \
     XEN_GUEST_HANDLE(compat_processor_csd_t) dps; \
+    XEN_GUEST_HANDLE_PARAM(xen_processor_csd_t) dps_param; \
     if ( unlikely(!compat_handle_okay((_s_)->dp, (_s_)->dpcnt)) ) \
             return -EFAULT; \
     guest_from_compat_handle(dps, (_s_)->dp); \
-    (_d_)->dp = guest_handle_cast(dps, xen_processor_csd_t); \
+    dps_param = guest_handle_cast(dps, xen_processor_csd_t); \
+    (_d_)->dp = guest_handle_from_param(dps_param, xen_processor_csd_t); \
 } while (0)
     XLAT_processor_cx(xen_state, state);
 #undef XLAT_processor_cx_HNDL_dp
diff -r 9eafdcd5ff0b -r 2a1083b1d0c2 xen/arch/x86/x86_64/cpufreq.c
--- a/xen/arch/x86/x86_64/cpufreq.c	Wed Oct 17 16:43:53 2012 +0100
+++ b/xen/arch/x86/x86_64/cpufreq.c	Wed Oct 17 16:43:53 2012 +0100
@@ -45,10 +45,12 @@ compat_set_px_pminfo(uint32_t cpu, struc
 
 #define XLAT_processor_performance_HNDL_states(_d_, _s_) do { \
     XEN_GUEST_HANDLE(compat_processor_px_t) states; \
+    XEN_GUEST_HANDLE_PARAM(xen_processor_px_t) states_t; \
     if ( unlikely(!compat_handle_okay((_s_)->states, (_s_)->state_count)) ) \
         return -EFAULT; \
     guest_from_compat_handle(states, (_s_)->states); \
-    (_d_)->states = guest_handle_cast(states, xen_processor_px_t); \
+    states_t = guest_handle_cast(states, xen_processor_px_t); \
+    (_d_)->states = guest_handle_from_param(states_t, xen_processor_px_t); \
 } while (0)
 
     XLAT_processor_performance(xen_perf, perf);
diff -r 9eafdcd5ff0b -r 2a1083b1d0c2 xen/arch/x86/x86_64/platform_hypercall.c
--- a/xen/arch/x86/x86_64/platform_hypercall.c	Wed Oct 17 16:43:53 2012 +0100
+++ b/xen/arch/x86/x86_64/platform_hypercall.c	Wed Oct 17 16:43:53 2012 +0100
@@ -38,6 +38,7 @@ CHECK_pf_pcpu_version;
 
 #define COMPAT
 #define _XEN_GUEST_HANDLE(t) XEN_GUEST_HANDLE(t)
+#define _XEN_GUEST_HANDLE_PARAM(t) XEN_GUEST_HANDLE_PARAM(t)
 typedef int ret_t;
 
 #include "../platform_hypercall.c"
diff -r 9eafdcd5ff0b -r 2a1083b1d0c2 xen/common/compat/multicall.c
--- a/xen/common/compat/multicall.c	Wed Oct 17 16:43:53 2012 +0100
+++ b/xen/common/compat/multicall.c	Wed Oct 17 16:43:53 2012 +0100
@@ -25,6 +25,7 @@ DEFINE_XEN_GUEST_HANDLE(multicall_entry_
 #define call                 compat_call
 #define do_multicall(l, n)   compat_multicall(_##l, n)
 #define _XEN_GUEST_HANDLE(t) XEN_GUEST_HANDLE(t)
+#define _XEN_GUEST_HANDLE_PARAM(t) XEN_GUEST_HANDLE(t)
 
 static void __trace_multicall_call(multicall_entry_t *call)
 {
diff -r 9eafdcd5ff0b -r 2a1083b1d0c2 xen/common/multicall.c
--- a/xen/common/multicall.c	Wed Oct 17 16:43:53 2012 +0100
+++ b/xen/common/multicall.c	Wed Oct 17 16:43:53 2012 +0100
@@ -35,7 +35,7 @@ static void trace_multicall_call(multica
 
 ret_t
 do_multicall(
-    XEN_GUEST_HANDLE(multicall_entry_t) call_list, unsigned int nr_calls)
+    XEN_GUEST_HANDLE_PARAM(multicall_entry_t) call_list, unsigned int nr_calls)
 {
     struct mc_state *mcs = &current->mc_state;
     unsigned int     i;

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmj-0008EJ-1w; Fri, 19 Oct 2012 22:11:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmh-0008DH-7q
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:15 +0000
Received: from [85.158.137.99:21700] by server-7.bemta-3.messagelabs.com id
	40/FD-06991-200D1805; Fri, 19 Oct 2012 22:11:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-217.messagelabs.com!1350684672!22323046!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32126 invoked from network); 19 Oct 2012 22:11:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKme-0005Uo-Cz
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKme-0008SP-8R
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:12 +0000
Message-Id: <E1TPKme-0008SP-8R@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: xen_ulong_t substitution
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1350488629 -3600
# Node ID a324eea3bbc87cdfb314ac4d09c67b58d18c3f4a
# Parent  980863b9fa4bb5c71a8831d7030816bd5cd8de57
xen: xen_ulong_t substitution

There is still an unwanted unsigned long in the xen public interface:
replace it with xen_ulong_t.

Also typedef xen_ulong_t to uint64_t on ARM.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 980863b9fa4b -r a324eea3bbc8 tools/python/xen/lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c	Wed Oct 17 16:43:48 2012 +0100
+++ b/tools/python/xen/lowlevel/xc/xc.c	Wed Oct 17 16:43:49 2012 +0100
@@ -1439,7 +1439,7 @@ static PyObject *pyxc_xeninfo(XcObject *
     if ( xc_version(self->xc_handle, XENVER_commandline, &xen_commandline) != 0 )
         return pyxc_error_to_exception(self->xc_handle);
 
-    snprintf(str, sizeof(str), "virt_start=0x%lx", p_parms.virt_start);
+    snprintf(str, sizeof(str), "virt_start=0x%"PRI_xen_ulong, p_parms.virt_start);
 
     xen_pagesize = xc_version(self->xc_handle, XENVER_pagesize, NULL);
     if (xen_pagesize < 0 )
diff -r 980863b9fa4b -r a324eea3bbc8 xen/include/public/arch-arm.h
--- a/xen/include/public/arch-arm.h	Wed Oct 17 16:43:48 2012 +0100
+++ b/xen/include/public/arch-arm.h	Wed Oct 17 16:43:49 2012 +0100
@@ -122,7 +122,8 @@ typedef uint64_t xen_pfn_t;
 /* Only one. All other VCPUS must use VCPUOP_register_vcpu_info */
 #define XEN_LEGACY_MAX_VCPUS 1
 
-typedef uint32_t xen_ulong_t;
+typedef uint64_t xen_ulong_t;
+#define PRI_xen_ulong PRIx64
 
 struct vcpu_guest_context {
 #define _VGCF_online                   0
diff -r 980863b9fa4b -r a324eea3bbc8 xen/include/public/arch-x86/xen.h
--- a/xen/include/public/arch-x86/xen.h	Wed Oct 17 16:43:48 2012 +0100
+++ b/xen/include/public/arch-x86/xen.h	Wed Oct 17 16:43:49 2012 +0100
@@ -85,6 +85,7 @@ typedef unsigned long xen_pfn_t;
 #ifndef __ASSEMBLY__
 
 typedef unsigned long xen_ulong_t;
+#define PRI_xen_ulong "lx"
 
 /*
  * ` enum neg_errnoval
diff -r 980863b9fa4b -r a324eea3bbc8 xen/include/public/version.h
--- a/xen/include/public/version.h	Wed Oct 17 16:43:48 2012 +0100
+++ b/xen/include/public/version.h	Wed Oct 17 16:43:49 2012 +0100
@@ -28,6 +28,8 @@
 #ifndef __XEN_PUBLIC_VERSION_H__
 #define __XEN_PUBLIC_VERSION_H__
 
+#include "xen.h"
+
 /* NB. All ops return zero on success, except XENVER_{version,pagesize} */
 
 /* arg == NULL; returns major:minor (16:16). */
@@ -58,7 +60,7 @@ typedef char xen_changeset_info_t[64];
 
 #define XENVER_platform_parameters 5
 struct xen_platform_parameters {
-    unsigned long virt_start;
+    xen_ulong_t virt_start;
 };
 typedef struct xen_platform_parameters xen_platform_parameters_t;
 

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmk-0008Ei-7k; Fri, 19 Oct 2012 22:11:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmi-0008Ds-HO
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:16 +0000
Received: from [85.158.143.99:31893] by server-1.bemta-4.messagelabs.com id
	7E/6B-19134-300D1805; Fri, 19 Oct 2012 22:11:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1350684673!34491807!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15745 invoked from network); 19 Oct 2012 22:11:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmf-0005Uu-BU
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmf-0008St-A3
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:13 +0000
Message-Id: <E1TPKmf-0008St-A3@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: introduce XEN_GUEST_HANDLE_PARAM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1350488631 -3600
# Node ID 1eb4b2f7465f8c7c15fe1d6a198d53dda30372a9
# Parent  ed6c135011958a18c0392713f9a357d3281546a7
xen: introduce XEN_GUEST_HANDLE_PARAM

XEN_GUEST_HANDLE_PARAM is going to be used to distinguish guest pointers
stored in memory from guest pointers as hypercall parameters.

guest_handle_* macros default to XEN_GUEST_HANDLE_PARAM as return type.
Two new guest_handle_to_param and guest_handle_from_param macros are
introduced to do conversions.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r ed6c13501195 -r 1eb4b2f7465f xen/include/asm-arm/guest_access.h
--- a/xen/include/asm-arm/guest_access.h	Wed Oct 17 16:43:50 2012 +0100
+++ b/xen/include/asm-arm/guest_access.h	Wed Oct 17 16:43:51 2012 +0100
@@ -27,16 +27,40 @@ unsigned long raw_clear_guest(void *to, 
 #define guest_handle_add_offset(hnd, nr) ((hnd).p += (nr))
 #define guest_handle_subtract_offset(hnd, nr) ((hnd).p -= (nr))
 
-/* Cast a guest handle to the specified type of handle. */
+/* Cast a guest handle (either XEN_GUEST_HANDLE or XEN_GUEST_HANDLE_PARAM)
+ * to the specified type of XEN_GUEST_HANDLE_PARAM. */
 #define guest_handle_cast(hnd, type) ({         \
     type *_x = (hnd).p;                         \
-    (XEN_GUEST_HANDLE(type)) { _x };            \
+    (XEN_GUEST_HANDLE_PARAM(type)) { _x };            \
+})
+
+/* Cast a XEN_GUEST_HANDLE to XEN_GUEST_HANDLE_PARAM */
+#define guest_handle_to_param(hnd, type) ({                  \
+    typeof((hnd).p) _x = (hnd).p;                            \
+    XEN_GUEST_HANDLE_PARAM(type) _y = { _x };                \
+    /* type checking: make sure that the pointers inside     \
+     * XEN_GUEST_HANDLE and XEN_GUEST_HANDLE_PARAM are of    \
+     * the same type, then return hnd */                     \
+    (void)(&_x == &_y.p);                                    \
+    _y;                                                      \
+})
+
+
+/* Cast a XEN_GUEST_HANDLE_PARAM to XEN_GUEST_HANDLE */
+#define guest_handle_from_param(hnd, type) ({               \
+    typeof((hnd).p) _x = (hnd).p;                           \
+    XEN_GUEST_HANDLE(type) _y = { _x };                     \
+    /* type checking: make sure that the pointers inside    \
+     * XEN_GUEST_HANDLE and XEN_GUEST_HANDLE_PARAM are of   \
+     * the same type, then return hnd */                    \
+    (void)(&_x == &_y.p);                                   \
+    _y;                                                     \
 })
 
 #define guest_handle_from_ptr(ptr, type)        \
-    ((XEN_GUEST_HANDLE(type)) { (type *)ptr })
+    ((XEN_GUEST_HANDLE_PARAM(type)) { (type *)ptr })
 #define const_guest_handle_from_ptr(ptr, type)  \
-    ((XEN_GUEST_HANDLE(const_##type)) { (const type *)ptr })
+    ((XEN_GUEST_HANDLE_PARAM(const_##type)) { (const type *)ptr })
 
 /*
  * Copy an array of objects to guest context via a guest handle,
diff -r ed6c13501195 -r 1eb4b2f7465f xen/include/asm-x86/guest_access.h
--- a/xen/include/asm-x86/guest_access.h	Wed Oct 17 16:43:50 2012 +0100
+++ b/xen/include/asm-x86/guest_access.h	Wed Oct 17 16:43:51 2012 +0100
@@ -45,19 +45,40 @@
 #define guest_handle_add_offset(hnd, nr) ((hnd).p += (nr))
 #define guest_handle_subtract_offset(hnd, nr) ((hnd).p -= (nr))
 
-/* Cast a guest handle to the specified type of handle. */
+/* Cast a guest handle (either XEN_GUEST_HANDLE or XEN_GUEST_HANDLE_PARAM)
+ * to the specified type of XEN_GUEST_HANDLE_PARAM. */
 #define guest_handle_cast(hnd, type) ({         \
     type *_x = (hnd).p;                         \
-    (XEN_GUEST_HANDLE(type)) { _x };            \
+    (XEN_GUEST_HANDLE_PARAM(type)) { _x };            \
+})
+
+/* Cast a XEN_GUEST_HANDLE to XEN_GUEST_HANDLE_PARAM */
+#define guest_handle_to_param(hnd, type) ({                  \
+    /* type checking: make sure that the pointers inside     \
+     * XEN_GUEST_HANDLE and XEN_GUEST_HANDLE_PARAM are of    \
+     * the same type, then return hnd */                     \
+    (void)((typeof(&(hnd).p)) 0 ==                           \
+        (typeof(&((XEN_GUEST_HANDLE_PARAM(type)) {}).p)) 0); \
+    (hnd);                                                   \
+})
+
+/* Cast a XEN_GUEST_HANDLE_PARAM to XEN_GUEST_HANDLE */
+#define guest_handle_from_param(hnd, type) ({                \
+    /* type checking: make sure that the pointers inside     \
+     * XEN_GUEST_HANDLE and XEN_GUEST_HANDLE_PARAM are of    \
+     * the same type, then return hnd */                     \
+    (void)((typeof(&(hnd).p)) 0 ==                           \
+        (typeof(&((XEN_GUEST_HANDLE_PARAM(type)) {}).p)) 0); \
+    (hnd);                                                   \
 })
 
 #define guest_handle_for_field(hnd, type, fld)          \
     ((XEN_GUEST_HANDLE(type)) { &(hnd).p->fld })
 
 #define guest_handle_from_ptr(ptr, type)        \
-    ((XEN_GUEST_HANDLE(type)) { (type *)ptr })
+    ((XEN_GUEST_HANDLE_PARAM(type)) { (type *)ptr })
 #define const_guest_handle_from_ptr(ptr, type)  \
-    ((XEN_GUEST_HANDLE(const_##type)) { (const type *)ptr })
+    ((XEN_GUEST_HANDLE_PARAM(const_##type)) { (const type *)ptr })
 
 /*
  * Copy an array of objects to guest context via a guest handle,
diff -r ed6c13501195 -r 1eb4b2f7465f xen/include/public/arch-arm.h
--- a/xen/include/public/arch-arm.h	Wed Oct 17 16:43:50 2012 +0100
+++ b/xen/include/public/arch-arm.h	Wed Oct 17 16:43:51 2012 +0100
@@ -51,18 +51,36 @@
 
 #define XEN_HYPERCALL_TAG   0XEA1
 
+#define uint64_aligned_t uint64_t __attribute__((aligned(8)))
 
 #ifndef __ASSEMBLY__
-#define ___DEFINE_XEN_GUEST_HANDLE(name, type) \
-    typedef struct { type *p; } __guest_handle_ ## name
+#define ___DEFINE_XEN_GUEST_HANDLE(name, type)                  \
+    typedef union { type *p; unsigned long q; }                 \
+        __guest_handle_ ## name;                                \
+    typedef union { type *p; uint64_aligned_t q; }              \
+        __guest_handle_64_ ## name;
 
+/*
+ * XEN_GUEST_HANDLE represents a guest pointer, when passed as a field
+ * in a struct in memory. On ARM is always 8 bytes sizes and 8 bytes
+ * aligned.
+ * XEN_GUEST_HANDLE_PARAM represent a guest pointer, when passed as an
+ * hypercall argument. It is 4 bytes on aarch and 8 bytes on aarch64.
+ */
 #define __DEFINE_XEN_GUEST_HANDLE(name, type) \
     ___DEFINE_XEN_GUEST_HANDLE(name, type);   \
     ___DEFINE_XEN_GUEST_HANDLE(const_##name, const type)
 #define DEFINE_XEN_GUEST_HANDLE(name)   __DEFINE_XEN_GUEST_HANDLE(name, name)
-#define __XEN_GUEST_HANDLE(name)        __guest_handle_ ## name
+#define __XEN_GUEST_HANDLE(name)        __guest_handle_64_ ## name
 #define XEN_GUEST_HANDLE(name)          __XEN_GUEST_HANDLE(name)
-#define set_xen_guest_handle_raw(hnd, val)  do { (hnd).p = val; } while (0)
+/* this is going to be changed on 64 bit */
+#define XEN_GUEST_HANDLE_PARAM(name)   XEN_GUEST_HANDLE(name)
+#define set_xen_guest_handle_raw(hnd, val)                  \
+    do {                                                    \
+        typeof(&(hnd)) _sxghr_tmp = &(hnd);                 \
+        _sxghr_tmp->q = 0;                                  \
+        _sxghr_tmp->p = val;                                \
+    } while ( 0 )
 #ifdef __XEN_TOOLS__
 #define get_xen_guest_handle(val, hnd)  do { val = (hnd).p; } while (0)
 #endif
diff -r ed6c13501195 -r 1eb4b2f7465f xen/include/public/arch-x86/xen.h
--- a/xen/include/public/arch-x86/xen.h	Wed Oct 17 16:43:50 2012 +0100
+++ b/xen/include/public/arch-x86/xen.h	Wed Oct 17 16:43:51 2012 +0100
@@ -38,12 +38,21 @@
     typedef type * __guest_handle_ ## name
 #endif
 
+/*
+ * XEN_GUEST_HANDLE represents a guest pointer, when passed as a field
+ * in a struct in memory.
+ * XEN_GUEST_HANDLE_PARAM represent a guest pointer, when passed as an
+ * hypercall argument.
+ * XEN_GUEST_HANDLE_PARAM and XEN_GUEST_HANDLE are the same on X86 but
+ * they might not be on other architectures.
+ */
 #define __DEFINE_XEN_GUEST_HANDLE(name, type) \
     ___DEFINE_XEN_GUEST_HANDLE(name, type);   \
     ___DEFINE_XEN_GUEST_HANDLE(const_##name, const type)
 #define DEFINE_XEN_GUEST_HANDLE(name)   __DEFINE_XEN_GUEST_HANDLE(name, name)
 #define __XEN_GUEST_HANDLE(name)        __guest_handle_ ## name
 #define XEN_GUEST_HANDLE(name)          __XEN_GUEST_HANDLE(name)
+#define XEN_GUEST_HANDLE_PARAM(name)    XEN_GUEST_HANDLE(name)
 #define set_xen_guest_handle_raw(hnd, val)  do { (hnd).p = val; } while (0)
 #ifdef __XEN_TOOLS__
 #define get_xen_guest_handle(val, hnd)  do { val = (hnd).p; } while (0)
diff -r ed6c13501195 -r 1eb4b2f7465f xen/include/xen/xencomm.h
--- a/xen/include/xen/xencomm.h	Wed Oct 17 16:43:50 2012 +0100
+++ b/xen/include/xen/xencomm.h	Wed Oct 17 16:43:51 2012 +0100
@@ -66,11 +66,31 @@ static inline unsigned long xencomm_inli
 /* Cast a guest handle to the specified type of handle. */
 #define guest_handle_cast(hnd, type) ({         \
     type *_x = (hnd).p;                         \
-    XEN_GUEST_HANDLE(type) _y;                  \
+    XEN_GUEST_HANDLE_PARAM(type) _y;            \
     set_xen_guest_handle(_y, _x);               \
     _y;                                         \
 })
 
+/* Cast a XEN_GUEST_HANDLE to XEN_GUEST_HANDLE_PARAM */
+#define guest_handle_to_param(hnd, type) ({                  \
+    /* type checking: make sure that the pointers inside     \
+     * XEN_GUEST_HANDLE and XEN_GUEST_HANDLE_PARAM are of    \
+     * the same type, then return hnd */                     \
+    (void)((typeof(&(hnd).p)) 0 ==                           \
+        (typeof(&((XEN_GUEST_HANDLE_PARAM(type)) {}).p)) 0); \
+    (hnd);                                                   \
+})
+
+/* Cast a XEN_GUEST_HANDLE_PARAM to XEN_GUEST_HANDLE */
+#define guest_handle_from_param(hnd, type) ({                \
+    /* type checking: make sure that the pointers inside     \
+     * XEN_GUEST_HANDLE and XEN_GUEST_HANDLE_PARAM are of    \
+     * the same type, then return hnd */                     \
+    (void)((typeof(&(hnd).p)) 0 ==                           \
+        (typeof(&((XEN_GUEST_HANDLE_PARAM(type)) {}).p)) 0); \
+    (hnd);                                                   \
+})
+
 /* Since we run in real mode, we can safely access all addresses. That also
  * means our __routines are identical to our "normal" routines. */
 #define guest_handle_okay(hnd, nr) 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 19 22:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmk-0008Ec-4p; Fri, 19 Oct 2012 22:11:18 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmi-0008Dj-Ar
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:16 +0000
Received: from [193.109.254.147:30043] by server-7.bemta-14.messagelabs.com id
	99/46-24122-300D1805; Fri, 19 Oct 2012 22:11:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-27.messagelabs.com!1350684671!5539672!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10348 invoked from network); 19 Oct 2012 22:11:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmd-0005Ui-Af
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmd-0008Rt-5Z
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:11 +0000
Message-Id: <E1TPKmd-0008Rt-5Z@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen/arm: grant table
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1350488627 -3600
# Node ID b146705d70b3c8e135cfc06a38875e45fd34d638
# Parent  bbe9860189490b04a20595328c391b40717fc9cd
xen/arm: grant table

Implement XENMAPSPACE_grant_table and grant_table_op.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
[ ijc -- fixed reject in traps.c, grant table op is a 3 argument
         hypercall, rebased over "xen: arm: implement
         XENMEM_add_to_physmap_range"
]
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r bbe986018949 -r b146705d70b3 xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c	Wed Oct 17 16:43:46 2012 +0100
+++ b/xen/arch/arm/mm.c	Wed Oct 17 16:43:47 2012 +0100
@@ -25,6 +25,7 @@
 #include <xen/mm.h>
 #include <xen/preempt.h>
 #include <xen/errno.h>
+#include <xen/grant_table.h>
 #include <xen/softirq.h>
 #include <xen/event.h>
 #include <xen/guest_access.h>
@@ -473,6 +474,31 @@ static int xenmem_add_to_physmap_one(
 
     switch ( space )
     {
+    case XENMAPSPACE_grant_table:
+        spin_lock(&d->grant_table->lock);
+
+        if ( d->grant_table->gt_version == 0 )
+            d->grant_table->gt_version = 1;
+
+        if ( d->grant_table->gt_version == 2 &&
+                (idx & XENMAPIDX_grant_table_status) )
+        {
+            idx &= ~XENMAPIDX_grant_table_status;
+            if ( idx < nr_status_frames(d->grant_table) )
+                mfn = virt_to_mfn(d->grant_table->status[idx]);
+        }
+        else
+        {
+            if ( (idx >= nr_grant_frames(d->grant_table)) &&
+                    (idx < max_nr_grant_frames) )
+                gnttab_grow_table(d, idx + 1);
+
+            if ( idx < nr_grant_frames(d->grant_table) )
+                mfn = virt_to_mfn(d->grant_table->shared_raw[idx]);
+        }
+
+        spin_unlock(&d->grant_table->lock);
+        break;
     case XENMAPSPACE_shared_info:
         if ( idx == 0 )
             mfn = virt_to_mfn(d->shared_info);
diff -r bbe986018949 -r b146705d70b3 xen/arch/arm/traps.c
--- a/xen/arch/arm/traps.c	Wed Oct 17 16:43:46 2012 +0100
+++ b/xen/arch/arm/traps.c	Wed Oct 17 16:43:47 2012 +0100
@@ -438,6 +438,7 @@ static arm_hypercall_t arm_hypercall_tab
     HYPERCALL(physdev_op, 2),
     HYPERCALL(sysctl, 2),
     HYPERCALL(hvm_op, 2),
+    HYPERCALL(grant_table_op, 3),
 };
 
 static void do_debug_trap(struct cpu_user_regs *regs, unsigned int code)

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmk-0008F1-DD; Fri, 19 Oct 2012 22:11:18 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmj-0008Dj-7m
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:17 +0000
Received: from [193.109.254.147:11077] by server-7.bemta-14.messagelabs.com id
	5B/46-24122-400D1805; Fri, 19 Oct 2012 22:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1350684675!15309709!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26104 invoked from network); 19 Oct 2012 22:11:15 -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;
	19 Oct 2012 22:11:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmg-0005V0-NW
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmg-0008TN-KW
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:14 +0000
Message-Id: <E1TPKmg-0008TN-KW@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: more XEN_GUEST_HANDLE_PARAM
	substitutions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1350488633 -3600
# Node ID 2a1083b1d0c24f943a1e0bca335fc11aabf6536e
# Parent  9eafdcd5ff0b55acaf65dd482179a3ca1db78482
xen: more XEN_GUEST_HANDLE_PARAM substitutions

More substitutions in this patch, not as obvious as the ones in the
previous patch.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 9eafdcd5ff0b -r 2a1083b1d0c2 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Wed Oct 17 16:43:53 2012 +0100
+++ b/xen/arch/x86/mm.c	Wed Oct 17 16:43:53 2012 +0100
@@ -2913,7 +2913,9 @@ long do_mmuext_op(
         {
             cpumask_t pmask;
 
-            if ( unlikely(vcpumask_to_pcpumask(d, op.arg2.vcpumask, &pmask)) )
+            if ( unlikely(vcpumask_to_pcpumask(d,
+                            guest_handle_to_param(op.arg2.vcpumask, const_void),
+                            &pmask)) )
             {
                 okay = 0;
                 break;
@@ -4195,6 +4197,7 @@ static int handle_iomem_range(unsigned l
     if ( s > ctxt->s )
     {
         e820entry_t ent;
+        XEN_GUEST_HANDLE_PARAM(e820entry_t) buffer_param;
         XEN_GUEST_HANDLE(e820entry_t) buffer;
 
         if ( ctxt->n + 1 >= ctxt->map.nr_entries )
@@ -4202,7 +4205,8 @@ static int handle_iomem_range(unsigned l
         ent.addr = (uint64_t)ctxt->s << PAGE_SHIFT;
         ent.size = (uint64_t)(s - ctxt->s) << PAGE_SHIFT;
         ent.type = E820_RESERVED;
-        buffer = guest_handle_cast(ctxt->map.buffer, e820entry_t);
+        buffer_param = guest_handle_cast(ctxt->map.buffer, e820entry_t);
+        buffer = guest_handle_from_param(buffer_param, e820entry_t);
         if ( __copy_to_guest_offset(buffer, ctxt->n, &ent, 1) )
             return -EFAULT;
         ctxt->n++;
@@ -4499,6 +4503,7 @@ long arch_memory_op(int op, XEN_GUEST_HA
     {
         struct memory_map_context ctxt;
         XEN_GUEST_HANDLE(e820entry_t) buffer;
+        XEN_GUEST_HANDLE_PARAM(e820entry_t) buffer_param;
         unsigned int i;
 
         if ( !IS_PRIV(current->domain) )
@@ -4513,7 +4518,8 @@ long arch_memory_op(int op, XEN_GUEST_HA
         if ( ctxt.map.nr_entries < e820.nr_map + 1 )
             return -EINVAL;
 
-        buffer = guest_handle_cast(ctxt.map.buffer, e820entry_t);
+        buffer_param = guest_handle_cast(ctxt.map.buffer, e820entry_t);
+        buffer = guest_handle_from_param(buffer_param, e820entry_t);
         if ( !guest_handle_okay(buffer, ctxt.map.nr_entries) )
             return -EFAULT;
 
diff -r 9eafdcd5ff0b -r 2a1083b1d0c2 xen/arch/x86/oprofile/backtrace.c
--- a/xen/arch/x86/oprofile/backtrace.c	Wed Oct 17 16:43:53 2012 +0100
+++ b/xen/arch/x86/oprofile/backtrace.c	Wed Oct 17 16:43:53 2012 +0100
@@ -74,8 +74,11 @@ dump_guest_backtrace(struct vcpu *vcpu, 
     }
     else
     {
-        XEN_GUEST_HANDLE(const_frame_head_t) guest_head =
+        XEN_GUEST_HANDLE(const_frame_head_t) guest_head;
+        XEN_GUEST_HANDLE_PARAM(const_frame_head_t) guest_head_param =
             const_guest_handle_from_ptr(head, frame_head_t);
+        guest_head = guest_handle_from_param(guest_head_param,
+					     const_frame_head_t);
 
         /* Also check accessibility of one struct frame_head beyond */
         if (!guest_handle_okay(guest_head, 2))
diff -r 9eafdcd5ff0b -r 2a1083b1d0c2 xen/arch/x86/platform_hypercall.c
--- a/xen/arch/x86/platform_hypercall.c	Wed Oct 17 16:43:53 2012 +0100
+++ b/xen/arch/x86/platform_hypercall.c	Wed Oct 17 16:43:53 2012 +0100
@@ -61,7 +61,7 @@ long cpu_down_helper(void *data);
 long core_parking_helper(void *data);
 uint32_t get_cur_idle_nums(void);
 
-ret_t do_platform_op(XEN_GUEST_HANDLE(xen_platform_op_t) u_xenpf_op)
+ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
 {
     ret_t ret = 0;
     struct xen_platform_op curop, *op = &curop;
@@ -186,7 +186,9 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe
             }
         }
 
-        ret = microcode_update(data, op->u.microcode.length);
+        ret = microcode_update(
+                guest_handle_to_param(data, const_void),
+                op->u.microcode.length);
         spin_unlock(&vcpu_alloc_lock);
     }
     break;
@@ -454,7 +456,9 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe
             XEN_GUEST_HANDLE(uint32) pdc;
 
             guest_from_compat_handle(pdc, op->u.set_pminfo.u.pdc);
-            ret = acpi_set_pdc_bits(op->u.set_pminfo.id, pdc);
+            ret = acpi_set_pdc_bits(
+                    op->u.set_pminfo.id,
+                    guest_handle_to_param(pdc, uint32));
         }
         break;
 
diff -r 9eafdcd5ff0b -r 2a1083b1d0c2 xen/arch/x86/x86_64/cpu_idle.c
--- a/xen/arch/x86/x86_64/cpu_idle.c	Wed Oct 17 16:43:53 2012 +0100
+++ b/xen/arch/x86/x86_64/cpu_idle.c	Wed Oct 17 16:43:53 2012 +0100
@@ -57,10 +57,12 @@ static int copy_from_compat_state(xen_pr
 {
 #define XLAT_processor_cx_HNDL_dp(_d_, _s_) do { \
     XEN_GUEST_HANDLE(compat_processor_csd_t) dps; \
+    XEN_GUEST_HANDLE_PARAM(xen_processor_csd_t) dps_param; \
     if ( unlikely(!compat_handle_okay((_s_)->dp, (_s_)->dpcnt)) ) \
             return -EFAULT; \
     guest_from_compat_handle(dps, (_s_)->dp); \
-    (_d_)->dp = guest_handle_cast(dps, xen_processor_csd_t); \
+    dps_param = guest_handle_cast(dps, xen_processor_csd_t); \
+    (_d_)->dp = guest_handle_from_param(dps_param, xen_processor_csd_t); \
 } while (0)
     XLAT_processor_cx(xen_state, state);
 #undef XLAT_processor_cx_HNDL_dp
diff -r 9eafdcd5ff0b -r 2a1083b1d0c2 xen/arch/x86/x86_64/cpufreq.c
--- a/xen/arch/x86/x86_64/cpufreq.c	Wed Oct 17 16:43:53 2012 +0100
+++ b/xen/arch/x86/x86_64/cpufreq.c	Wed Oct 17 16:43:53 2012 +0100
@@ -45,10 +45,12 @@ compat_set_px_pminfo(uint32_t cpu, struc
 
 #define XLAT_processor_performance_HNDL_states(_d_, _s_) do { \
     XEN_GUEST_HANDLE(compat_processor_px_t) states; \
+    XEN_GUEST_HANDLE_PARAM(xen_processor_px_t) states_t; \
     if ( unlikely(!compat_handle_okay((_s_)->states, (_s_)->state_count)) ) \
         return -EFAULT; \
     guest_from_compat_handle(states, (_s_)->states); \
-    (_d_)->states = guest_handle_cast(states, xen_processor_px_t); \
+    states_t = guest_handle_cast(states, xen_processor_px_t); \
+    (_d_)->states = guest_handle_from_param(states_t, xen_processor_px_t); \
 } while (0)
 
     XLAT_processor_performance(xen_perf, perf);
diff -r 9eafdcd5ff0b -r 2a1083b1d0c2 xen/arch/x86/x86_64/platform_hypercall.c
--- a/xen/arch/x86/x86_64/platform_hypercall.c	Wed Oct 17 16:43:53 2012 +0100
+++ b/xen/arch/x86/x86_64/platform_hypercall.c	Wed Oct 17 16:43:53 2012 +0100
@@ -38,6 +38,7 @@ CHECK_pf_pcpu_version;
 
 #define COMPAT
 #define _XEN_GUEST_HANDLE(t) XEN_GUEST_HANDLE(t)
+#define _XEN_GUEST_HANDLE_PARAM(t) XEN_GUEST_HANDLE_PARAM(t)
 typedef int ret_t;
 
 #include "../platform_hypercall.c"
diff -r 9eafdcd5ff0b -r 2a1083b1d0c2 xen/common/compat/multicall.c
--- a/xen/common/compat/multicall.c	Wed Oct 17 16:43:53 2012 +0100
+++ b/xen/common/compat/multicall.c	Wed Oct 17 16:43:53 2012 +0100
@@ -25,6 +25,7 @@ DEFINE_XEN_GUEST_HANDLE(multicall_entry_
 #define call                 compat_call
 #define do_multicall(l, n)   compat_multicall(_##l, n)
 #define _XEN_GUEST_HANDLE(t) XEN_GUEST_HANDLE(t)
+#define _XEN_GUEST_HANDLE_PARAM(t) XEN_GUEST_HANDLE(t)
 
 static void __trace_multicall_call(multicall_entry_t *call)
 {
diff -r 9eafdcd5ff0b -r 2a1083b1d0c2 xen/common/multicall.c
--- a/xen/common/multicall.c	Wed Oct 17 16:43:53 2012 +0100
+++ b/xen/common/multicall.c	Wed Oct 17 16:43:53 2012 +0100
@@ -35,7 +35,7 @@ static void trace_multicall_call(multica
 
 ret_t
 do_multicall(
-    XEN_GUEST_HANDLE(multicall_entry_t) call_list, unsigned int nr_calls)
+    XEN_GUEST_HANDLE_PARAM(multicall_entry_t) call_list, unsigned int nr_calls)
 {
     struct mc_state *mcs = &current->mc_state;
     unsigned int     i;

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22: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 1TPKml-0008Gt-I2; Fri, 19 Oct 2012 22:11:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmk-0008Ea-2K
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:18 +0000
Received: from [85.158.139.83:61254] by server-11.bemta-5.messagelabs.com id
	28/3B-14870-500D1805; Fri, 19 Oct 2012 22:11:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1350684675!35502908!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10821 invoked from network); 19 Oct 2012 22:11:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmh-0005V3-9a
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmh-0008Tc-8E
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:15 +0000
Message-Id: <E1TPKmh-0008Tc-8E@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: remove XEN_GUEST_HANDLE(ulong)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1350488634 -3600
# Node ID 5529b91bd2e441b71acf2aa95b94d29202e10bd2
# Parent  2a1083b1d0c24f943a1e0bca335fc11aabf6536e
xen: remove XEN_GUEST_HANDLE(ulong)

Having both this handle (always unsigned long) and
XEN_GUEST_HANDLE(xen_ulong_t) (unsigned long on x86 and explicit size
of ARM) is confusing and error prone.

Replace the two remaining uses of the ulong handle, in grant set and
x86 set_gdt hypercalls, with xen_ulong_t.

This correctly sizes the grant frame entry as 64 bit on ARM but
leaves it as unsigned long on x86 (therefore no intended change on
x86). Likewise in set_gdt there is no actual change.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 2a1083b1d0c2 -r 5529b91bd2e4 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Wed Oct 17 16:43:53 2012 +0100
+++ b/xen/arch/x86/mm.c	Wed Oct 17 16:43:54 2012 +0100
@@ -4100,7 +4100,8 @@ long set_gdt(struct vcpu *v,
 }
 
 
-long do_set_gdt(XEN_GUEST_HANDLE_PARAM(ulong) frame_list, unsigned int entries)
+long do_set_gdt(XEN_GUEST_HANDLE_PARAM(xen_ulong_t) frame_list,
+                unsigned int entries)
 {
     int nr_pages = (entries + 511) / 512;
     unsigned long frames[16];
diff -r 2a1083b1d0c2 -r 5529b91bd2e4 xen/common/grant_table.c
--- a/xen/common/grant_table.c	Wed Oct 17 16:43:53 2012 +0100
+++ b/xen/common/grant_table.c	Wed Oct 17 16:43:54 2012 +0100
@@ -1322,7 +1322,7 @@ gnttab_setup_table(
     struct domain *d;
     struct grant_table *gt;
     int            i;
-    unsigned long  gmfn;
+    xen_pfn_t  gmfn;
 
     if ( count != 1 )
         return -EINVAL;
diff -r 2a1083b1d0c2 -r 5529b91bd2e4 xen/include/asm-x86/hypercall.h
--- a/xen/include/asm-x86/hypercall.h	Wed Oct 17 16:43:53 2012 +0100
+++ b/xen/include/asm-x86/hypercall.h	Wed Oct 17 16:43:54 2012 +0100
@@ -33,7 +33,7 @@ do_mmu_update(
 
 extern long
 do_set_gdt(
-    XEN_GUEST_HANDLE_PARAM(ulong) frame_list,
+    XEN_GUEST_HANDLE_PARAM(xen_ulong_t) frame_list,
     unsigned int entries);
 
 extern long
diff -r 2a1083b1d0c2 -r 5529b91bd2e4 xen/include/public/grant_table.h
--- a/xen/include/public/grant_table.h	Wed Oct 17 16:43:53 2012 +0100
+++ b/xen/include/public/grant_table.h	Wed Oct 17 16:43:54 2012 +0100
@@ -385,7 +385,7 @@ struct gnttab_setup_table {
     uint32_t nr_frames;
     /* OUT parameters. */
     int16_t  status;              /* => enum grant_status */
-    XEN_GUEST_HANDLE(ulong) frame_list;
+    XEN_GUEST_HANDLE(xen_pfn_t) frame_list;
 };
 typedef struct gnttab_setup_table gnttab_setup_table_t;
 DEFINE_XEN_GUEST_HANDLE(gnttab_setup_table_t);
diff -r 2a1083b1d0c2 -r 5529b91bd2e4 xen/include/public/xen.h
--- a/xen/include/public/xen.h	Wed Oct 17 16:43:53 2012 +0100
+++ b/xen/include/public/xen.h	Wed Oct 17 16:43:54 2012 +0100
@@ -43,8 +43,6 @@ DEFINE_XEN_GUEST_HANDLE(char);
 __DEFINE_XEN_GUEST_HANDLE(uchar, unsigned char);
 DEFINE_XEN_GUEST_HANDLE(int);
 __DEFINE_XEN_GUEST_HANDLE(uint,  unsigned int);
-DEFINE_XEN_GUEST_HANDLE(long);
-__DEFINE_XEN_GUEST_HANDLE(ulong, unsigned long);
 DEFINE_XEN_GUEST_HANDLE(void);
 
 DEFINE_XEN_GUEST_HANDLE(uint64_t);

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22: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 1TPKml-0008Gt-I2; Fri, 19 Oct 2012 22:11:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmk-0008Ea-2K
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:18 +0000
Received: from [85.158.139.83:61254] by server-11.bemta-5.messagelabs.com id
	28/3B-14870-500D1805; Fri, 19 Oct 2012 22:11:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1350684675!35502908!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10821 invoked from network); 19 Oct 2012 22:11:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmh-0005V3-9a
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmh-0008Tc-8E
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:15 +0000
Message-Id: <E1TPKmh-0008Tc-8E@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: remove XEN_GUEST_HANDLE(ulong)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1350488634 -3600
# Node ID 5529b91bd2e441b71acf2aa95b94d29202e10bd2
# Parent  2a1083b1d0c24f943a1e0bca335fc11aabf6536e
xen: remove XEN_GUEST_HANDLE(ulong)

Having both this handle (always unsigned long) and
XEN_GUEST_HANDLE(xen_ulong_t) (unsigned long on x86 and explicit size
of ARM) is confusing and error prone.

Replace the two remaining uses of the ulong handle, in grant set and
x86 set_gdt hypercalls, with xen_ulong_t.

This correctly sizes the grant frame entry as 64 bit on ARM but
leaves it as unsigned long on x86 (therefore no intended change on
x86). Likewise in set_gdt there is no actual change.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 2a1083b1d0c2 -r 5529b91bd2e4 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Wed Oct 17 16:43:53 2012 +0100
+++ b/xen/arch/x86/mm.c	Wed Oct 17 16:43:54 2012 +0100
@@ -4100,7 +4100,8 @@ long set_gdt(struct vcpu *v,
 }
 
 
-long do_set_gdt(XEN_GUEST_HANDLE_PARAM(ulong) frame_list, unsigned int entries)
+long do_set_gdt(XEN_GUEST_HANDLE_PARAM(xen_ulong_t) frame_list,
+                unsigned int entries)
 {
     int nr_pages = (entries + 511) / 512;
     unsigned long frames[16];
diff -r 2a1083b1d0c2 -r 5529b91bd2e4 xen/common/grant_table.c
--- a/xen/common/grant_table.c	Wed Oct 17 16:43:53 2012 +0100
+++ b/xen/common/grant_table.c	Wed Oct 17 16:43:54 2012 +0100
@@ -1322,7 +1322,7 @@ gnttab_setup_table(
     struct domain *d;
     struct grant_table *gt;
     int            i;
-    unsigned long  gmfn;
+    xen_pfn_t  gmfn;
 
     if ( count != 1 )
         return -EINVAL;
diff -r 2a1083b1d0c2 -r 5529b91bd2e4 xen/include/asm-x86/hypercall.h
--- a/xen/include/asm-x86/hypercall.h	Wed Oct 17 16:43:53 2012 +0100
+++ b/xen/include/asm-x86/hypercall.h	Wed Oct 17 16:43:54 2012 +0100
@@ -33,7 +33,7 @@ do_mmu_update(
 
 extern long
 do_set_gdt(
-    XEN_GUEST_HANDLE_PARAM(ulong) frame_list,
+    XEN_GUEST_HANDLE_PARAM(xen_ulong_t) frame_list,
     unsigned int entries);
 
 extern long
diff -r 2a1083b1d0c2 -r 5529b91bd2e4 xen/include/public/grant_table.h
--- a/xen/include/public/grant_table.h	Wed Oct 17 16:43:53 2012 +0100
+++ b/xen/include/public/grant_table.h	Wed Oct 17 16:43:54 2012 +0100
@@ -385,7 +385,7 @@ struct gnttab_setup_table {
     uint32_t nr_frames;
     /* OUT parameters. */
     int16_t  status;              /* => enum grant_status */
-    XEN_GUEST_HANDLE(ulong) frame_list;
+    XEN_GUEST_HANDLE(xen_pfn_t) frame_list;
 };
 typedef struct gnttab_setup_table gnttab_setup_table_t;
 DEFINE_XEN_GUEST_HANDLE(gnttab_setup_table_t);
diff -r 2a1083b1d0c2 -r 5529b91bd2e4 xen/include/public/xen.h
--- a/xen/include/public/xen.h	Wed Oct 17 16:43:53 2012 +0100
+++ b/xen/include/public/xen.h	Wed Oct 17 16:43:54 2012 +0100
@@ -43,8 +43,6 @@ DEFINE_XEN_GUEST_HANDLE(char);
 __DEFINE_XEN_GUEST_HANDLE(uchar, unsigned char);
 DEFINE_XEN_GUEST_HANDLE(int);
 __DEFINE_XEN_GUEST_HANDLE(uint,  unsigned int);
-DEFINE_XEN_GUEST_HANDLE(long);
-__DEFINE_XEN_GUEST_HANDLE(ulong, unsigned long);
 DEFINE_XEN_GUEST_HANDLE(void);
 
 DEFINE_XEN_GUEST_HANDLE(uint64_t);

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22: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 1TPKml-0008Hb-SU; Fri, 19 Oct 2012 22:11:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmk-0008Eb-LG
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:18 +0000
Received: from [85.158.138.51:50808] by server-15.bemta-3.messagelabs.com id
	A1/E1-10261-500D1805; Fri, 19 Oct 2012 22:11:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-174.messagelabs.com!1350684675!27043200!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21243 invoked from network); 19 Oct 2012 22:11:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmh-0005V6-Q2
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmh-0008Tr-Om
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:15 +0000
Message-Id: <E1TPKmh-0008Tr-Om@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: parameter guest handles are 32
	bit on 32 bit hypervisor
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1350488635 -3600
# Node ID 5c402b905e00fb0871c3f439c8391dd3cfb3bc10
# Parent  5529b91bd2e441b71acf2aa95b94d29202e10bd2
arm: parameter guest handles are 32 bit on 32 bit hypervisor

Handles within structs remain 64 bit such that they are consistently
sized on both 32 and 64 bit.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 5529b91bd2e4 -r 5c402b905e00 xen/include/public/arch-arm.h
--- a/xen/include/public/arch-arm.h	Wed Oct 17 16:43:54 2012 +0100
+++ b/xen/include/public/arch-arm.h	Wed Oct 17 16:43:55 2012 +0100
@@ -74,7 +74,7 @@
 #define __XEN_GUEST_HANDLE(name)        __guest_handle_64_ ## name
 #define XEN_GUEST_HANDLE(name)          __XEN_GUEST_HANDLE(name)
 /* this is going to be changed on 64 bit */
-#define XEN_GUEST_HANDLE_PARAM(name)   XEN_GUEST_HANDLE(name)
+#define XEN_GUEST_HANDLE_PARAM(name)    __guest_handle_ ## name
 #define set_xen_guest_handle_raw(hnd, val)                  \
     do {                                                    \
         typeof(&(hnd)) _sxghr_tmp = &(hnd);                 \

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22: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 1TPKml-0008Hb-SU; Fri, 19 Oct 2012 22:11:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmk-0008Eb-LG
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:18 +0000
Received: from [85.158.138.51:50808] by server-15.bemta-3.messagelabs.com id
	A1/E1-10261-500D1805; Fri, 19 Oct 2012 22:11:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-174.messagelabs.com!1350684675!27043200!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21243 invoked from network); 19 Oct 2012 22:11:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmh-0005V6-Q2
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmh-0008Tr-Om
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:15 +0000
Message-Id: <E1TPKmh-0008Tr-Om@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: parameter guest handles are 32
	bit on 32 bit hypervisor
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1350488635 -3600
# Node ID 5c402b905e00fb0871c3f439c8391dd3cfb3bc10
# Parent  5529b91bd2e441b71acf2aa95b94d29202e10bd2
arm: parameter guest handles are 32 bit on 32 bit hypervisor

Handles within structs remain 64 bit such that they are consistently
sized on both 32 and 64 bit.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 5529b91bd2e4 -r 5c402b905e00 xen/include/public/arch-arm.h
--- a/xen/include/public/arch-arm.h	Wed Oct 17 16:43:54 2012 +0100
+++ b/xen/include/public/arch-arm.h	Wed Oct 17 16:43:55 2012 +0100
@@ -74,7 +74,7 @@
 #define __XEN_GUEST_HANDLE(name)        __guest_handle_64_ ## name
 #define XEN_GUEST_HANDLE(name)          __XEN_GUEST_HANDLE(name)
 /* this is going to be changed on 64 bit */
-#define XEN_GUEST_HANDLE_PARAM(name)   XEN_GUEST_HANDLE(name)
+#define XEN_GUEST_HANDLE_PARAM(name)    __guest_handle_ ## name
 #define set_xen_guest_handle_raw(hnd, val)                  \
     do {                                                    \
         typeof(&(hnd)) _sxghr_tmp = &(hnd);                 \

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 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 1TPKmn-0008JW-2t; Fri, 19 Oct 2012 22:11:21 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmk-0008Ez-VS
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:19 +0000
Received: from [193.109.254.147:25398] by server-6.bemta-14.messagelabs.com id
	7E/7B-17826-600D1805; Fri, 19 Oct 2012 22:11:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1350684676!10722598!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13135 invoked from network); 19 Oct 2012 22:11: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;
	19 Oct 2012 22:11:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmi-0005V9-EX
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmi-0008U6-9M
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:16 +0000
Message-Id: <E1TPKmi-0008U6-9M@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] ACPI/APEI: accept validly sized ERST
	on Intel systems only for now
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1350547668 -7200
# Node ID af3f99e1983181bde2b3077d0eb4c4206dbca343
# Parent  5c402b905e00fb0871c3f439c8391dd3cfb3bc10
ACPI/APEI: accept validly sized ERST on Intel systems only for now

Various AMD systems (but [unfortunately] not mine) hang when the table
size check passes. Allow the check to pass on Intel systems only for
now (until someone can actually debug the problem).

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


diff -r 5c402b905e00 -r af3f99e19831 xen/drivers/acpi/apei/erst.c
--- a/xen/drivers/acpi/apei/erst.c	Wed Oct 17 16:43:55 2012 +0100
+++ b/xen/drivers/acpi/apei/erst.c	Thu Oct 18 10:07:48 2012 +0200
@@ -769,6 +769,19 @@ static int __init erst_check_table(struc
 
 	switch (erst_tab->header_length) {
 	case sizeof(*erst_tab) - sizeof(erst_tab->header):
+#ifdef CONFIG_X86
+		/* XXX
+		 * While the rest of the ERST code appears to work on Intel
+		 * systems with properly sized tables, various AMD systems
+		 * appear to get hung (at boot time) by allowing this. Until
+		 * someone with access to suitable hardware can debug this,
+		 * disable the rest of the code by considering this case
+		 * invalid.
+		 */
+		if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL)
+			return -EINVAL;
+		/* fall through */
+#endif
 	/*
 	 * While invalid per specification, there are (early?) systems
 	 * indicating the full header size here, so accept that value too.

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 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 1TPKmn-0008JW-2t; Fri, 19 Oct 2012 22:11:21 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmk-0008Ez-VS
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:19 +0000
Received: from [193.109.254.147:25398] by server-6.bemta-14.messagelabs.com id
	7E/7B-17826-600D1805; Fri, 19 Oct 2012 22:11:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1350684676!10722598!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13135 invoked from network); 19 Oct 2012 22:11: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;
	19 Oct 2012 22:11:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmi-0005V9-EX
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmi-0008U6-9M
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:16 +0000
Message-Id: <E1TPKmi-0008U6-9M@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] ACPI/APEI: accept validly sized ERST
	on Intel systems only for now
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1350547668 -7200
# Node ID af3f99e1983181bde2b3077d0eb4c4206dbca343
# Parent  5c402b905e00fb0871c3f439c8391dd3cfb3bc10
ACPI/APEI: accept validly sized ERST on Intel systems only for now

Various AMD systems (but [unfortunately] not mine) hang when the table
size check passes. Allow the check to pass on Intel systems only for
now (until someone can actually debug the problem).

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


diff -r 5c402b905e00 -r af3f99e19831 xen/drivers/acpi/apei/erst.c
--- a/xen/drivers/acpi/apei/erst.c	Wed Oct 17 16:43:55 2012 +0100
+++ b/xen/drivers/acpi/apei/erst.c	Thu Oct 18 10:07:48 2012 +0200
@@ -769,6 +769,19 @@ static int __init erst_check_table(struc
 
 	switch (erst_tab->header_length) {
 	case sizeof(*erst_tab) - sizeof(erst_tab->header):
+#ifdef CONFIG_X86
+		/* XXX
+		 * While the rest of the ERST code appears to work on Intel
+		 * systems with properly sized tables, various AMD systems
+		 * appear to get hung (at boot time) by allowing this. Until
+		 * someone with access to suitable hardware can debug this,
+		 * disable the rest of the code by considering this case
+		 * invalid.
+		 */
+		if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL)
+			return -EINVAL;
+		/* fall through */
+#endif
 	/*
 	 * While invalid per specification, there are (early?) systems
 	 * indicating the full header size here, so accept that value too.

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmn-0008Jq-7l; Fri, 19 Oct 2012 22:11:21 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmm-0008DJ-2O
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:20 +0000
Received: from [193.109.254.147:30096] by server-5.bemta-14.messagelabs.com id
	90/BE-18309-700D1805; Fri, 19 Oct 2012 22:11:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-27.messagelabs.com!1350684677!10634389!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25138 invoked from network); 19 Oct 2012 22:11:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmj-0005VF-EF
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmj-0008Ub-D1
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:17 +0000
Message-Id: <E1TPKmj-0008Ub-D1@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: retain ulong guest handle for
	older consumers.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <Ian.Campbell@citrix.com>
# Date 1350549298 -3600
# Node ID 8dcab28b8081ea9ea2f11d8c512087df0ae72550
# Parent  368f71314e7c7fdd78480544e155ef7948429ea2
xen: retain ulong guest handle for older consumers.

26072:5529b91bd2e4 removed this but we need to keep it around for
older consumers. Bump __XEN_LATEST_INTERFACE_VERSION__ accordingly.

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


diff -r 368f71314e7c -r 8dcab28b8081 xen/include/public/grant_table.h
--- a/xen/include/public/grant_table.h	Thu Oct 18 10:10:02 2012 +0200
+++ b/xen/include/public/grant_table.h	Thu Oct 18 09:34:58 2012 +0100
@@ -385,7 +385,11 @@ struct gnttab_setup_table {
     uint32_t nr_frames;
     /* OUT parameters. */
     int16_t  status;              /* => enum grant_status */
+#if __XEN_INTERFACE_VERSION__ < 0x00040300
+    XEN_GUEST_HANDLE(ulong) frame_list;
+#else
     XEN_GUEST_HANDLE(xen_pfn_t) frame_list;
+#endif
 };
 typedef struct gnttab_setup_table gnttab_setup_table_t;
 DEFINE_XEN_GUEST_HANDLE(gnttab_setup_table_t);
diff -r 368f71314e7c -r 8dcab28b8081 xen/include/public/xen-compat.h
--- a/xen/include/public/xen-compat.h	Thu Oct 18 10:10:02 2012 +0200
+++ b/xen/include/public/xen-compat.h	Thu Oct 18 09:34:58 2012 +0100
@@ -27,7 +27,7 @@
 #ifndef __XEN_PUBLIC_XEN_COMPAT_H__
 #define __XEN_PUBLIC_XEN_COMPAT_H__
 
-#define __XEN_LATEST_INTERFACE_VERSION__ 0x00040200
+#define __XEN_LATEST_INTERFACE_VERSION__ 0x00040300
 
 #if defined(__XEN__) || defined(__XEN_TOOLS__)
 /* Xen is built with matching headers and implements the latest interface. */
diff -r 368f71314e7c -r 8dcab28b8081 xen/include/public/xen.h
--- a/xen/include/public/xen.h	Thu Oct 18 10:10:02 2012 +0200
+++ b/xen/include/public/xen.h	Thu Oct 18 09:34:58 2012 +0100
@@ -43,6 +43,10 @@ DEFINE_XEN_GUEST_HANDLE(char);
 __DEFINE_XEN_GUEST_HANDLE(uchar, unsigned char);
 DEFINE_XEN_GUEST_HANDLE(int);
 __DEFINE_XEN_GUEST_HANDLE(uint,  unsigned int);
+#if __XEN_INTERFACE_VERSION__ < 0x00040300
+DEFINE_XEN_GUEST_HANDLE(long);
+__DEFINE_XEN_GUEST_HANDLE(ulong, unsigned long);
+#endif
 DEFINE_XEN_GUEST_HANDLE(void);
 
 DEFINE_XEN_GUEST_HANDLE(uint64_t);

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmn-0008Jq-7l; Fri, 19 Oct 2012 22:11:21 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmm-0008DJ-2O
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:20 +0000
Received: from [193.109.254.147:30096] by server-5.bemta-14.messagelabs.com id
	90/BE-18309-700D1805; Fri, 19 Oct 2012 22:11:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-27.messagelabs.com!1350684677!10634389!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25138 invoked from network); 19 Oct 2012 22:11:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmj-0005VF-EF
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmj-0008Ub-D1
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:17 +0000
Message-Id: <E1TPKmj-0008Ub-D1@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: retain ulong guest handle for
	older consumers.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <Ian.Campbell@citrix.com>
# Date 1350549298 -3600
# Node ID 8dcab28b8081ea9ea2f11d8c512087df0ae72550
# Parent  368f71314e7c7fdd78480544e155ef7948429ea2
xen: retain ulong guest handle for older consumers.

26072:5529b91bd2e4 removed this but we need to keep it around for
older consumers. Bump __XEN_LATEST_INTERFACE_VERSION__ accordingly.

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


diff -r 368f71314e7c -r 8dcab28b8081 xen/include/public/grant_table.h
--- a/xen/include/public/grant_table.h	Thu Oct 18 10:10:02 2012 +0200
+++ b/xen/include/public/grant_table.h	Thu Oct 18 09:34:58 2012 +0100
@@ -385,7 +385,11 @@ struct gnttab_setup_table {
     uint32_t nr_frames;
     /* OUT parameters. */
     int16_t  status;              /* => enum grant_status */
+#if __XEN_INTERFACE_VERSION__ < 0x00040300
+    XEN_GUEST_HANDLE(ulong) frame_list;
+#else
     XEN_GUEST_HANDLE(xen_pfn_t) frame_list;
+#endif
 };
 typedef struct gnttab_setup_table gnttab_setup_table_t;
 DEFINE_XEN_GUEST_HANDLE(gnttab_setup_table_t);
diff -r 368f71314e7c -r 8dcab28b8081 xen/include/public/xen-compat.h
--- a/xen/include/public/xen-compat.h	Thu Oct 18 10:10:02 2012 +0200
+++ b/xen/include/public/xen-compat.h	Thu Oct 18 09:34:58 2012 +0100
@@ -27,7 +27,7 @@
 #ifndef __XEN_PUBLIC_XEN_COMPAT_H__
 #define __XEN_PUBLIC_XEN_COMPAT_H__
 
-#define __XEN_LATEST_INTERFACE_VERSION__ 0x00040200
+#define __XEN_LATEST_INTERFACE_VERSION__ 0x00040300
 
 #if defined(__XEN__) || defined(__XEN_TOOLS__)
 /* Xen is built with matching headers and implements the latest interface. */
diff -r 368f71314e7c -r 8dcab28b8081 xen/include/public/xen.h
--- a/xen/include/public/xen.h	Thu Oct 18 10:10:02 2012 +0200
+++ b/xen/include/public/xen.h	Thu Oct 18 09:34:58 2012 +0100
@@ -43,6 +43,10 @@ DEFINE_XEN_GUEST_HANDLE(char);
 __DEFINE_XEN_GUEST_HANDLE(uchar, unsigned char);
 DEFINE_XEN_GUEST_HANDLE(int);
 __DEFINE_XEN_GUEST_HANDLE(uint,  unsigned int);
+#if __XEN_INTERFACE_VERSION__ < 0x00040300
+DEFINE_XEN_GUEST_HANDLE(long);
+__DEFINE_XEN_GUEST_HANDLE(ulong, unsigned long);
+#endif
 DEFINE_XEN_GUEST_HANDLE(void);
 
 DEFINE_XEN_GUEST_HANDLE(uint64_t);

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmo-0008Lc-JS; Fri, 19 Oct 2012 22:11:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmm-0008ID-Lo
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:21 +0000
Received: from [85.158.138.51:53635] by server-9.bemta-3.messagelabs.com id
	F2/F5-16841-700D1805; Fri, 19 Oct 2012 22:11:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-174.messagelabs.com!1350684677!27464541!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18724 invoked from network); 19 Oct 2012 22:11:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmi-0005VC-TS
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmi-0008UM-Rj
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:16 +0000
Message-Id: <E1TPKmi-0008UM-Rj@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/HPET: allow use for broadcast
	when interrupt remapping is in effect
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1350547802 -7200
# Node ID 368f71314e7c7fdd78480544e155ef7948429ea2
# Parent  af3f99e1983181bde2b3077d0eb4c4206dbca343
x86/HPET: allow use for broadcast when interrupt remapping is in effect

This requires some additions to the VT-d side; AMD IOMMUs use the
"normal" MSI message format even when interrupt remapping is enabled,
thus making adjustments here unnecessary.

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


diff -r af3f99e19831 -r 368f71314e7c xen/arch/x86/acpi/boot.c
--- a/xen/arch/x86/acpi/boot.c	Thu Oct 18 10:07:48 2012 +0200
+++ b/xen/arch/x86/acpi/boot.c	Thu Oct 18 10:10:02 2012 +0200
@@ -276,6 +276,7 @@ static int __init acpi_parse_hpet(struct
 	}
 
 	hpet_address = hpet_tbl->address.address;
+	hpet_blockid = hpet_tbl->sequence;
 	printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n",
 	       hpet_tbl->id, hpet_address);
 
diff -r af3f99e19831 -r 368f71314e7c xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c	Thu Oct 18 10:07:48 2012 +0200
+++ b/xen/arch/x86/hpet.c	Thu Oct 18 10:10:02 2012 +0200
@@ -40,7 +40,7 @@ struct hpet_event_channel
 
     unsigned int idx;   /* physical channel idx */
     unsigned int cpu;   /* msi target */
-    int irq;            /* msi irq */
+    struct msi_desc msi;/* msi state */
     unsigned int flags; /* HPET_EVT_x */
 } __cacheline_aligned;
 static struct hpet_event_channel *__read_mostly hpet_events;
@@ -51,6 +51,7 @@ static unsigned int __read_mostly num_hp
 DEFINE_PER_CPU(struct hpet_event_channel *, cpu_bc_channel);
 
 unsigned long __read_mostly hpet_address;
+u8 __initdata hpet_blockid;
 
 /*
  * force_hpet_broadcast: by default legacy hpet broadcast will be stopped
@@ -252,6 +253,8 @@ static void hpet_msi_mask(struct irq_des
 
 static void hpet_msi_write(struct hpet_event_channel *ch, struct msi_msg *msg)
 {
+    if ( iommu_intremap )
+        iommu_update_ire_from_msi(&ch->msi, msg);
     hpet_write32(msg->data, HPET_Tn_ROUTE(ch->idx));
     hpet_write32(msg->address_lo, HPET_Tn_ROUTE(ch->idx) + 4);
 }
@@ -261,6 +264,8 @@ static void hpet_msi_read(struct hpet_ev
     msg->data = hpet_read32(HPET_Tn_ROUTE(ch->idx));
     msg->address_lo = hpet_read32(HPET_Tn_ROUTE(ch->idx) + 4);
     msg->address_hi = 0;
+    if ( iommu_intremap )
+        iommu_read_msi_from_ire(&ch->msi, msg);
 }
 
 static unsigned int hpet_msi_startup(struct irq_desc *desc)
@@ -292,6 +297,7 @@ static void hpet_msi_set_affinity(struct
     msg.data |= MSI_DATA_VECTOR(desc->arch.vector);
     msg.address_lo &= ~MSI_ADDR_DEST_ID_MASK;
     msg.address_lo |= MSI_ADDR_DEST_ID(dest);
+    msg.dest32 = dest;
     hpet_msi_write(desc->action->dev_id, &msg);
 }
 
@@ -316,35 +322,48 @@ static void __hpet_setup_msi_irq(struct 
     hpet_msi_write(desc->action->dev_id, &msg);
 }
 
-static int __init hpet_setup_msi_irq(unsigned int irq, struct hpet_event_channel *ch)
+static int __init hpet_setup_msi_irq(struct hpet_event_channel *ch)
 {
     int ret;
-    irq_desc_t *desc = irq_to_desc(irq);
+    irq_desc_t *desc = irq_to_desc(ch->msi.irq);
+
+    if ( iommu_intremap )
+    {
+        ch->msi.hpet_id = hpet_blockid;
+        ret = iommu_setup_hpet_msi(&ch->msi);
+        if ( ret )
+            return ret;
+    }
 
     desc->handler = &hpet_msi_type;
-    ret = request_irq(irq, hpet_interrupt_handler, 0, "HPET", ch);
+    ret = request_irq(ch->msi.irq, hpet_interrupt_handler, 0, "HPET", ch);
     if ( ret < 0 )
+    {
+        if ( iommu_intremap )
+            iommu_update_ire_from_msi(&ch->msi, NULL);
         return ret;
+    }
 
     __hpet_setup_msi_irq(desc);
 
     return 0;
 }
 
-static int __init hpet_assign_irq(unsigned int idx)
+static int __init hpet_assign_irq(struct hpet_event_channel *ch)
 {
     int irq;
 
     if ( (irq = create_irq(NUMA_NO_NODE)) < 0 )
         return irq;
 
-    if ( hpet_setup_msi_irq(irq, hpet_events + idx) )
+    ch->msi.irq = irq;
+    if ( hpet_setup_msi_irq(ch) )
     {
         destroy_irq(irq);
         return -EINVAL;
     }
 
-    return irq;
+    return 0;
 }
 
 static void __init hpet_fsb_cap_lookup(void)
@@ -352,14 +371,6 @@ static void __init hpet_fsb_cap_lookup(v
     u32 id;
     unsigned int i, num_chs;
 
-    /* TODO. */
-    if ( iommu_intremap )
-    {
-        printk(XENLOG_INFO "HPET's MSI mode hasn't been supported when "
-            "Interrupt Remapping is enabled.\n");
-        return;
-    }
-
     id = hpet_read32(HPET_ID);
 
     num_chs = ((id & HPET_ID_NUMBER) >> HPET_ID_NUMBER_SHIFT);
@@ -391,8 +402,8 @@ static void __init hpet_fsb_cap_lookup(v
         ch->flags = 0;
         ch->idx = i;
 
-        if ( (ch->irq = hpet_assign_irq(num_hpets_used++)) < 0 )
-            num_hpets_used--;
+        if ( hpet_assign_irq(ch) == 0 )
+            num_hpets_used++;
     }
 
     printk(XENLOG_INFO "HPET: %u timers (%u will be used for broadcast)\n",
@@ -438,7 +449,7 @@ static struct hpet_event_channel *hpet_g
 
 static void set_channel_irq_affinity(const struct hpet_event_channel *ch)
 {
-    struct irq_desc *desc = irq_to_desc(ch->irq);
+    struct irq_desc *desc = irq_to_desc(ch->msi.irq);
 
     ASSERT(!local_irq_is_enabled());
     spin_lock(&desc->lock);
@@ -530,7 +541,7 @@ void __init hpet_broadcast_init(void)
             hpet_events = xzalloc(struct hpet_event_channel);
         if ( !hpet_events || !zalloc_cpumask_var(&hpet_events->cpumask) )
             return;
-        hpet_events->irq = -1;
+        hpet_events->msi.irq = -1;
 
         /* Start HPET legacy interrupts */
         cfg |= HPET_CFG_LEGACY;
@@ -598,8 +609,8 @@ void hpet_broadcast_resume(void)
 
     for ( i = 0; i < n; i++ )
     {
-        if ( hpet_events[i].irq >= 0 )
-            __hpet_setup_msi_irq(irq_to_desc(hpet_events[i].irq));
+        if ( hpet_events[i].msi.irq >= 0 )
+            __hpet_setup_msi_irq(irq_to_desc(hpet_events[i].msi.irq));
 
         /* set HPET Tn as oneshot */
         cfg = hpet_read32(HPET_Tn_CFG(hpet_events[i].idx));
diff -r af3f99e19831 -r 368f71314e7c xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c	Thu Oct 18 10:07:48 2012 +0200
+++ b/xen/drivers/passthrough/iommu.c	Thu Oct 18 10:10:02 2012 +0200
@@ -495,6 +495,12 @@ unsigned int iommu_read_apic_from_ire(un
     return ops->read_apic_from_ire(apic, reg);
 }
 
+int __init iommu_setup_hpet_msi(struct msi_desc *msi)
+{
+    const struct iommu_ops *ops = iommu_get_ops();
+    return ops->setup_hpet_msi ? ops->setup_hpet_msi(msi) : 0;
+}
+
 void iommu_resume()
 {
     const struct iommu_ops *ops = iommu_get_ops();
diff -r af3f99e19831 -r 368f71314e7c xen/drivers/passthrough/vtd/dmar.c
--- a/xen/drivers/passthrough/vtd/dmar.c	Thu Oct 18 10:07:48 2012 +0200
+++ b/xen/drivers/passthrough/vtd/dmar.c	Thu Oct 18 10:10:02 2012 +0200
@@ -147,6 +147,34 @@ struct iommu * ioapic_to_iommu(unsigned 
     return NULL;
 }
 
+static bool_t acpi_hpet_device_match(
+    struct list_head *list, unsigned int hpet_id)
+{
+    struct acpi_hpet_unit *hpet;
+
+    list_for_each_entry( hpet, list, list )
+        if (hpet->id == hpet_id)
+            return 1;
+    return 0;
+}
+
+struct acpi_drhd_unit *hpet_to_drhd(unsigned int hpet_id)
+{
+    struct acpi_drhd_unit *drhd;
+
+    list_for_each_entry( drhd, &acpi_drhd_units, list )
+        if ( acpi_hpet_device_match(&drhd->hpet_list, hpet_id) )
+            return drhd;
+    return NULL;
+}
+
+struct iommu *hpet_to_iommu(unsigned int hpet_id)
+{
+    struct acpi_drhd_unit *drhd = hpet_to_drhd(hpet_id);
+
+    return drhd ? drhd->iommu : NULL;
+}
+
 static int __init acpi_register_atsr_unit(struct acpi_atsr_unit *atsr)
 {
     /*
@@ -330,6 +358,22 @@ static int __init acpi_parse_dev_scope(
             if ( iommu_verbose )
                 dprintk(VTDPREFIX, " MSI HPET: %04x:%02x:%02x.%u\n",
                         seg, bus, path->dev, path->fn);
+
+            if ( type == DMAR_TYPE )
+            {
+                struct acpi_drhd_unit *drhd = acpi_entry;
+                struct acpi_hpet_unit *acpi_hpet_unit;
+
+                acpi_hpet_unit = xmalloc(struct acpi_hpet_unit);
+                if ( !acpi_hpet_unit )
+                    return -ENOMEM;
+                acpi_hpet_unit->id = acpi_scope->enumeration_id;
+                acpi_hpet_unit->bus = bus;
+                acpi_hpet_unit->dev = path->dev;
+                acpi_hpet_unit->func = path->fn;
+                list_add(&acpi_hpet_unit->list, &drhd->hpet_list);
+            }
+
             break;
 
         case ACPI_DMAR_SCOPE_TYPE_ENDPOINT:
@@ -407,6 +451,7 @@ acpi_parse_one_drhd(struct acpi_dmar_hea
     dmaru->segment = drhd->segment;
     dmaru->include_all = drhd->flags & ACPI_DMAR_INCLUDE_ALL;
     INIT_LIST_HEAD(&dmaru->ioapic_list);
+    INIT_LIST_HEAD(&dmaru->hpet_list);
     if ( iommu_verbose )
         dprintk(VTDPREFIX, "  dmaru->address = %"PRIx64"\n",
                 dmaru->address);
diff -r af3f99e19831 -r 368f71314e7c xen/drivers/passthrough/vtd/dmar.h
--- a/xen/drivers/passthrough/vtd/dmar.h	Thu Oct 18 10:07:48 2012 +0200
+++ b/xen/drivers/passthrough/vtd/dmar.h	Thu Oct 18 10:10:02 2012 +0200
@@ -39,6 +39,19 @@ struct acpi_ioapic_unit {
     }ioapic;
 };
 
+struct acpi_hpet_unit {
+    struct list_head list;
+    unsigned int id;
+    union {
+        u16 bdf;
+        struct {
+            u16 func: 3,
+                dev:  5,
+                bus:  8;
+        };
+    };
+};
+
 struct dmar_scope {
     DECLARE_BITMAP(buses, 256);         /* buses owned by this unit */
     u16    *devices;                    /* devices owned by this unit */
@@ -53,6 +66,7 @@ struct acpi_drhd_unit {
     u8     include_all:1;
     struct iommu *iommu;
     struct list_head ioapic_list;
+    struct list_head hpet_list;
 };
 
 struct acpi_rmrr_unit {
diff -r af3f99e19831 -r 368f71314e7c xen/drivers/passthrough/vtd/extern.h
--- a/xen/drivers/passthrough/vtd/extern.h	Thu Oct 18 10:07:48 2012 +0200
+++ b/xen/drivers/passthrough/vtd/extern.h	Thu Oct 18 10:10:02 2012 +0200
@@ -54,7 +54,9 @@ int iommu_flush_iec_index(struct iommu *
 void clear_fault_bits(struct iommu *iommu);
 
 struct iommu * ioapic_to_iommu(unsigned int apic_id);
+struct iommu * hpet_to_iommu(unsigned int hpet_id);
 struct acpi_drhd_unit * ioapic_to_drhd(unsigned int apic_id);
+struct acpi_drhd_unit * hpet_to_drhd(unsigned int hpet_id);
 struct acpi_drhd_unit * iommu_to_drhd(struct iommu *iommu);
 struct acpi_rhsa_unit * drhd_to_rhsa(struct acpi_drhd_unit *drhd);
 
@@ -90,6 +92,8 @@ struct msi_msg;
 void msi_msg_read_remap_rte(struct msi_desc *, struct msi_msg *);
 void msi_msg_write_remap_rte(struct msi_desc *, struct msi_msg *);
 
+int intel_setup_hpet_msi(struct msi_desc *);
+
 int is_igd_vt_enabled_quirk(void);
 void platform_quirks_init(void);
 void vtd_ops_preamble_quirk(struct iommu* iommu);
diff -r af3f99e19831 -r 368f71314e7c xen/drivers/passthrough/vtd/intremap.c
--- a/xen/drivers/passthrough/vtd/intremap.c	Thu Oct 18 10:07:48 2012 +0200
+++ b/xen/drivers/passthrough/vtd/intremap.c	Thu Oct 18 10:10:02 2012 +0200
@@ -107,6 +107,19 @@ static u16 apicid_to_bdf(int apic_id)
     return 0;
 }
 
+static u16 hpetid_to_bdf(unsigned int hpet_id)
+{
+    struct acpi_drhd_unit *drhd = hpet_to_drhd(hpet_id);
+    struct acpi_hpet_unit *acpi_hpet_unit;
+
+    list_for_each_entry ( acpi_hpet_unit, &drhd->hpet_list, list )
+        if ( acpi_hpet_unit->id == hpet_id )
+            return acpi_hpet_unit->bdf;
+
+    dprintk(XENLOG_ERR VTDPREFIX, "Didn't find the bdf for HPET %u!\n", hpet_id);
+    return 0;
+}
+
 static void set_ire_sid(struct iremap_entry *ire,
                         unsigned int svt, unsigned int sq, unsigned int sid)
 {
@@ -121,6 +134,16 @@ static void set_ioapic_source_id(int api
                 apicid_to_bdf(apic_id));
 }
 
+static void set_hpet_source_id(unsigned int id, struct iremap_entry *ire)
+{
+    /*
+     * Should really use SQ_ALL_16. Some platforms are broken.
+     * While we figure out the right quirks for these broken platforms, use
+     * SQ_13_IGNORE_3 for now.
+     */
+    set_ire_sid(ire, SVT_VERIFY_SID_SQ, SQ_13_IGNORE_3, hpetid_to_bdf(id));
+}
+
 int iommu_supports_eim(void)
 {
     struct acpi_drhd_unit *drhd;
@@ -592,7 +615,10 @@ static int msi_msg_to_remap_entry(
         new_ire.lo.dst = ((msg->address_lo >> MSI_ADDR_DEST_ID_SHIFT)
                           & 0xff) << 8;
 
-    set_msi_source_id(pdev, &new_ire);
+    if ( pdev )
+        set_msi_source_id(pdev, &new_ire);
+    else
+        set_hpet_source_id(msi_desc->hpet_id, &new_ire);
     new_ire.hi.res_1 = 0;
     new_ire.lo.p = 1;    /* finally, set present bit */
 
@@ -624,7 +650,9 @@ void msi_msg_read_remap_rte(
     struct iommu *iommu = NULL;
     struct ir_ctrl *ir_ctrl;
 
-    if ( (drhd = acpi_find_matched_drhd_unit(pdev)) == NULL )
+    drhd = pdev ? acpi_find_matched_drhd_unit(pdev)
+                : hpet_to_drhd(msi_desc->hpet_id);
+    if ( !drhd )
         return;
     iommu = drhd->iommu;
 
@@ -643,7 +671,9 @@ void msi_msg_write_remap_rte(
     struct iommu *iommu = NULL;
     struct ir_ctrl *ir_ctrl;
 
-    if ( (drhd = acpi_find_matched_drhd_unit(pdev)) == NULL )
+    drhd = pdev ? acpi_find_matched_drhd_unit(pdev)
+                : hpet_to_drhd(msi_desc->hpet_id);
+    if ( !drhd )
         return;
     iommu = drhd->iommu;
 
@@ -654,6 +684,32 @@ void msi_msg_write_remap_rte(
     msi_msg_to_remap_entry(iommu, pdev, msi_desc, msg);
 }
 
+int __init intel_setup_hpet_msi(struct msi_desc *msi_desc)
+{
+    struct iommu *iommu = hpet_to_iommu(msi_desc->hpet_id);
+    struct ir_ctrl *ir_ctrl = iommu_ir_ctrl(iommu);
+    unsigned long flags;
+    int rc = 0;
+
+    if ( !ir_ctrl || !ir_ctrl->iremap_maddr )
+        return 0;
+
+    spin_lock_irqsave(&ir_ctrl->iremap_lock, flags);
+    msi_desc->remap_index = alloc_remap_entry(iommu);
+    if ( msi_desc->remap_index >= IREMAP_ENTRY_NR )
+    {
+        dprintk(XENLOG_ERR VTDPREFIX,
+                "%s: intremap index (%d) is larger than"
+                " the maximum index (%d)!\n",
+                __func__, msi_desc->remap_index, IREMAP_ENTRY_NR - 1);
+        msi_desc->remap_index = -1;
+        rc = -ENXIO;
+    }
+    spin_unlock_irqrestore(&ir_ctrl->iremap_lock, flags);
+
+    return rc;
+}
+
 int enable_intremap(struct iommu *iommu, int eim)
 {
     struct acpi_drhd_unit *drhd;
diff -r af3f99e19831 -r 368f71314e7c xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Thu Oct 18 10:07:48 2012 +0200
+++ b/xen/drivers/passthrough/vtd/iommu.c	Thu Oct 18 10:10:02 2012 +0200
@@ -2396,6 +2396,7 @@ const struct iommu_ops intel_iommu_ops =
     .update_ire_from_msi = msi_msg_write_remap_rte,
     .read_apic_from_ire = io_apic_read_remap_rte,
     .read_msi_from_ire = msi_msg_read_remap_rte,
+    .setup_hpet_msi = intel_setup_hpet_msi,
     .suspend = vtd_suspend,
     .resume = vtd_resume,
     .share_p2m = iommu_set_pgd,
diff -r af3f99e19831 -r 368f71314e7c xen/include/asm-x86/hpet.h
--- a/xen/include/asm-x86/hpet.h	Thu Oct 18 10:07:48 2012 +0200
+++ b/xen/include/asm-x86/hpet.h	Thu Oct 18 10:10:02 2012 +0200
@@ -53,6 +53,7 @@
     (*(volatile u32 *)(fix_to_virt(FIX_HPET_BASE) + (x)) = (y))
 
 extern unsigned long hpet_address;
+extern u8 hpet_blockid;
 
 /*
  * Detect and initialise HPET hardware: return counter update frequency.
diff -r af3f99e19831 -r 368f71314e7c xen/include/asm-x86/msi.h
--- a/xen/include/asm-x86/msi.h	Thu Oct 18 10:07:48 2012 +0200
+++ b/xen/include/asm-x86/msi.h	Thu Oct 18 10:10:02 2012 +0200
@@ -97,7 +97,10 @@ struct msi_desc {
 
 	struct list_head list;
 
-	void __iomem *mask_base;        /* va for the entry in mask table */
+	union {
+		void __iomem *mask_base;/* va for the entry in mask table */
+		unsigned int hpet_id;   /* HPET (dev is NULL)             */
+	};
 	struct pci_dev *dev;
 	int irq;
 
diff -r af3f99e19831 -r 368f71314e7c xen/include/xen/iommu.h
--- a/xen/include/xen/iommu.h	Thu Oct 18 10:07:48 2012 +0200
+++ b/xen/include/xen/iommu.h	Thu Oct 18 10:10:02 2012 +0200
@@ -109,6 +109,7 @@ struct iommu_ops {
     void (*update_ire_from_msi)(struct msi_desc *msi_desc, struct msi_msg *msg);
     void (*read_msi_from_ire)(struct msi_desc *msi_desc, struct msi_msg *msg);
     unsigned int (*read_apic_from_ire)(unsigned int apic, unsigned int reg);
+    int (*setup_hpet_msi)(struct msi_desc *);
     void (*suspend)(void);
     void (*resume)(void);
     void (*share_p2m)(struct domain *d);
@@ -122,6 +123,7 @@ void iommu_update_ire_from_apic(unsigned
 void iommu_update_ire_from_msi(struct msi_desc *msi_desc, struct msi_msg *msg);
 void iommu_read_msi_from_ire(struct msi_desc *msi_desc, struct msi_msg *msg);
 unsigned int iommu_read_apic_from_ire(unsigned int apic, unsigned int reg);
+int iommu_setup_hpet_msi(struct msi_desc *);
 
 void iommu_suspend(void);
 void iommu_resume(void);

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmo-0008Lc-JS; Fri, 19 Oct 2012 22:11:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmm-0008ID-Lo
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:21 +0000
Received: from [85.158.138.51:53635] by server-9.bemta-3.messagelabs.com id
	F2/F5-16841-700D1805; Fri, 19 Oct 2012 22:11:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-174.messagelabs.com!1350684677!27464541!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18724 invoked from network); 19 Oct 2012 22:11:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmi-0005VC-TS
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmi-0008UM-Rj
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:16 +0000
Message-Id: <E1TPKmi-0008UM-Rj@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/HPET: allow use for broadcast
	when interrupt remapping is in effect
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1350547802 -7200
# Node ID 368f71314e7c7fdd78480544e155ef7948429ea2
# Parent  af3f99e1983181bde2b3077d0eb4c4206dbca343
x86/HPET: allow use for broadcast when interrupt remapping is in effect

This requires some additions to the VT-d side; AMD IOMMUs use the
"normal" MSI message format even when interrupt remapping is enabled,
thus making adjustments here unnecessary.

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


diff -r af3f99e19831 -r 368f71314e7c xen/arch/x86/acpi/boot.c
--- a/xen/arch/x86/acpi/boot.c	Thu Oct 18 10:07:48 2012 +0200
+++ b/xen/arch/x86/acpi/boot.c	Thu Oct 18 10:10:02 2012 +0200
@@ -276,6 +276,7 @@ static int __init acpi_parse_hpet(struct
 	}
 
 	hpet_address = hpet_tbl->address.address;
+	hpet_blockid = hpet_tbl->sequence;
 	printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n",
 	       hpet_tbl->id, hpet_address);
 
diff -r af3f99e19831 -r 368f71314e7c xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c	Thu Oct 18 10:07:48 2012 +0200
+++ b/xen/arch/x86/hpet.c	Thu Oct 18 10:10:02 2012 +0200
@@ -40,7 +40,7 @@ struct hpet_event_channel
 
     unsigned int idx;   /* physical channel idx */
     unsigned int cpu;   /* msi target */
-    int irq;            /* msi irq */
+    struct msi_desc msi;/* msi state */
     unsigned int flags; /* HPET_EVT_x */
 } __cacheline_aligned;
 static struct hpet_event_channel *__read_mostly hpet_events;
@@ -51,6 +51,7 @@ static unsigned int __read_mostly num_hp
 DEFINE_PER_CPU(struct hpet_event_channel *, cpu_bc_channel);
 
 unsigned long __read_mostly hpet_address;
+u8 __initdata hpet_blockid;
 
 /*
  * force_hpet_broadcast: by default legacy hpet broadcast will be stopped
@@ -252,6 +253,8 @@ static void hpet_msi_mask(struct irq_des
 
 static void hpet_msi_write(struct hpet_event_channel *ch, struct msi_msg *msg)
 {
+    if ( iommu_intremap )
+        iommu_update_ire_from_msi(&ch->msi, msg);
     hpet_write32(msg->data, HPET_Tn_ROUTE(ch->idx));
     hpet_write32(msg->address_lo, HPET_Tn_ROUTE(ch->idx) + 4);
 }
@@ -261,6 +264,8 @@ static void hpet_msi_read(struct hpet_ev
     msg->data = hpet_read32(HPET_Tn_ROUTE(ch->idx));
     msg->address_lo = hpet_read32(HPET_Tn_ROUTE(ch->idx) + 4);
     msg->address_hi = 0;
+    if ( iommu_intremap )
+        iommu_read_msi_from_ire(&ch->msi, msg);
 }
 
 static unsigned int hpet_msi_startup(struct irq_desc *desc)
@@ -292,6 +297,7 @@ static void hpet_msi_set_affinity(struct
     msg.data |= MSI_DATA_VECTOR(desc->arch.vector);
     msg.address_lo &= ~MSI_ADDR_DEST_ID_MASK;
     msg.address_lo |= MSI_ADDR_DEST_ID(dest);
+    msg.dest32 = dest;
     hpet_msi_write(desc->action->dev_id, &msg);
 }
 
@@ -316,35 +322,48 @@ static void __hpet_setup_msi_irq(struct 
     hpet_msi_write(desc->action->dev_id, &msg);
 }
 
-static int __init hpet_setup_msi_irq(unsigned int irq, struct hpet_event_channel *ch)
+static int __init hpet_setup_msi_irq(struct hpet_event_channel *ch)
 {
     int ret;
-    irq_desc_t *desc = irq_to_desc(irq);
+    irq_desc_t *desc = irq_to_desc(ch->msi.irq);
+
+    if ( iommu_intremap )
+    {
+        ch->msi.hpet_id = hpet_blockid;
+        ret = iommu_setup_hpet_msi(&ch->msi);
+        if ( ret )
+            return ret;
+    }
 
     desc->handler = &hpet_msi_type;
-    ret = request_irq(irq, hpet_interrupt_handler, 0, "HPET", ch);
+    ret = request_irq(ch->msi.irq, hpet_interrupt_handler, 0, "HPET", ch);
     if ( ret < 0 )
+    {
+        if ( iommu_intremap )
+            iommu_update_ire_from_msi(&ch->msi, NULL);
         return ret;
+    }
 
     __hpet_setup_msi_irq(desc);
 
     return 0;
 }
 
-static int __init hpet_assign_irq(unsigned int idx)
+static int __init hpet_assign_irq(struct hpet_event_channel *ch)
 {
     int irq;
 
     if ( (irq = create_irq(NUMA_NO_NODE)) < 0 )
         return irq;
 
-    if ( hpet_setup_msi_irq(irq, hpet_events + idx) )
+    ch->msi.irq = irq;
+    if ( hpet_setup_msi_irq(ch) )
     {
         destroy_irq(irq);
         return -EINVAL;
     }
 
-    return irq;
+    return 0;
 }
 
 static void __init hpet_fsb_cap_lookup(void)
@@ -352,14 +371,6 @@ static void __init hpet_fsb_cap_lookup(v
     u32 id;
     unsigned int i, num_chs;
 
-    /* TODO. */
-    if ( iommu_intremap )
-    {
-        printk(XENLOG_INFO "HPET's MSI mode hasn't been supported when "
-            "Interrupt Remapping is enabled.\n");
-        return;
-    }
-
     id = hpet_read32(HPET_ID);
 
     num_chs = ((id & HPET_ID_NUMBER) >> HPET_ID_NUMBER_SHIFT);
@@ -391,8 +402,8 @@ static void __init hpet_fsb_cap_lookup(v
         ch->flags = 0;
         ch->idx = i;
 
-        if ( (ch->irq = hpet_assign_irq(num_hpets_used++)) < 0 )
-            num_hpets_used--;
+        if ( hpet_assign_irq(ch) == 0 )
+            num_hpets_used++;
     }
 
     printk(XENLOG_INFO "HPET: %u timers (%u will be used for broadcast)\n",
@@ -438,7 +449,7 @@ static struct hpet_event_channel *hpet_g
 
 static void set_channel_irq_affinity(const struct hpet_event_channel *ch)
 {
-    struct irq_desc *desc = irq_to_desc(ch->irq);
+    struct irq_desc *desc = irq_to_desc(ch->msi.irq);
 
     ASSERT(!local_irq_is_enabled());
     spin_lock(&desc->lock);
@@ -530,7 +541,7 @@ void __init hpet_broadcast_init(void)
             hpet_events = xzalloc(struct hpet_event_channel);
         if ( !hpet_events || !zalloc_cpumask_var(&hpet_events->cpumask) )
             return;
-        hpet_events->irq = -1;
+        hpet_events->msi.irq = -1;
 
         /* Start HPET legacy interrupts */
         cfg |= HPET_CFG_LEGACY;
@@ -598,8 +609,8 @@ void hpet_broadcast_resume(void)
 
     for ( i = 0; i < n; i++ )
     {
-        if ( hpet_events[i].irq >= 0 )
-            __hpet_setup_msi_irq(irq_to_desc(hpet_events[i].irq));
+        if ( hpet_events[i].msi.irq >= 0 )
+            __hpet_setup_msi_irq(irq_to_desc(hpet_events[i].msi.irq));
 
         /* set HPET Tn as oneshot */
         cfg = hpet_read32(HPET_Tn_CFG(hpet_events[i].idx));
diff -r af3f99e19831 -r 368f71314e7c xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c	Thu Oct 18 10:07:48 2012 +0200
+++ b/xen/drivers/passthrough/iommu.c	Thu Oct 18 10:10:02 2012 +0200
@@ -495,6 +495,12 @@ unsigned int iommu_read_apic_from_ire(un
     return ops->read_apic_from_ire(apic, reg);
 }
 
+int __init iommu_setup_hpet_msi(struct msi_desc *msi)
+{
+    const struct iommu_ops *ops = iommu_get_ops();
+    return ops->setup_hpet_msi ? ops->setup_hpet_msi(msi) : 0;
+}
+
 void iommu_resume()
 {
     const struct iommu_ops *ops = iommu_get_ops();
diff -r af3f99e19831 -r 368f71314e7c xen/drivers/passthrough/vtd/dmar.c
--- a/xen/drivers/passthrough/vtd/dmar.c	Thu Oct 18 10:07:48 2012 +0200
+++ b/xen/drivers/passthrough/vtd/dmar.c	Thu Oct 18 10:10:02 2012 +0200
@@ -147,6 +147,34 @@ struct iommu * ioapic_to_iommu(unsigned 
     return NULL;
 }
 
+static bool_t acpi_hpet_device_match(
+    struct list_head *list, unsigned int hpet_id)
+{
+    struct acpi_hpet_unit *hpet;
+
+    list_for_each_entry( hpet, list, list )
+        if (hpet->id == hpet_id)
+            return 1;
+    return 0;
+}
+
+struct acpi_drhd_unit *hpet_to_drhd(unsigned int hpet_id)
+{
+    struct acpi_drhd_unit *drhd;
+
+    list_for_each_entry( drhd, &acpi_drhd_units, list )
+        if ( acpi_hpet_device_match(&drhd->hpet_list, hpet_id) )
+            return drhd;
+    return NULL;
+}
+
+struct iommu *hpet_to_iommu(unsigned int hpet_id)
+{
+    struct acpi_drhd_unit *drhd = hpet_to_drhd(hpet_id);
+
+    return drhd ? drhd->iommu : NULL;
+}
+
 static int __init acpi_register_atsr_unit(struct acpi_atsr_unit *atsr)
 {
     /*
@@ -330,6 +358,22 @@ static int __init acpi_parse_dev_scope(
             if ( iommu_verbose )
                 dprintk(VTDPREFIX, " MSI HPET: %04x:%02x:%02x.%u\n",
                         seg, bus, path->dev, path->fn);
+
+            if ( type == DMAR_TYPE )
+            {
+                struct acpi_drhd_unit *drhd = acpi_entry;
+                struct acpi_hpet_unit *acpi_hpet_unit;
+
+                acpi_hpet_unit = xmalloc(struct acpi_hpet_unit);
+                if ( !acpi_hpet_unit )
+                    return -ENOMEM;
+                acpi_hpet_unit->id = acpi_scope->enumeration_id;
+                acpi_hpet_unit->bus = bus;
+                acpi_hpet_unit->dev = path->dev;
+                acpi_hpet_unit->func = path->fn;
+                list_add(&acpi_hpet_unit->list, &drhd->hpet_list);
+            }
+
             break;
 
         case ACPI_DMAR_SCOPE_TYPE_ENDPOINT:
@@ -407,6 +451,7 @@ acpi_parse_one_drhd(struct acpi_dmar_hea
     dmaru->segment = drhd->segment;
     dmaru->include_all = drhd->flags & ACPI_DMAR_INCLUDE_ALL;
     INIT_LIST_HEAD(&dmaru->ioapic_list);
+    INIT_LIST_HEAD(&dmaru->hpet_list);
     if ( iommu_verbose )
         dprintk(VTDPREFIX, "  dmaru->address = %"PRIx64"\n",
                 dmaru->address);
diff -r af3f99e19831 -r 368f71314e7c xen/drivers/passthrough/vtd/dmar.h
--- a/xen/drivers/passthrough/vtd/dmar.h	Thu Oct 18 10:07:48 2012 +0200
+++ b/xen/drivers/passthrough/vtd/dmar.h	Thu Oct 18 10:10:02 2012 +0200
@@ -39,6 +39,19 @@ struct acpi_ioapic_unit {
     }ioapic;
 };
 
+struct acpi_hpet_unit {
+    struct list_head list;
+    unsigned int id;
+    union {
+        u16 bdf;
+        struct {
+            u16 func: 3,
+                dev:  5,
+                bus:  8;
+        };
+    };
+};
+
 struct dmar_scope {
     DECLARE_BITMAP(buses, 256);         /* buses owned by this unit */
     u16    *devices;                    /* devices owned by this unit */
@@ -53,6 +66,7 @@ struct acpi_drhd_unit {
     u8     include_all:1;
     struct iommu *iommu;
     struct list_head ioapic_list;
+    struct list_head hpet_list;
 };
 
 struct acpi_rmrr_unit {
diff -r af3f99e19831 -r 368f71314e7c xen/drivers/passthrough/vtd/extern.h
--- a/xen/drivers/passthrough/vtd/extern.h	Thu Oct 18 10:07:48 2012 +0200
+++ b/xen/drivers/passthrough/vtd/extern.h	Thu Oct 18 10:10:02 2012 +0200
@@ -54,7 +54,9 @@ int iommu_flush_iec_index(struct iommu *
 void clear_fault_bits(struct iommu *iommu);
 
 struct iommu * ioapic_to_iommu(unsigned int apic_id);
+struct iommu * hpet_to_iommu(unsigned int hpet_id);
 struct acpi_drhd_unit * ioapic_to_drhd(unsigned int apic_id);
+struct acpi_drhd_unit * hpet_to_drhd(unsigned int hpet_id);
 struct acpi_drhd_unit * iommu_to_drhd(struct iommu *iommu);
 struct acpi_rhsa_unit * drhd_to_rhsa(struct acpi_drhd_unit *drhd);
 
@@ -90,6 +92,8 @@ struct msi_msg;
 void msi_msg_read_remap_rte(struct msi_desc *, struct msi_msg *);
 void msi_msg_write_remap_rte(struct msi_desc *, struct msi_msg *);
 
+int intel_setup_hpet_msi(struct msi_desc *);
+
 int is_igd_vt_enabled_quirk(void);
 void platform_quirks_init(void);
 void vtd_ops_preamble_quirk(struct iommu* iommu);
diff -r af3f99e19831 -r 368f71314e7c xen/drivers/passthrough/vtd/intremap.c
--- a/xen/drivers/passthrough/vtd/intremap.c	Thu Oct 18 10:07:48 2012 +0200
+++ b/xen/drivers/passthrough/vtd/intremap.c	Thu Oct 18 10:10:02 2012 +0200
@@ -107,6 +107,19 @@ static u16 apicid_to_bdf(int apic_id)
     return 0;
 }
 
+static u16 hpetid_to_bdf(unsigned int hpet_id)
+{
+    struct acpi_drhd_unit *drhd = hpet_to_drhd(hpet_id);
+    struct acpi_hpet_unit *acpi_hpet_unit;
+
+    list_for_each_entry ( acpi_hpet_unit, &drhd->hpet_list, list )
+        if ( acpi_hpet_unit->id == hpet_id )
+            return acpi_hpet_unit->bdf;
+
+    dprintk(XENLOG_ERR VTDPREFIX, "Didn't find the bdf for HPET %u!\n", hpet_id);
+    return 0;
+}
+
 static void set_ire_sid(struct iremap_entry *ire,
                         unsigned int svt, unsigned int sq, unsigned int sid)
 {
@@ -121,6 +134,16 @@ static void set_ioapic_source_id(int api
                 apicid_to_bdf(apic_id));
 }
 
+static void set_hpet_source_id(unsigned int id, struct iremap_entry *ire)
+{
+    /*
+     * Should really use SQ_ALL_16. Some platforms are broken.
+     * While we figure out the right quirks for these broken platforms, use
+     * SQ_13_IGNORE_3 for now.
+     */
+    set_ire_sid(ire, SVT_VERIFY_SID_SQ, SQ_13_IGNORE_3, hpetid_to_bdf(id));
+}
+
 int iommu_supports_eim(void)
 {
     struct acpi_drhd_unit *drhd;
@@ -592,7 +615,10 @@ static int msi_msg_to_remap_entry(
         new_ire.lo.dst = ((msg->address_lo >> MSI_ADDR_DEST_ID_SHIFT)
                           & 0xff) << 8;
 
-    set_msi_source_id(pdev, &new_ire);
+    if ( pdev )
+        set_msi_source_id(pdev, &new_ire);
+    else
+        set_hpet_source_id(msi_desc->hpet_id, &new_ire);
     new_ire.hi.res_1 = 0;
     new_ire.lo.p = 1;    /* finally, set present bit */
 
@@ -624,7 +650,9 @@ void msi_msg_read_remap_rte(
     struct iommu *iommu = NULL;
     struct ir_ctrl *ir_ctrl;
 
-    if ( (drhd = acpi_find_matched_drhd_unit(pdev)) == NULL )
+    drhd = pdev ? acpi_find_matched_drhd_unit(pdev)
+                : hpet_to_drhd(msi_desc->hpet_id);
+    if ( !drhd )
         return;
     iommu = drhd->iommu;
 
@@ -643,7 +671,9 @@ void msi_msg_write_remap_rte(
     struct iommu *iommu = NULL;
     struct ir_ctrl *ir_ctrl;
 
-    if ( (drhd = acpi_find_matched_drhd_unit(pdev)) == NULL )
+    drhd = pdev ? acpi_find_matched_drhd_unit(pdev)
+                : hpet_to_drhd(msi_desc->hpet_id);
+    if ( !drhd )
         return;
     iommu = drhd->iommu;
 
@@ -654,6 +684,32 @@ void msi_msg_write_remap_rte(
     msi_msg_to_remap_entry(iommu, pdev, msi_desc, msg);
 }
 
+int __init intel_setup_hpet_msi(struct msi_desc *msi_desc)
+{
+    struct iommu *iommu = hpet_to_iommu(msi_desc->hpet_id);
+    struct ir_ctrl *ir_ctrl = iommu_ir_ctrl(iommu);
+    unsigned long flags;
+    int rc = 0;
+
+    if ( !ir_ctrl || !ir_ctrl->iremap_maddr )
+        return 0;
+
+    spin_lock_irqsave(&ir_ctrl->iremap_lock, flags);
+    msi_desc->remap_index = alloc_remap_entry(iommu);
+    if ( msi_desc->remap_index >= IREMAP_ENTRY_NR )
+    {
+        dprintk(XENLOG_ERR VTDPREFIX,
+                "%s: intremap index (%d) is larger than"
+                " the maximum index (%d)!\n",
+                __func__, msi_desc->remap_index, IREMAP_ENTRY_NR - 1);
+        msi_desc->remap_index = -1;
+        rc = -ENXIO;
+    }
+    spin_unlock_irqrestore(&ir_ctrl->iremap_lock, flags);
+
+    return rc;
+}
+
 int enable_intremap(struct iommu *iommu, int eim)
 {
     struct acpi_drhd_unit *drhd;
diff -r af3f99e19831 -r 368f71314e7c xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Thu Oct 18 10:07:48 2012 +0200
+++ b/xen/drivers/passthrough/vtd/iommu.c	Thu Oct 18 10:10:02 2012 +0200
@@ -2396,6 +2396,7 @@ const struct iommu_ops intel_iommu_ops =
     .update_ire_from_msi = msi_msg_write_remap_rte,
     .read_apic_from_ire = io_apic_read_remap_rte,
     .read_msi_from_ire = msi_msg_read_remap_rte,
+    .setup_hpet_msi = intel_setup_hpet_msi,
     .suspend = vtd_suspend,
     .resume = vtd_resume,
     .share_p2m = iommu_set_pgd,
diff -r af3f99e19831 -r 368f71314e7c xen/include/asm-x86/hpet.h
--- a/xen/include/asm-x86/hpet.h	Thu Oct 18 10:07:48 2012 +0200
+++ b/xen/include/asm-x86/hpet.h	Thu Oct 18 10:10:02 2012 +0200
@@ -53,6 +53,7 @@
     (*(volatile u32 *)(fix_to_virt(FIX_HPET_BASE) + (x)) = (y))
 
 extern unsigned long hpet_address;
+extern u8 hpet_blockid;
 
 /*
  * Detect and initialise HPET hardware: return counter update frequency.
diff -r af3f99e19831 -r 368f71314e7c xen/include/asm-x86/msi.h
--- a/xen/include/asm-x86/msi.h	Thu Oct 18 10:07:48 2012 +0200
+++ b/xen/include/asm-x86/msi.h	Thu Oct 18 10:10:02 2012 +0200
@@ -97,7 +97,10 @@ struct msi_desc {
 
 	struct list_head list;
 
-	void __iomem *mask_base;        /* va for the entry in mask table */
+	union {
+		void __iomem *mask_base;/* va for the entry in mask table */
+		unsigned int hpet_id;   /* HPET (dev is NULL)             */
+	};
 	struct pci_dev *dev;
 	int irq;
 
diff -r af3f99e19831 -r 368f71314e7c xen/include/xen/iommu.h
--- a/xen/include/xen/iommu.h	Thu Oct 18 10:07:48 2012 +0200
+++ b/xen/include/xen/iommu.h	Thu Oct 18 10:10:02 2012 +0200
@@ -109,6 +109,7 @@ struct iommu_ops {
     void (*update_ire_from_msi)(struct msi_desc *msi_desc, struct msi_msg *msg);
     void (*read_msi_from_ire)(struct msi_desc *msi_desc, struct msi_msg *msg);
     unsigned int (*read_apic_from_ire)(unsigned int apic, unsigned int reg);
+    int (*setup_hpet_msi)(struct msi_desc *);
     void (*suspend)(void);
     void (*resume)(void);
     void (*share_p2m)(struct domain *d);
@@ -122,6 +123,7 @@ void iommu_update_ire_from_apic(unsigned
 void iommu_update_ire_from_msi(struct msi_desc *msi_desc, struct msi_msg *msg);
 void iommu_read_msi_from_ire(struct msi_desc *msi_desc, struct msi_msg *msg);
 unsigned int iommu_read_apic_from_ire(unsigned int apic, unsigned int reg);
+int iommu_setup_hpet_msi(struct msi_desc *);
 
 void iommu_suspend(void);
 void iommu_resume(void);

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22: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 1TPKmo-0008LP-GV; Fri, 19 Oct 2012 22:11:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmm-0008IC-Mk
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:20 +0000
Received: from [85.158.137.99:46406] by server-13.bemta-3.messagelabs.com id
	52/22-26794-700D1805; Fri, 19 Oct 2012 22:11:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-217.messagelabs.com!1350684678!22294634!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20659 invoked from network); 19 Oct 2012 22:11:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmj-0005VI-UG
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmj-0008Uq-T7
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:17 +0000
Message-Id: <E1TPKmj-0008Uq-T7@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] stubdom: fix compile errors in grub
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1350549299 -3600
# Node ID 33348baecf37df1146730c527e0f023465abb91e
# Parent  8dcab28b8081ea9ea2f11d8c512087df0ae72550
stubdom: fix compile errors in grub

Building xen.rpm in SLES11 started to fail due to these compiler
warnings:

[ 1436s] ../grub-upstream/netboot/fsys_tftp.c:213: warning: operation on 'block' may be undefined
[ 1437s] ../grub-upstream/netboot/main.c:444: warning: operation on 'block' may be undefined

[ 1234s] E: xen sequence-point ../grub-upstream/netboot/fsys_tftp.c:213
[ 1234s] E: xen sequence-point ../grub-upstream/netboot/main.c:444

The reason for this is that the assignment is done twice:
 tp.u.ack.block = ((uint16_t)( (((uint16_t)((block = prevblock)) & (uint16_t)0x00ffU) << 8) | (((uint16_t)((block = prevblock)) & (uint16_t)0xff00U) >> 8)));

Fix this package build error by adding another patch for grub, which
moves the assignment out of the macro usage.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 8dcab28b8081 -r 33348baecf37 stubdom/grub.patches/70compiler_warnings.diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stubdom/grub.patches/70compiler_warnings.diff	Thu Oct 18 09:34:59 2012 +0100
@@ -0,0 +1,45 @@
+[ 1436s] ../grub-upstream/netboot/fsys_tftp.c:213: warning: operation on 'block' may be undefined
+[ 1437s] ../grub-upstream/netboot/main.c:444: warning: operation on 'block' may be undefined
+
+[ 1234s] E: xen sequence-point ../grub-upstream/netboot/fsys_tftp.c:213
+[ 1234s] E: xen sequence-point ../grub-upstream/netboot/main.c:444
+
+---
+ netboot/fsys_tftp.c |    5 ++++-
+ netboot/main.c      |    5 ++++-
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+Index: grub-0.97/netboot/fsys_tftp.c
+===================================================================
+--- grub-0.97.orig/netboot/fsys_tftp.c
++++ grub-0.97/netboot/fsys_tftp.c
+@@ -209,8 +209,11 @@ buf_fill (int abort)
+ 	break;
+ 
+       if ((block || bcounter) && (block != prevblock + (unsigned short) 1))
++      {
++	      block = prevblock;
+ 	/* Block order should be continuous */
+-	tp.u.ack.block = htons (block = prevblock);
++	tp.u.ack.block = htons (block);
++      }
+       
+       /* Should be continuous.  */
+       tp.opcode = abort ? htons (TFTP_ERROR) : htons (TFTP_ACK);
+Index: grub-0.97/netboot/main.c
+===================================================================
+--- grub-0.97.orig/netboot/main.c
++++ grub-0.97/netboot/main.c
+@@ -440,8 +440,11 @@ tftp (const char *name, int (*fnc) (unsi
+ 	break;
+       
+       if ((block || bcounter) && (block != prevblock + 1))
++      {
++	      block = prevblock;
+ 	/* Block order should be continuous */
+-	tp.u.ack.block = htons (block = prevblock);
++	tp.u.ack.block = htons (block);
++      }
+       
+       /* Should be continuous.  */
+       tp.opcode = htons (TFTP_ACK);

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22: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 1TPKmo-0008LP-GV; Fri, 19 Oct 2012 22:11:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmm-0008IC-Mk
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:20 +0000
Received: from [85.158.137.99:46406] by server-13.bemta-3.messagelabs.com id
	52/22-26794-700D1805; Fri, 19 Oct 2012 22:11:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-217.messagelabs.com!1350684678!22294634!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20659 invoked from network); 19 Oct 2012 22:11:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmj-0005VI-UG
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmj-0008Uq-T7
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:17 +0000
Message-Id: <E1TPKmj-0008Uq-T7@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] stubdom: fix compile errors in grub
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1350549299 -3600
# Node ID 33348baecf37df1146730c527e0f023465abb91e
# Parent  8dcab28b8081ea9ea2f11d8c512087df0ae72550
stubdom: fix compile errors in grub

Building xen.rpm in SLES11 started to fail due to these compiler
warnings:

[ 1436s] ../grub-upstream/netboot/fsys_tftp.c:213: warning: operation on 'block' may be undefined
[ 1437s] ../grub-upstream/netboot/main.c:444: warning: operation on 'block' may be undefined

[ 1234s] E: xen sequence-point ../grub-upstream/netboot/fsys_tftp.c:213
[ 1234s] E: xen sequence-point ../grub-upstream/netboot/main.c:444

The reason for this is that the assignment is done twice:
 tp.u.ack.block = ((uint16_t)( (((uint16_t)((block = prevblock)) & (uint16_t)0x00ffU) << 8) | (((uint16_t)((block = prevblock)) & (uint16_t)0xff00U) >> 8)));

Fix this package build error by adding another patch for grub, which
moves the assignment out of the macro usage.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 8dcab28b8081 -r 33348baecf37 stubdom/grub.patches/70compiler_warnings.diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stubdom/grub.patches/70compiler_warnings.diff	Thu Oct 18 09:34:59 2012 +0100
@@ -0,0 +1,45 @@
+[ 1436s] ../grub-upstream/netboot/fsys_tftp.c:213: warning: operation on 'block' may be undefined
+[ 1437s] ../grub-upstream/netboot/main.c:444: warning: operation on 'block' may be undefined
+
+[ 1234s] E: xen sequence-point ../grub-upstream/netboot/fsys_tftp.c:213
+[ 1234s] E: xen sequence-point ../grub-upstream/netboot/main.c:444
+
+---
+ netboot/fsys_tftp.c |    5 ++++-
+ netboot/main.c      |    5 ++++-
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+Index: grub-0.97/netboot/fsys_tftp.c
+===================================================================
+--- grub-0.97.orig/netboot/fsys_tftp.c
++++ grub-0.97/netboot/fsys_tftp.c
+@@ -209,8 +209,11 @@ buf_fill (int abort)
+ 	break;
+ 
+       if ((block || bcounter) && (block != prevblock + (unsigned short) 1))
++      {
++	      block = prevblock;
+ 	/* Block order should be continuous */
+-	tp.u.ack.block = htons (block = prevblock);
++	tp.u.ack.block = htons (block);
++      }
+       
+       /* Should be continuous.  */
+       tp.opcode = abort ? htons (TFTP_ERROR) : htons (TFTP_ACK);
+Index: grub-0.97/netboot/main.c
+===================================================================
+--- grub-0.97.orig/netboot/main.c
++++ grub-0.97/netboot/main.c
+@@ -440,8 +440,11 @@ tftp (const char *name, int (*fnc) (unsi
+ 	break;
+       
+       if ((block || bcounter) && (block != prevblock + 1))
++      {
++	      block = prevblock;
+ 	/* Block order should be continuous */
+-	tp.u.ack.block = htons (block = prevblock);
++	tp.u.ack.block = htons (block);
++      }
+       
+       /* Should be continuous.  */
+       tp.opcode = htons (TFTP_ACK);

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22: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 1TPKmo-0008L9-CS; Fri, 19 Oct 2012 22:11:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKml-0008Gl-SC
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:20 +0000
Received: from [85.158.137.99:21800] by server-11.bemta-3.messagelabs.com id
	93/CA-24008-600D1805; Fri, 19 Oct 2012 22:11:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-217.messagelabs.com!1350684674!22263745!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31939 invoked from network); 19 Oct 2012 22:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmg-0005Ux-4t
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmg-0008T8-2m
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:14 +0000
Message-Id: <E1TPKmg-0008T8-2m@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: replace XEN_GUEST_HANDLE with
	XEN_GUEST_HANDLE_PARAM when appropriate
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1350488633 -3600
# Node ID 9eafdcd5ff0b55acaf65dd482179a3ca1db78482
# Parent  1eb4b2f7465f8c7c15fe1d6a198d53dda30372a9
xen: replace XEN_GUEST_HANDLE with XEN_GUEST_HANDLE_PARAM when appropriate

Note: these changes don't make any difference on x86.

Replace XEN_GUEST_HANDLE with XEN_GUEST_HANDLE_PARAM when it is used as
an hypercall argument.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/arm/domain.c
--- a/xen/arch/arm/domain.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/arm/domain.c	Wed Oct 17 16:43:53 2012 +0100
@@ -519,7 +519,7 @@ void arch_dump_domain_info(struct domain
 {
 }
 
-long arch_do_vcpu_op(int cmd, struct vcpu *v, XEN_GUEST_HANDLE(void) arg)
+long arch_do_vcpu_op(int cmd, struct vcpu *v, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     return -ENOSYS;
 }
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/arm/domctl.c
--- a/xen/arch/arm/domctl.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/arm/domctl.c	Wed Oct 17 16:43:53 2012 +0100
@@ -11,7 +11,7 @@
 #include <public/domctl.h>
 
 long arch_do_domctl(struct xen_domctl *domctl,
-                    XEN_GUEST_HANDLE(xen_domctl_t) u_domctl)
+                    XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
     return -ENOSYS;
 }
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/arm/hvm.c
--- a/xen/arch/arm/hvm.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/arm/hvm.c	Wed Oct 17 16:43:53 2012 +0100
@@ -11,7 +11,7 @@
 
 #include <asm/hypercall.h>
 
-long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE(void) arg)
+long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
 
 {
     long rc = 0;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/arm/mm.c	Wed Oct 17 16:43:53 2012 +0100
@@ -579,7 +579,7 @@ out:
 
 }
 
-long arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg)
+long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     int rc;
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/arm/physdev.c
--- a/xen/arch/arm/physdev.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/arm/physdev.c	Wed Oct 17 16:43:53 2012 +0100
@@ -11,7 +11,7 @@
 #include <asm/hypercall.h>
 
 
-int do_physdev_op(int cmd, XEN_GUEST_HANDLE(void) arg)
+int do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     printk("%s %d cmd=%d: not implemented yet\n", __func__, __LINE__, cmd);
     return -ENOSYS;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/arm/sysctl.c
--- a/xen/arch/arm/sysctl.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/arm/sysctl.c	Wed Oct 17 16:43:53 2012 +0100
@@ -13,7 +13,7 @@
 #include <public/sysctl.h>
 
 long arch_do_sysctl(struct xen_sysctl *sysctl,
-                    XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl)
+                    XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 {
     return -ENOSYS;
 }
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/compat.c
--- a/xen/arch/x86/compat.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/compat.c	Wed Oct 17 16:43:53 2012 +0100
@@ -27,7 +27,7 @@ ret_t do_physdev_op_compat(XEN_GUEST_HAN
 #ifndef COMPAT
 
 /* Legacy hypercall (as of 0x00030202). */
-long do_event_channel_op_compat(XEN_GUEST_HANDLE(evtchn_op_t) uop)
+long do_event_channel_op_compat(XEN_GUEST_HANDLE_PARAM(evtchn_op_t) uop)
 {
     struct evtchn_op op;
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/cpu/mcheck/mce.c
--- a/xen/arch/x86/cpu/mcheck/mce.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce.c	Wed Oct 17 16:43:53 2012 +0100
@@ -1289,7 +1289,7 @@ CHECK_mcinfo_recovery;
 # undef xen_mcinfo_recovery
 
 /* Machine Check Architecture Hypercall */
-long do_mca(XEN_GUEST_HANDLE(xen_mc_t) u_xen_mc)
+long do_mca(XEN_GUEST_HANDLE_PARAM(xen_mc_t) u_xen_mc)
 {
     long ret = 0;
     struct xen_mc curop, *op = &curop;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/domain.c	Wed Oct 17 16:43:53 2012 +0100
@@ -1077,7 +1077,7 @@ map_vcpu_info(struct vcpu *v, unsigned l
 
 long
 arch_do_vcpu_op(
-    int cmd, struct vcpu *v, XEN_GUEST_HANDLE(void) arg)
+    int cmd, struct vcpu *v, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     long rc = 0;
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/domctl.c	Wed Oct 17 16:43:53 2012 +0100
@@ -48,7 +48,7 @@ static int gdbsx_guest_mem_io(
 
 long arch_do_domctl(
     struct xen_domctl *domctl,
-    XEN_GUEST_HANDLE(xen_domctl_t) u_domctl)
+    XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
     long ret = 0;
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/efi/runtime.c
--- a/xen/arch/x86/efi/runtime.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/efi/runtime.c	Wed Oct 17 16:43:53 2012 +0100
@@ -184,7 +184,7 @@ int efi_get_info(uint32_t idx, union xen
     return 0;
 }
 
-static long gwstrlen(XEN_GUEST_HANDLE(CHAR16) str)
+static long gwstrlen(XEN_GUEST_HANDLE_PARAM(CHAR16) str)
 {
     unsigned long len;
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/hvm/hvm.c	Wed Oct 17 16:43:53 2012 +0100
@@ -3091,14 +3091,14 @@ static int grant_table_op_is_allowed(uns
 }
 
 static long hvm_grant_table_op(
-    unsigned int cmd, XEN_GUEST_HANDLE(void) uop, unsigned int count)
+    unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) uop, unsigned int count)
 {
     if ( !grant_table_op_is_allowed(cmd) )
         return -ENOSYS; /* all other commands need auditing */
     return do_grant_table_op(cmd, uop, count);
 }
 
-static long hvm_memory_op(int cmd, XEN_GUEST_HANDLE(void) arg)
+static long hvm_memory_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     long rc;
 
@@ -3116,7 +3116,7 @@ static long hvm_memory_op(int cmd, XEN_G
     return do_memory_op(cmd, arg);
 }
 
-static long hvm_physdev_op(int cmd, XEN_GUEST_HANDLE(void) arg)
+static long hvm_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     switch ( cmd )
     {
@@ -3132,7 +3132,7 @@ static long hvm_physdev_op(int cmd, XEN_
 }
 
 static long hvm_vcpu_op(
-    int cmd, int vcpuid, XEN_GUEST_HANDLE(void) arg)
+    int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     long rc;
 
@@ -3163,7 +3163,7 @@ typedef unsigned long hvm_hypercall_t(
     [ __HYPERVISOR_ ## x ] = (hvm_hypercall_t *) do_ ## x
 
 static long hvm_grant_table_op_compat32(unsigned int cmd,
-                                        XEN_GUEST_HANDLE(void) uop,
+                                        XEN_GUEST_HANDLE_PARAM(void) uop,
                                         unsigned int count)
 {
     if ( !grant_table_op_is_allowed(cmd) )
@@ -3171,7 +3171,7 @@ static long hvm_grant_table_op_compat32(
     return compat_grant_table_op(cmd, uop, count);
 }
 
-static long hvm_memory_op_compat32(int cmd, XEN_GUEST_HANDLE(void) arg)
+static long hvm_memory_op_compat32(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     int rc;
 
@@ -3190,7 +3190,7 @@ static long hvm_memory_op_compat32(int c
 }
 
 static long hvm_vcpu_op_compat32(
-    int cmd, int vcpuid, XEN_GUEST_HANDLE(void) arg)
+    int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     long rc;
 
@@ -3214,7 +3214,7 @@ static long hvm_vcpu_op_compat32(
 }
 
 static long hvm_physdev_op_compat32(
-    int cmd, XEN_GUEST_HANDLE(void) arg)
+    int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     switch ( cmd )
     {
@@ -3380,7 +3380,7 @@ void hvm_hypercall_page_initialise(struc
 }
 
 static int hvmop_set_pci_intx_level(
-    XEN_GUEST_HANDLE(xen_hvm_set_pci_intx_level_t) uop)
+    XEN_GUEST_HANDLE_PARAM(xen_hvm_set_pci_intx_level_t) uop)
 {
     struct xen_hvm_set_pci_intx_level op;
     struct domain *d;
@@ -3547,7 +3547,7 @@ static void hvm_s3_resume(struct domain 
 }
 
 static int hvmop_set_isa_irq_level(
-    XEN_GUEST_HANDLE(xen_hvm_set_isa_irq_level_t) uop)
+    XEN_GUEST_HANDLE_PARAM(xen_hvm_set_isa_irq_level_t) uop)
 {
     struct xen_hvm_set_isa_irq_level op;
     struct domain *d;
@@ -3591,7 +3591,7 @@ static int hvmop_set_isa_irq_level(
 }
 
 static int hvmop_set_pci_link_route(
-    XEN_GUEST_HANDLE(xen_hvm_set_pci_link_route_t) uop)
+    XEN_GUEST_HANDLE_PARAM(xen_hvm_set_pci_link_route_t) uop)
 {
     struct xen_hvm_set_pci_link_route op;
     struct domain *d;
@@ -3624,7 +3624,7 @@ static int hvmop_set_pci_link_route(
 }
 
 static int hvmop_inject_msi(
-    XEN_GUEST_HANDLE(xen_hvm_inject_msi_t) uop)
+    XEN_GUEST_HANDLE_PARAM(xen_hvm_inject_msi_t) uop)
 {
     struct xen_hvm_inject_msi op;
     struct domain *d;
@@ -3708,7 +3708,7 @@ static int hvm_replace_event_channel(str
     return 0;
 }
 
-long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE(void) arg)
+long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
 
 {
     struct domain *curr_d = current->domain;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/microcode.c
--- a/xen/arch/x86/microcode.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/microcode.c	Wed Oct 17 16:43:53 2012 +0100
@@ -195,7 +195,7 @@ static long do_microcode_update(void *_i
     return error;
 }
 
-int microcode_update(XEN_GUEST_HANDLE(const_void) buf, unsigned long len)
+int microcode_update(XEN_GUEST_HANDLE_PARAM(const_void) buf, unsigned long len)
 {
     int ret;
     struct microcode_info *info;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/mm.c	Wed Oct 17 16:43:53 2012 +0100
@@ -2652,7 +2652,7 @@ static void put_pg_owner(struct domain *
 }
 
 static inline int vcpumask_to_pcpumask(
-    struct domain *d, XEN_GUEST_HANDLE(const_void) bmap, cpumask_t *pmask)
+    struct domain *d, XEN_GUEST_HANDLE_PARAM(const_void) bmap, cpumask_t *pmask)
 {
     unsigned int vcpu_id, vcpu_bias, offs;
     unsigned long vmask;
@@ -2692,9 +2692,9 @@ static inline int vcpumask_to_pcpumask(
 #define fixunmap_domain_page(ptr) ((void)(ptr))
 
 long do_mmuext_op(
-    XEN_GUEST_HANDLE(mmuext_op_t) uops,
+    XEN_GUEST_HANDLE_PARAM(mmuext_op_t) uops,
     unsigned int count,
-    XEN_GUEST_HANDLE(uint) pdone,
+    XEN_GUEST_HANDLE_PARAM(uint) pdone,
     unsigned int foreigndom)
 {
     struct mmuext_op op;
@@ -3151,9 +3151,9 @@ long do_mmuext_op(
 }
 
 long do_mmu_update(
-    XEN_GUEST_HANDLE(mmu_update_t) ureqs,
+    XEN_GUEST_HANDLE_PARAM(mmu_update_t) ureqs,
     unsigned int count,
-    XEN_GUEST_HANDLE(uint) pdone,
+    XEN_GUEST_HANDLE_PARAM(uint) pdone,
     unsigned int foreigndom)
 {
     struct mmu_update req;
@@ -4098,7 +4098,7 @@ long set_gdt(struct vcpu *v,
 }
 
 
-long do_set_gdt(XEN_GUEST_HANDLE(ulong) frame_list, unsigned int entries)
+long do_set_gdt(XEN_GUEST_HANDLE_PARAM(ulong) frame_list, unsigned int entries)
 {
     int nr_pages = (entries + 511) / 512;
     unsigned long frames[16];
@@ -4370,7 +4370,7 @@ static int xenmem_add_to_physmap(struct 
     return xenmem_add_to_physmap_once(d, xatp);
 }
 
-long arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg)
+long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     int rc;
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/mm/hap/hap.c	Wed Oct 17 16:43:53 2012 +0100
@@ -571,7 +571,7 @@ void hap_teardown(struct domain *d)
 }
 
 int hap_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
-               XEN_GUEST_HANDLE(void) u_domctl)
+               XEN_GUEST_HANDLE_PARAM(void) u_domctl)
 {
     int rc, preempted = 0;
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/mm/mem_event.c
--- a/xen/arch/x86/mm/mem_event.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/mm/mem_event.c	Wed Oct 17 16:43:53 2012 +0100
@@ -512,7 +512,7 @@ void mem_event_cleanup(struct domain *d)
 }
 
 int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec,
-                     XEN_GUEST_HANDLE(void) u_domctl)
+                     XEN_GUEST_HANDLE_PARAM(void) u_domctl)
 {
     int rc;
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/mm/paging.c
--- a/xen/arch/x86/mm/paging.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/mm/paging.c	Wed Oct 17 16:43:53 2012 +0100
@@ -654,7 +654,7 @@ void paging_vcpu_init(struct vcpu *v)
 
 
 int paging_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
-                  XEN_GUEST_HANDLE(void) u_domctl)
+                  XEN_GUEST_HANDLE_PARAM(void) u_domctl)
 {
     int rc;
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/mm/shadow/common.c
--- a/xen/arch/x86/mm/shadow/common.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/mm/shadow/common.c	Wed Oct 17 16:43:53 2012 +0100
@@ -3641,7 +3641,7 @@ out:
 
 int shadow_domctl(struct domain *d, 
                   xen_domctl_shadow_op_t *sc,
-                  XEN_GUEST_HANDLE(void) u_domctl)
+                  XEN_GUEST_HANDLE_PARAM(void) u_domctl)
 {
     int rc, preempted = 0;
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/oprofile/xenoprof.c
--- a/xen/arch/x86/oprofile/xenoprof.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/oprofile/xenoprof.c	Wed Oct 17 16:43:53 2012 +0100
@@ -17,7 +17,7 @@
 
 #include "op_counter.h"
 
-int xenoprof_arch_counter(XEN_GUEST_HANDLE(void) arg)
+int xenoprof_arch_counter(XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     struct xenoprof_counter counter;
 
@@ -37,7 +37,7 @@ int xenoprof_arch_counter(XEN_GUEST_HAND
     return 0;
 }
 
-int xenoprof_arch_ibs_counter(XEN_GUEST_HANDLE(void) arg)
+int xenoprof_arch_ibs_counter(XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     struct xenoprof_ibs_counter ibs_counter;
 
@@ -54,7 +54,7 @@ int xenoprof_arch_ibs_counter(XEN_GUEST_
     return 0;
 }
 
-int compat_oprof_arch_counter(XEN_GUEST_HANDLE(void) arg)
+int compat_oprof_arch_counter(XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     struct compat_oprof_counter counter;
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/physdev.c	Wed Oct 17 16:43:53 2012 +0100
@@ -258,7 +258,7 @@ int physdev_unmap_pirq(domid_t domid, in
 }
 #endif /* COMPAT */
 
-ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE(void) arg)
+ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     int irq;
     ret_t ret;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/sysctl.c
--- a/xen/arch/x86/sysctl.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/sysctl.c	Wed Oct 17 16:43:53 2012 +0100
@@ -58,7 +58,7 @@ long cpu_down_helper(void *data)
 }
 
 long arch_do_sysctl(
-    struct xen_sysctl *sysctl, XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl)
+    struct xen_sysctl *sysctl, XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 {
     long ret = 0;
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/traps.c	Wed Oct 17 16:43:53 2012 +0100
@@ -3536,7 +3536,7 @@ int send_guest_trap(struct domain *d, ui
 }
 
 
-long do_set_trap_table(XEN_GUEST_HANDLE(const_trap_info_t) traps)
+long do_set_trap_table(XEN_GUEST_HANDLE_PARAM(const_trap_info_t) traps)
 {
     struct trap_info cur;
     struct vcpu *curr = current;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/x86_64/compat/mm.c
--- a/xen/arch/x86/x86_64/compat/mm.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/x86_64/compat/mm.c	Wed Oct 17 16:43:53 2012 +0100
@@ -5,7 +5,7 @@
 #include <asm/mem_event.h>
 #include <asm/mem_sharing.h>
 
-int compat_set_gdt(XEN_GUEST_HANDLE(uint) frame_list, unsigned int entries)
+int compat_set_gdt(XEN_GUEST_HANDLE_PARAM(uint) frame_list, unsigned int entries)
 {
     unsigned int i, nr_pages = (entries + 511) / 512;
     unsigned long frames[16];
@@ -44,7 +44,7 @@ int compat_update_descriptor(u32 pa_lo, 
                                 desc_lo | ((u64)desc_hi << 32));
 }
 
-int compat_arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg)
+int compat_arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     struct compat_machphys_mfn_list xmml;
     l2_pgentry_t l2e;
@@ -260,14 +260,14 @@ int compat_update_va_mapping_otherdomain
 
 DEFINE_XEN_GUEST_HANDLE(mmuext_op_compat_t);
 
-int compat_mmuext_op(XEN_GUEST_HANDLE(mmuext_op_compat_t) cmp_uops,
+int compat_mmuext_op(XEN_GUEST_HANDLE_PARAM(mmuext_op_compat_t) cmp_uops,
                      unsigned int count,
-                     XEN_GUEST_HANDLE(uint) pdone,
+                     XEN_GUEST_HANDLE_PARAM(uint) pdone,
                      unsigned int foreigndom)
 {
     unsigned int i, preempt_mask;
     int rc = 0;
-    XEN_GUEST_HANDLE(mmuext_op_t) nat_ops;
+    XEN_GUEST_HANDLE_PARAM(mmuext_op_t) nat_ops;
 
     preempt_mask = count & MMU_UPDATE_PREEMPTED;
     count ^= preempt_mask;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/x86_64/domain.c
--- a/xen/arch/x86/x86_64/domain.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/x86_64/domain.c	Wed Oct 17 16:43:53 2012 +0100
@@ -23,7 +23,7 @@ CHECK_vcpu_get_physid;
 
 int
 arch_compat_vcpu_op(
-    int cmd, struct vcpu *v, XEN_GUEST_HANDLE(void) arg)
+    int cmd, struct vcpu *v, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     int rc = -ENOSYS;
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/x86_64/mm.c
--- a/xen/arch/x86/x86_64/mm.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/x86_64/mm.c	Wed Oct 17 16:43:53 2012 +0100
@@ -1027,7 +1027,7 @@ void __init subarch_init_memory(void)
     }
 }
 
-long subarch_memory_op(int op, XEN_GUEST_HANDLE(void) arg)
+long subarch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     struct xen_machphys_mfn_list xmml;
     l3_pgentry_t l3e;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/x86_64/traps.c
--- a/xen/arch/x86/x86_64/traps.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/x86_64/traps.c	Wed Oct 17 16:43:53 2012 +0100
@@ -519,7 +519,7 @@ static long unregister_guest_callback(st
 }
 
 
-long do_callback_op(int cmd, XEN_GUEST_HANDLE(const_void) arg)
+long do_callback_op(int cmd, XEN_GUEST_HANDLE_PARAM(const_void) arg)
 {
     long ret;
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/common/compat/domain.c
--- a/xen/common/compat/domain.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/common/compat/domain.c	Wed Oct 17 16:43:53 2012 +0100
@@ -15,7 +15,7 @@
 CHECK_vcpu_set_periodic_timer;
 #undef xen_vcpu_set_periodic_timer
 
-int compat_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE(void) arg)
+int compat_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     struct domain *d = current->domain;
     struct vcpu *v;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/common/compat/grant_table.c
--- a/xen/common/compat/grant_table.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/common/compat/grant_table.c	Wed Oct 17 16:43:53 2012 +0100
@@ -52,12 +52,12 @@ CHECK_gnttab_swap_grant_ref;
 #undef xen_gnttab_swap_grant_ref
 
 int compat_grant_table_op(unsigned int cmd,
-                          XEN_GUEST_HANDLE(void) cmp_uop,
+                          XEN_GUEST_HANDLE_PARAM(void) cmp_uop,
                           unsigned int count)
 {
     int rc = 0;
     unsigned int i;
-    XEN_GUEST_HANDLE(void) cnt_uop;
+    XEN_GUEST_HANDLE_PARAM(void) cnt_uop;
 
     set_xen_guest_handle(cnt_uop, NULL);
     switch ( cmd )
@@ -206,7 +206,7 @@ int compat_grant_table_op(unsigned int c
             }
             if ( rc >= 0 )
             {
-                XEN_GUEST_HANDLE(gnttab_transfer_compat_t) xfer;
+                XEN_GUEST_HANDLE_PARAM(gnttab_transfer_compat_t) xfer;
 
                 xfer = guest_handle_cast(cmp_uop, gnttab_transfer_compat_t);
                 guest_handle_add_offset(xfer, i);
@@ -251,7 +251,7 @@ int compat_grant_table_op(unsigned int c
             }
             if ( rc >= 0 )
             {
-                XEN_GUEST_HANDLE(gnttab_copy_compat_t) copy;
+                XEN_GUEST_HANDLE_PARAM(gnttab_copy_compat_t) copy;
 
                 copy = guest_handle_cast(cmp_uop, gnttab_copy_compat_t);
                 guest_handle_add_offset(copy, i);
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/common/compat/memory.c
--- a/xen/common/compat/memory.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/common/compat/memory.c	Wed Oct 17 16:43:53 2012 +0100
@@ -13,7 +13,7 @@ CHECK_TYPE(domid);
 #undef compat_domid_t
 #undef xen_domid_t
 
-int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE(void) compat)
+int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
 {
     int rc, split, op = cmd & MEMOP_CMD_MASK;
     unsigned int start_extent = cmd >> MEMOP_EXTENT_SHIFT;
@@ -22,7 +22,7 @@ int compat_memory_op(unsigned int cmd, X
     {
         unsigned int i, end_extent = 0;
         union {
-            XEN_GUEST_HANDLE(void) hnd;
+            XEN_GUEST_HANDLE_PARAM(void) hnd;
             struct xen_memory_reservation *rsrv;
             struct xen_memory_exchange *xchg;
             struct xen_remove_from_physmap *xrfp;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/common/domain.c
--- a/xen/common/domain.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/common/domain.c	Wed Oct 17 16:43:53 2012 +0100
@@ -827,7 +827,7 @@ void vcpu_reset(struct vcpu *v)
 }
 
 
-long do_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE(void) arg)
+long do_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     struct domain *d = current->domain;
     struct vcpu *v;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/common/domctl.c
--- a/xen/common/domctl.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/common/domctl.c	Wed Oct 17 16:43:53 2012 +0100
@@ -239,7 +239,7 @@ void domctl_lock_release(void)
     spin_unlock(&current->domain->hypercall_deadlock_mutex);
 }
 
-long do_domctl(XEN_GUEST_HANDLE(xen_domctl_t) u_domctl)
+long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
     long ret = 0;
     struct xen_domctl curop, *op = &curop;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/common/event_channel.c
--- a/xen/common/event_channel.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/common/event_channel.c	Wed Oct 17 16:43:53 2012 +0100
@@ -970,7 +970,7 @@ out:
 }
 
 
-long do_event_channel_op(int cmd, XEN_GUEST_HANDLE(void) arg)
+long do_event_channel_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     long rc;
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/common/grant_table.c
--- a/xen/common/grant_table.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/common/grant_table.c	Wed Oct 17 16:43:53 2012 +0100
@@ -833,7 +833,7 @@ __gnttab_map_grant_ref(
 
 static long
 gnttab_map_grant_ref(
-    XEN_GUEST_HANDLE(gnttab_map_grant_ref_t) uop, unsigned int count)
+    XEN_GUEST_HANDLE_PARAM(gnttab_map_grant_ref_t) uop, unsigned int count)
 {
     int i;
     struct gnttab_map_grant_ref op;
@@ -1102,7 +1102,7 @@ __gnttab_unmap_grant_ref(
 
 static long
 gnttab_unmap_grant_ref(
-    XEN_GUEST_HANDLE(gnttab_unmap_grant_ref_t) uop, unsigned int count)
+    XEN_GUEST_HANDLE_PARAM(gnttab_unmap_grant_ref_t) uop, unsigned int count)
 {
     int i, c, partial_done, done = 0;
     struct gnttab_unmap_grant_ref op;
@@ -1164,7 +1164,7 @@ __gnttab_unmap_and_replace(
 
 static long
 gnttab_unmap_and_replace(
-    XEN_GUEST_HANDLE(gnttab_unmap_and_replace_t) uop, unsigned int count)
+    XEN_GUEST_HANDLE_PARAM(gnttab_unmap_and_replace_t) uop, unsigned int count)
 {
     int i, c, partial_done, done = 0;
     struct gnttab_unmap_and_replace op;
@@ -1316,7 +1316,7 @@ active_alloc_failed:
 
 static long 
 gnttab_setup_table(
-    XEN_GUEST_HANDLE(gnttab_setup_table_t) uop, unsigned int count)
+    XEN_GUEST_HANDLE_PARAM(gnttab_setup_table_t) uop, unsigned int count)
 {
     struct gnttab_setup_table op;
     struct domain *d;
@@ -1395,7 +1395,7 @@ gnttab_setup_table(
 
 static long 
 gnttab_query_size(
-    XEN_GUEST_HANDLE(gnttab_query_size_t) uop, unsigned int count)
+    XEN_GUEST_HANDLE_PARAM(gnttab_query_size_t) uop, unsigned int count)
 {
     struct gnttab_query_size op;
     struct domain *d;
@@ -1517,7 +1517,7 @@ gnttab_prepare_for_transfer(
 
 static long
 gnttab_transfer(
-    XEN_GUEST_HANDLE(gnttab_transfer_t) uop, unsigned int count)
+    XEN_GUEST_HANDLE_PARAM(gnttab_transfer_t) uop, unsigned int count)
 {
     struct domain *d = current->domain;
     struct domain *e;
@@ -2125,7 +2125,7 @@ __gnttab_copy(
 
 static long
 gnttab_copy(
-    XEN_GUEST_HANDLE(gnttab_copy_t) uop, unsigned int count)
+    XEN_GUEST_HANDLE_PARAM(gnttab_copy_t) uop, unsigned int count)
 {
     int i;
     struct gnttab_copy op;
@@ -2144,7 +2144,7 @@ gnttab_copy(
 }
 
 static long
-gnttab_set_version(XEN_GUEST_HANDLE(gnttab_set_version_t uop))
+gnttab_set_version(XEN_GUEST_HANDLE_PARAM(gnttab_set_version_t uop))
 {
     gnttab_set_version_t op;
     struct domain *d = current->domain;
@@ -2263,7 +2263,7 @@ out:
 }
 
 static long
-gnttab_get_status_frames(XEN_GUEST_HANDLE(gnttab_get_status_frames_t) uop,
+gnttab_get_status_frames(XEN_GUEST_HANDLE_PARAM(gnttab_get_status_frames_t) uop,
                          int count)
 {
     gnttab_get_status_frames_t op;
@@ -2327,7 +2327,7 @@ out1:
 }
 
 static long
-gnttab_get_version(XEN_GUEST_HANDLE(gnttab_get_version_t uop))
+gnttab_get_version(XEN_GUEST_HANDLE_PARAM(gnttab_get_version_t uop))
 {
     gnttab_get_version_t op;
     struct domain *d;
@@ -2412,7 +2412,7 @@ out:
 }
 
 static long
-gnttab_swap_grant_ref(XEN_GUEST_HANDLE(gnttab_swap_grant_ref_t uop),
+gnttab_swap_grant_ref(XEN_GUEST_HANDLE_PARAM(gnttab_swap_grant_ref_t uop),
                       unsigned int count)
 {
     int i;
@@ -2433,7 +2433,7 @@ gnttab_swap_grant_ref(XEN_GUEST_HANDLE(g
 
 long
 do_grant_table_op(
-    unsigned int cmd, XEN_GUEST_HANDLE(void) uop, unsigned int count)
+    unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) uop, unsigned int count)
 {
     long rc;
     
@@ -2445,7 +2445,7 @@ do_grant_table_op(
     {
     case GNTTABOP_map_grant_ref:
     {
-        XEN_GUEST_HANDLE(gnttab_map_grant_ref_t) map =
+        XEN_GUEST_HANDLE_PARAM(gnttab_map_grant_ref_t) map =
             guest_handle_cast(uop, gnttab_map_grant_ref_t);
         if ( unlikely(!guest_handle_okay(map, count)) )
             goto out;
@@ -2459,7 +2459,7 @@ do_grant_table_op(
     }
     case GNTTABOP_unmap_grant_ref:
     {
-        XEN_GUEST_HANDLE(gnttab_unmap_grant_ref_t) unmap =
+        XEN_GUEST_HANDLE_PARAM(gnttab_unmap_grant_ref_t) unmap =
             guest_handle_cast(uop, gnttab_unmap_grant_ref_t);
         if ( unlikely(!guest_handle_okay(unmap, count)) )
             goto out;
@@ -2473,7 +2473,7 @@ do_grant_table_op(
     }
     case GNTTABOP_unmap_and_replace:
     {
-        XEN_GUEST_HANDLE(gnttab_unmap_and_replace_t) unmap =
+        XEN_GUEST_HANDLE_PARAM(gnttab_unmap_and_replace_t) unmap =
             guest_handle_cast(uop, gnttab_unmap_and_replace_t);
         if ( unlikely(!guest_handle_okay(unmap, count)) )
             goto out;
@@ -2497,7 +2497,7 @@ do_grant_table_op(
     }
     case GNTTABOP_transfer:
     {
-        XEN_GUEST_HANDLE(gnttab_transfer_t) transfer =
+        XEN_GUEST_HANDLE_PARAM(gnttab_transfer_t) transfer =
             guest_handle_cast(uop, gnttab_transfer_t);
         if ( unlikely(!guest_handle_okay(transfer, count)) )
             goto out;
@@ -2511,7 +2511,7 @@ do_grant_table_op(
     }
     case GNTTABOP_copy:
     {
-        XEN_GUEST_HANDLE(gnttab_copy_t) copy =
+        XEN_GUEST_HANDLE_PARAM(gnttab_copy_t) copy =
             guest_handle_cast(uop, gnttab_copy_t);
         if ( unlikely(!guest_handle_okay(copy, count)) )
             goto out;
@@ -2548,7 +2548,7 @@ do_grant_table_op(
     }
     case GNTTABOP_swap_grant_ref:
     {
-        XEN_GUEST_HANDLE(gnttab_swap_grant_ref_t) swap =
+        XEN_GUEST_HANDLE_PARAM(gnttab_swap_grant_ref_t) swap =
             guest_handle_cast(uop, gnttab_swap_grant_ref_t);
         if ( unlikely(!guest_handle_okay(swap, count)) )
             goto out;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/common/kernel.c
--- a/xen/common/kernel.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/common/kernel.c	Wed Oct 17 16:43:53 2012 +0100
@@ -204,7 +204,7 @@ void __init do_initcalls(void)
  * Simple hypercalls.
  */
 
-DO(xen_version)(int cmd, XEN_GUEST_HANDLE(void) arg)
+DO(xen_version)(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     switch ( cmd )
     {
@@ -332,7 +332,7 @@ DO(xen_version)(int cmd, XEN_GUEST_HANDL
     return -ENOSYS;
 }
 
-DO(nmi_op)(unsigned int cmd, XEN_GUEST_HANDLE(void) arg)
+DO(nmi_op)(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     struct xennmi_callback cb;
     long rc = 0;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/common/kexec.c
--- a/xen/common/kexec.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/common/kexec.c	Wed Oct 17 16:43:53 2012 +0100
@@ -613,7 +613,7 @@ static int kexec_get_range_internal(xen_
     return ret;
 }
 
-static int kexec_get_range(XEN_GUEST_HANDLE(void) uarg)
+static int kexec_get_range(XEN_GUEST_HANDLE_PARAM(void) uarg)
 {
     xen_kexec_range_t range;
     int ret = -EINVAL;
@@ -629,7 +629,7 @@ static int kexec_get_range(XEN_GUEST_HAN
     return ret;
 }
 
-static int kexec_get_range_compat(XEN_GUEST_HANDLE(void) uarg)
+static int kexec_get_range_compat(XEN_GUEST_HANDLE_PARAM(void) uarg)
 {
 #ifdef CONFIG_COMPAT
     xen_kexec_range_t range;
@@ -777,7 +777,7 @@ static int kexec_load_unload_internal(un
     return ret;
 }
 
-static int kexec_load_unload(unsigned long op, XEN_GUEST_HANDLE(void) uarg)
+static int kexec_load_unload(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) uarg)
 {
     xen_kexec_load_t load;
 
@@ -788,7 +788,7 @@ static int kexec_load_unload(unsigned lo
 }
 
 static int kexec_load_unload_compat(unsigned long op,
-                                    XEN_GUEST_HANDLE(void) uarg)
+                                    XEN_GUEST_HANDLE_PARAM(void) uarg)
 {
 #ifdef CONFIG_COMPAT
     compat_kexec_load_t compat_load;
@@ -813,7 +813,7 @@ static int kexec_load_unload_compat(unsi
 #endif /* CONFIG_COMPAT */
 }
 
-static int kexec_exec(XEN_GUEST_HANDLE(void) uarg)
+static int kexec_exec(XEN_GUEST_HANDLE_PARAM(void) uarg)
 {
     xen_kexec_exec_t exec;
     xen_kexec_image_t *image;
@@ -845,7 +845,8 @@ static int kexec_exec(XEN_GUEST_HANDLE(v
     return -EINVAL; /* never reached */
 }
 
-static int do_kexec_op_internal(unsigned long op, XEN_GUEST_HANDLE(void) uarg,
+static int do_kexec_op_internal(unsigned long op,
+                                XEN_GUEST_HANDLE_PARAM(void) uarg,
                                 bool_t compat)
 {
     unsigned long flags;
@@ -886,13 +887,13 @@ static int do_kexec_op_internal(unsigned
     return ret;
 }
 
-long do_kexec_op(unsigned long op, XEN_GUEST_HANDLE(void) uarg)
+long do_kexec_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) uarg)
 {
     return do_kexec_op_internal(op, uarg, 0);
 }
 
 #ifdef CONFIG_COMPAT
-int compat_kexec_op(unsigned long op, XEN_GUEST_HANDLE(void) uarg)
+int compat_kexec_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) uarg)
 {
     return do_kexec_op_internal(op, uarg, 1);
 }
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/common/memory.c
--- a/xen/common/memory.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/common/memory.c	Wed Oct 17 16:43:53 2012 +0100
@@ -277,7 +277,7 @@ static void decrease_reservation(struct 
     a->nr_done = i;
 }
 
-static long memory_exchange(XEN_GUEST_HANDLE(xen_memory_exchange_t) arg)
+static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_memory_exchange_t) arg)
 {
     struct xen_memory_exchange exch;
     PAGE_LIST_HEAD(in_chunk_list);
@@ -517,7 +517,7 @@ static long memory_exchange(XEN_GUEST_HA
     return rc;
 }
 
-long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE(void) arg)
+long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     struct domain *d;
     int rc, op;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/common/schedule.c
--- a/xen/common/schedule.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/common/schedule.c	Wed Oct 17 16:43:53 2012 +0100
@@ -836,7 +836,7 @@ typedef long ret_t;
 
 #endif /* !COMPAT */
 
-ret_t do_sched_op(int cmd, XEN_GUEST_HANDLE(void) arg)
+ret_t do_sched_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     ret_t ret = 0;
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/common/sysctl.c
--- a/xen/common/sysctl.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/common/sysctl.c	Wed Oct 17 16:43:53 2012 +0100
@@ -27,7 +27,7 @@
 #include <xsm/xsm.h>
 #include <xen/pmstat.h>
 
-long do_sysctl(XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl)
+long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 {
     long ret = 0;
     struct xen_sysctl curop, *op = &curop;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/common/tmem.c
--- a/xen/common/tmem.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/common/tmem.c	Wed Oct 17 16:43:53 2012 +0100
@@ -1444,7 +1444,7 @@ static inline void tmem_ensure_avail_pag
 /************ TMEM CORE OPERATIONS ************************************/
 
 static NOINLINE int do_tmem_put_compress(pgp_t *pgp, tmem_cli_mfn_t cmfn,
-                                         tmem_cli_va_t clibuf)
+                                         tmem_cli_va_param_t clibuf)
 {
     void *dst, *p;
     size_t size;
@@ -1488,7 +1488,7 @@ out:
 
 static NOINLINE int do_tmem_dup_put(pgp_t *pgp, tmem_cli_mfn_t cmfn,
        pagesize_t tmem_offset, pagesize_t pfn_offset, pagesize_t len,
-       tmem_cli_va_t clibuf)
+       tmem_cli_va_param_t clibuf)
 {
     pool_t *pool;
     obj_t *obj;
@@ -1579,7 +1579,7 @@ cleanup:
 static NOINLINE int do_tmem_put(pool_t *pool,
               OID *oidp, uint32_t index,
               tmem_cli_mfn_t cmfn, pagesize_t tmem_offset,
-              pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t clibuf)
+              pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_param_t clibuf)
 {
     obj_t *obj = NULL, *objfound = NULL, *objnew = NULL;
     pgp_t *pgp = NULL, *pgpdel = NULL;
@@ -1722,7 +1722,7 @@ free:
 
 static NOINLINE int do_tmem_get(pool_t *pool, OID *oidp, uint32_t index,
               tmem_cli_mfn_t cmfn, pagesize_t tmem_offset,
-              pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t clibuf)
+              pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_param_t clibuf)
 {
     obj_t *obj;
     pgp_t *pgp;
@@ -2066,8 +2066,8 @@ static int tmemc_flush_mem(cli_id_t cli_
  */
 #define BSIZE 1024
 
-static int tmemc_list_client(client_t *c, tmem_cli_va_t buf, int off, 
-                             uint32_t len, bool_t use_long)
+static int tmemc_list_client(client_t *c, tmem_cli_va_param_t buf,
+                             int off, uint32_t len, bool_t use_long)
 {
     char info[BSIZE];
     int i, n = 0, sum = 0;
@@ -2119,7 +2119,7 @@ static int tmemc_list_client(client_t *c
     return sum;
 }
 
-static int tmemc_list_shared(tmem_cli_va_t buf, int off, uint32_t len,
+static int tmemc_list_shared(tmem_cli_va_param_t buf, int off, uint32_t len,
                               bool_t use_long)
 {
     char info[BSIZE];
@@ -2159,8 +2159,8 @@ static int tmemc_list_shared(tmem_cli_va
 }
 
 #ifdef TMEM_PERF
-static int tmemc_list_global_perf(tmem_cli_va_t buf, int off, uint32_t len,
-                              bool_t use_long)
+static int tmemc_list_global_perf(tmem_cli_va_param_t buf, int off,
+                                  uint32_t len, bool_t use_long)
 {
     char info[BSIZE];
     int n = 0, sum = 0;
@@ -2194,7 +2194,7 @@ static int tmemc_list_global_perf(tmem_c
 #define tmemc_list_global_perf(_buf,_off,_len,_use) (0)
 #endif
 
-static int tmemc_list_global(tmem_cli_va_t buf, int off, uint32_t len,
+static int tmemc_list_global(tmem_cli_va_param_t buf, int off, uint32_t len,
                               bool_t use_long)
 {
     char info[BSIZE];
@@ -2226,7 +2226,7 @@ static int tmemc_list_global(tmem_cli_va
     return sum;
 }
 
-static int tmemc_list(cli_id_t cli_id, tmem_cli_va_t buf, uint32_t len,
+static int tmemc_list(cli_id_t cli_id, tmem_cli_va_param_t buf, uint32_t len,
                                bool_t use_long)
 {
     client_t *client;
@@ -2338,7 +2338,7 @@ static NOINLINE int tmemc_shared_pool_au
 }
 
 static NOINLINE int tmemc_save_subop(int cli_id, uint32_t pool_id,
-                        uint32_t subop, tmem_cli_va_t buf, uint32_t arg1)
+                        uint32_t subop, tmem_cli_va_param_t buf, uint32_t arg1)
 {
     client_t *client = tmh_client_from_cli_id(cli_id);
     pool_t *pool = (client == NULL || pool_id >= MAX_POOLS_PER_DOMAIN)
@@ -2427,7 +2427,7 @@ static NOINLINE int tmemc_save_subop(int
 }
 
 static NOINLINE int tmemc_save_get_next_page(int cli_id, uint32_t pool_id,
-                        tmem_cli_va_t buf, uint32_t bufsize)
+                        tmem_cli_va_param_t buf, uint32_t bufsize)
 {
     client_t *client = tmh_client_from_cli_id(cli_id);
     pool_t *pool = (client == NULL || pool_id >= MAX_POOLS_PER_DOMAIN)
@@ -2479,7 +2479,7 @@ out:
     return ret;
 }
 
-static NOINLINE int tmemc_save_get_next_inv(int cli_id, tmem_cli_va_t buf,
+static NOINLINE int tmemc_save_get_next_inv(int cli_id, tmem_cli_va_param_t buf,
                         uint32_t bufsize)
 {
     client_t *client = tmh_client_from_cli_id(cli_id);
@@ -2522,7 +2522,7 @@ out:
 }
 
 static int tmemc_restore_put_page(int cli_id, uint32_t pool_id, OID *oidp,
-                      uint32_t index, tmem_cli_va_t buf, uint32_t bufsize)
+                      uint32_t index, tmem_cli_va_param_t buf, uint32_t bufsize)
 {
     client_t *client = tmh_client_from_cli_id(cli_id);
     pool_t *pool = (client == NULL || pool_id >= MAX_POOLS_PER_DOMAIN)
@@ -2566,7 +2566,8 @@ static NOINLINE int do_tmem_control(stru
         ret = tmemc_flush_mem(op->u.ctrl.cli_id,op->u.ctrl.arg1);
         break;
     case TMEMC_LIST:
-        ret = tmemc_list(op->u.ctrl.cli_id,op->u.ctrl.buf,
+        ret = tmemc_list(op->u.ctrl.cli_id,
+                         guest_handle_cast(op->u.ctrl.buf, char),
                          op->u.ctrl.arg1,op->u.ctrl.arg2);
         break;
     case TMEMC_SET_WEIGHT:
@@ -2589,20 +2590,24 @@ static NOINLINE int do_tmem_control(stru
     case TMEMC_SAVE_GET_POOL_UUID:
     case TMEMC_SAVE_END:
         ret = tmemc_save_subop(op->u.ctrl.cli_id,pool_id,subop,
-                        op->u.ctrl.buf,op->u.ctrl.arg1);
+                               guest_handle_cast(op->u.ctrl.buf, char),
+                               op->u.ctrl.arg1);
         break;
     case TMEMC_SAVE_GET_NEXT_PAGE:
         ret = tmemc_save_get_next_page(op->u.ctrl.cli_id, pool_id,
-                                       op->u.ctrl.buf, op->u.ctrl.arg1);
+                                       guest_handle_cast(op->u.ctrl.buf, char),
+                                       op->u.ctrl.arg1);
         break;
     case TMEMC_SAVE_GET_NEXT_INV:
-        ret = tmemc_save_get_next_inv(op->u.ctrl.cli_id, op->u.ctrl.buf,
+        ret = tmemc_save_get_next_inv(op->u.ctrl.cli_id,
+                                      guest_handle_cast(op->u.ctrl.buf, char),
                                       op->u.ctrl.arg1);
         break;
     case TMEMC_RESTORE_PUT_PAGE:
         ret = tmemc_restore_put_page(op->u.ctrl.cli_id,pool_id,
                                      oidp, op->u.ctrl.arg2,
-                                     op->u.ctrl.buf, op->u.ctrl.arg1);
+                                     guest_handle_cast(op->u.ctrl.buf, char),
+                                     op->u.ctrl.arg1);
         break;
     case TMEMC_RESTORE_FLUSH_PAGE:
         ret = tmemc_restore_flush_page(op->u.ctrl.cli_id,pool_id,
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/common/tmem_xen.c
--- a/xen/common/tmem_xen.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/common/tmem_xen.c	Wed Oct 17 16:43:53 2012 +0100
@@ -146,7 +146,7 @@ static inline void cli_put_page(void *cl
 
 EXPORT int tmh_copy_from_client(pfp_t *pfp,
     tmem_cli_mfn_t cmfn, pagesize_t tmem_offset,
-    pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t clibuf)
+    pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_param_t clibuf)
 {
     unsigned long tmem_mfn, cli_mfn = 0;
     char *tmem_va, *cli_va = NULL;
@@ -194,7 +194,7 @@ EXPORT int tmh_copy_from_client(pfp_t *p
 }
 
 EXPORT int tmh_compress_from_client(tmem_cli_mfn_t cmfn,
-    void **out_va, size_t *out_len, tmem_cli_va_t clibuf)
+    void **out_va, size_t *out_len, tmem_cli_va_param_t clibuf)
 {
     int ret = 0;
     unsigned char *dmem = this_cpu(dstmem);
@@ -227,7 +227,7 @@ EXPORT int tmh_compress_from_client(tmem
 
 EXPORT int tmh_copy_to_client(tmem_cli_mfn_t cmfn, pfp_t *pfp,
     pagesize_t tmem_offset, pagesize_t pfn_offset, pagesize_t len,
-    tmem_cli_va_t clibuf)
+    tmem_cli_va_param_t clibuf)
 {
     unsigned long tmem_mfn, cli_mfn = 0;
     char *tmem_va, *cli_va = NULL;
@@ -265,7 +265,7 @@ EXPORT int tmh_copy_to_client(tmem_cli_m
 }
 
 EXPORT int tmh_decompress_to_client(tmem_cli_mfn_t cmfn, void *tmem_va,
-                                    size_t size, tmem_cli_va_t clibuf)
+                                    size_t size, tmem_cli_va_param_t clibuf)
 {
     unsigned long cli_mfn = 0;
     pfp_t *cli_pfp = NULL;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/common/xenoprof.c
--- a/xen/common/xenoprof.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/common/xenoprof.c	Wed Oct 17 16:43:53 2012 +0100
@@ -404,7 +404,7 @@ static int add_active_list(domid_t domid
     return 0;
 }
 
-static int add_passive_list(XEN_GUEST_HANDLE(void) arg)
+static int add_passive_list(XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     struct xenoprof_passive passive;
     struct domain *d;
@@ -585,7 +585,7 @@ void xenoprof_log_event(struct vcpu *vcp
 
 
 
-static int xenoprof_op_init(XEN_GUEST_HANDLE(void) arg)
+static int xenoprof_op_init(XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     struct domain *d = current->domain;
     struct xenoprof_init xenoprof_init;
@@ -611,7 +611,7 @@ static int xenoprof_op_init(XEN_GUEST_HA
 
 #endif /* !COMPAT */
 
-static int xenoprof_op_get_buffer(XEN_GUEST_HANDLE(void) arg)
+static int xenoprof_op_get_buffer(XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     struct xenoprof_get_buffer xenoprof_get_buffer;
     struct domain *d = current->domain;
@@ -662,7 +662,7 @@ static int xenoprof_op_get_buffer(XEN_GU
                       || (op == XENOPROF_disable_virq)  \
                       || (op == XENOPROF_get_buffer))
  
-ret_t do_xenoprof_op(int op, XEN_GUEST_HANDLE(void) arg)
+ret_t do_xenoprof_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     int ret = 0;
     
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/drivers/acpi/pmstat.c
--- a/xen/drivers/acpi/pmstat.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/drivers/acpi/pmstat.c	Wed Oct 17 16:43:53 2012 +0100
@@ -496,7 +496,7 @@ int do_pm_op(struct xen_sysctl_pm_op *op
     return ret;
 }
 
-int acpi_set_pdc_bits(u32 acpi_id, XEN_GUEST_HANDLE(uint32) pdc)
+int acpi_set_pdc_bits(u32 acpi_id, XEN_GUEST_HANDLE_PARAM(uint32) pdc)
 {
     u32 bits[3];
     int ret;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/drivers/char/console.c
--- a/xen/drivers/char/console.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/drivers/char/console.c	Wed Oct 17 16:43:53 2012 +0100
@@ -182,7 +182,7 @@ static void putchar_console_ring(int c)
 
 long read_console_ring(struct xen_sysctl_readconsole *op)
 {
-    XEN_GUEST_HANDLE(char) str;
+    XEN_GUEST_HANDLE_PARAM(char) str;
     uint32_t idx, len, max, sofar, c;
 
     str   = guest_handle_cast(op->buffer, char),
@@ -363,7 +363,7 @@ static void notify_dom0_con_ring(unsigne
 static DECLARE_SOFTIRQ_TASKLET(notify_dom0_con_ring_tasklet,
                                notify_dom0_con_ring, 0);
 
-static long guest_console_write(XEN_GUEST_HANDLE(char) buffer, int count)
+static long guest_console_write(XEN_GUEST_HANDLE_PARAM(char) buffer, int count)
 {
     char kbuf[128], *kptr;
     int kcount;
@@ -401,7 +401,7 @@ static long guest_console_write(XEN_GUES
     return 0;
 }
 
-long do_console_io(int cmd, int count, XEN_GUEST_HANDLE(char) buffer)
+long do_console_io(int cmd, int count, XEN_GUEST_HANDLE_PARAM(char) buffer)
 {
     long rc;
     unsigned int idx, len;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/drivers/passthrough/iommu.c	Wed Oct 17 16:43:53 2012 +0100
@@ -527,7 +527,7 @@ void iommu_crash_shutdown(void)
 
 int iommu_do_domctl(
     struct xen_domctl *domctl,
-    XEN_GUEST_HANDLE(xen_domctl_t) u_domctl)
+    XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
     struct domain *d;
     u16 seg;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/include/asm-arm/hypercall.h
--- a/xen/include/asm-arm/hypercall.h	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/include/asm-arm/hypercall.h	Wed Oct 17 16:43:53 2012 +0100
@@ -2,7 +2,7 @@
 #define __ASM_ARM_HYPERCALL_H__
 
 #include <public/domctl.h> /* for arch_do_domctl */
-int do_physdev_op(int cmd, XEN_GUEST_HANDLE(void) arg);
+int do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg);
 
 #endif /* __ASM_ARM_HYPERCALL_H__ */
 /*
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/include/asm-arm/mm.h
--- a/xen/include/asm-arm/mm.h	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/include/asm-arm/mm.h	Wed Oct 17 16:43:53 2012 +0100
@@ -267,7 +267,7 @@ static inline int relinquish_shared_page
 
 
 /* Arch-specific portion of memory_op hypercall. */
-long arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg);
+long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg);
 
 int steal_page(
     struct domain *d, struct page_info *page, unsigned int memflags);
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/include/asm-x86/hap.h
--- a/xen/include/asm-x86/hap.h	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/include/asm-x86/hap.h	Wed Oct 17 16:43:53 2012 +0100
@@ -51,7 +51,7 @@ hap_unmap_domain_page(void *p)
 /************************************************/
 void  hap_domain_init(struct domain *d);
 int   hap_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
-                 XEN_GUEST_HANDLE(void) u_domctl);
+                 XEN_GUEST_HANDLE_PARAM(void) u_domctl);
 int   hap_enable(struct domain *d, u32 mode);
 void  hap_final_teardown(struct domain *d);
 void  hap_teardown(struct domain *d);
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/include/asm-x86/hypercall.h
--- a/xen/include/asm-x86/hypercall.h	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/include/asm-x86/hypercall.h	Wed Oct 17 16:43:53 2012 +0100
@@ -18,22 +18,22 @@
 
 extern long
 do_event_channel_op_compat(
-    XEN_GUEST_HANDLE(evtchn_op_t) uop);
+    XEN_GUEST_HANDLE_PARAM(evtchn_op_t) uop);
 
 extern long
 do_set_trap_table(
-    XEN_GUEST_HANDLE(const_trap_info_t) traps);
+    XEN_GUEST_HANDLE_PARAM(const_trap_info_t) traps);
 
 extern long
 do_mmu_update(
-    XEN_GUEST_HANDLE(mmu_update_t) ureqs,
+    XEN_GUEST_HANDLE_PARAM(mmu_update_t) ureqs,
     unsigned int count,
-    XEN_GUEST_HANDLE(uint) pdone,
+    XEN_GUEST_HANDLE_PARAM(uint) pdone,
     unsigned int foreigndom);
 
 extern long
 do_set_gdt(
-    XEN_GUEST_HANDLE(ulong) frame_list,
+    XEN_GUEST_HANDLE_PARAM(ulong) frame_list,
     unsigned int entries);
 
 extern long
@@ -60,7 +60,7 @@ do_update_descriptor(
     u64 desc);
 
 extern long
-do_mca(XEN_GUEST_HANDLE(xen_mc_t) u_xen_mc);
+do_mca(XEN_GUEST_HANDLE_PARAM(xen_mc_t) u_xen_mc);
 
 extern long
 do_update_va_mapping(
@@ -70,7 +70,7 @@ do_update_va_mapping(
 
 extern long
 do_physdev_op(
-    int cmd, XEN_GUEST_HANDLE(void) arg);
+    int cmd, XEN_GUEST_HANDLE_PARAM(void) arg);
 
 extern long
 do_update_va_mapping_otherdomain(
@@ -81,9 +81,9 @@ do_update_va_mapping_otherdomain(
 
 extern long
 do_mmuext_op(
-    XEN_GUEST_HANDLE(mmuext_op_t) uops,
+    XEN_GUEST_HANDLE_PARAM(mmuext_op_t) uops,
     unsigned int count,
-    XEN_GUEST_HANDLE(uint) pdone,
+    XEN_GUEST_HANDLE_PARAM(uint) pdone,
     unsigned int foreigndom);
 
 extern unsigned long
@@ -104,10 +104,10 @@ do_set_segment_base(
 extern int
 compat_physdev_op(
     int cmd,
-    XEN_GUEST_HANDLE(void) arg);
+    XEN_GUEST_HANDLE_PARAM(void) arg);
 
 extern int
 arch_compat_vcpu_op(
-    int cmd, struct vcpu *v, XEN_GUEST_HANDLE(void) arg);
+    int cmd, struct vcpu *v, XEN_GUEST_HANDLE_PARAM(void) arg);
 
 #endif /* __ASM_X86_HYPERCALL_H__ */
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/include/asm-x86/mem_event.h
--- a/xen/include/asm-x86/mem_event.h	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/include/asm-x86/mem_event.h	Wed Oct 17 16:43:53 2012 +0100
@@ -65,7 +65,7 @@ int mem_event_get_response(struct domain
 struct domain *get_mem_event_op_target(uint32_t domain, int *rc);
 int do_mem_event_op(int op, uint32_t domain, void *arg);
 int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec,
-                     XEN_GUEST_HANDLE(void) u_domctl);
+                     XEN_GUEST_HANDLE_PARAM(void) u_domctl);
 
 #endif /* __MEM_EVENT_H__ */
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/include/asm-x86/mm.h
--- a/xen/include/asm-x86/mm.h	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/include/asm-x86/mm.h	Wed Oct 17 16:43:53 2012 +0100
@@ -555,10 +555,10 @@ void *do_page_walk(struct vcpu *v, unsig
 int __sync_local_execstate(void);
 
 /* Arch-specific portion of memory_op hypercall. */
-long arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg);
-long subarch_memory_op(int op, XEN_GUEST_HANDLE(void) arg);
-int compat_arch_memory_op(int op, XEN_GUEST_HANDLE(void));
-int compat_subarch_memory_op(int op, XEN_GUEST_HANDLE(void));
+long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg);
+long subarch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg);
+int compat_arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void));
+int compat_subarch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void));
 
 int steal_page(
     struct domain *d, struct page_info *page, unsigned int memflags);
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/include/asm-x86/paging.h
--- a/xen/include/asm-x86/paging.h	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/include/asm-x86/paging.h	Wed Oct 17 16:43:53 2012 +0100
@@ -207,7 +207,7 @@ int paging_domain_init(struct domain *d,
  * and disable ephemeral shadow modes (test mode and log-dirty mode) and
  * manipulate the log-dirty bitmap. */
 int paging_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
-                  XEN_GUEST_HANDLE(void) u_domctl);
+                  XEN_GUEST_HANDLE_PARAM(void) u_domctl);
 
 /* Call when destroying a domain */
 void paging_teardown(struct domain *d);
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/include/asm-x86/processor.h
--- a/xen/include/asm-x86/processor.h	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/include/asm-x86/processor.h	Wed Oct 17 16:43:53 2012 +0100
@@ -549,7 +549,7 @@ int rdmsr_hypervisor_regs(uint32_t idx, 
 int wrmsr_hypervisor_regs(uint32_t idx, uint64_t val);
 
 void microcode_set_module(unsigned int);
-int microcode_update(XEN_GUEST_HANDLE(const_void), unsigned long len);
+int microcode_update(XEN_GUEST_HANDLE_PARAM(const_void), unsigned long len);
 int microcode_resume_cpu(int cpu);
 
 #endif /* !__ASSEMBLY__ */
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/include/asm-x86/shadow.h
--- a/xen/include/asm-x86/shadow.h	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/include/asm-x86/shadow.h	Wed Oct 17 16:43:53 2012 +0100
@@ -73,7 +73,7 @@ int shadow_track_dirty_vram(struct domai
  * manipulate the log-dirty bitmap. */
 int shadow_domctl(struct domain *d, 
                   xen_domctl_shadow_op_t *sc,
-                  XEN_GUEST_HANDLE(void) u_domctl);
+                  XEN_GUEST_HANDLE_PARAM(void) u_domctl);
 
 /* Call when destroying a domain */
 void shadow_teardown(struct domain *d);
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/include/asm-x86/xenoprof.h
--- a/xen/include/asm-x86/xenoprof.h	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/include/asm-x86/xenoprof.h	Wed Oct 17 16:43:53 2012 +0100
@@ -40,9 +40,9 @@ int xenoprof_arch_init(int *num_events, 
 #define xenoprof_arch_disable_virq()            nmi_disable_virq()
 #define xenoprof_arch_release_counters()        nmi_release_counters()
 
-int xenoprof_arch_counter(XEN_GUEST_HANDLE(void) arg);
-int compat_oprof_arch_counter(XEN_GUEST_HANDLE(void) arg);
-int xenoprof_arch_ibs_counter(XEN_GUEST_HANDLE(void) arg);
+int xenoprof_arch_counter(XEN_GUEST_HANDLE_PARAM(void) arg);
+int compat_oprof_arch_counter(XEN_GUEST_HANDLE_PARAM(void) arg);
+int xenoprof_arch_ibs_counter(XEN_GUEST_HANDLE_PARAM(void) arg);
 
 struct vcpu;
 struct cpu_user_regs;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/include/xen/acpi.h
--- a/xen/include/xen/acpi.h	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/include/xen/acpi.h	Wed Oct 17 16:43:53 2012 +0100
@@ -145,8 +145,8 @@ static inline unsigned int acpi_get_csta
 static inline void acpi_set_cstate_limit(unsigned int new_limit) { return; }
 #endif
 
-#ifdef XEN_GUEST_HANDLE
-int acpi_set_pdc_bits(u32 acpi_id, XEN_GUEST_HANDLE(uint32));
+#ifdef XEN_GUEST_HANDLE_PARAM
+int acpi_set_pdc_bits(u32 acpi_id, XEN_GUEST_HANDLE_PARAM(uint32));
 #endif
 int arch_acpi_set_pdc_bits(u32 acpi_id, u32 *, u32 mask);
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/include/xen/compat.h
--- a/xen/include/xen/compat.h	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/include/xen/compat.h	Wed Oct 17 16:43:53 2012 +0100
@@ -22,6 +22,9 @@
     __DEFINE_COMPAT_HANDLE(const_ ## name, const name)
 #define COMPAT_HANDLE(name)          __compat_handle_ ## name
 
+/* NB: it is assumed that if an arch uses the compat layer it does not
+ * distinguish handles from parameter handles. */
+#define COMPAT_HANDLE_PARAM(name)    __compat_handle_ ## name
 /* Is the compat handle a NULL reference? */
 #define compat_handle_is_null(hnd)        ((hnd).c == 0)
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/include/xen/hypercall.h
--- a/xen/include/xen/hypercall.h	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/include/xen/hypercall.h	Wed Oct 17 16:43:53 2012 +0100
@@ -29,29 +29,29 @@ do_sched_op_compat(
 extern long
 do_sched_op(
     int cmd,
-    XEN_GUEST_HANDLE(void) arg);
+    XEN_GUEST_HANDLE_PARAM(void) arg);
 
 extern long
 do_domctl(
-    XEN_GUEST_HANDLE(xen_domctl_t) u_domctl);
+    XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl);
 
 extern long
 arch_do_domctl(
     struct xen_domctl *domctl,
-    XEN_GUEST_HANDLE(xen_domctl_t) u_domctl);
+    XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl);
 
 extern long
 do_sysctl(
-    XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl);
+    XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl);
 
 extern long
 arch_do_sysctl(
     struct xen_sysctl *sysctl,
-    XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl);
+    XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl);
 
 extern long
 do_platform_op(
-    XEN_GUEST_HANDLE(xen_platform_op_t) u_xenpf_op);
+    XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op);
 
 /*
  * To allow safe resume of do_memory_op() after preemption, we need to know
@@ -64,11 +64,11 @@ do_platform_op(
 extern long
 do_memory_op(
     unsigned long cmd,
-    XEN_GUEST_HANDLE(void) arg);
+    XEN_GUEST_HANDLE_PARAM(void) arg);
 
 extern long
 do_multicall(
-    XEN_GUEST_HANDLE(multicall_entry_t) call_list,
+    XEN_GUEST_HANDLE_PARAM(multicall_entry_t) call_list,
     unsigned int nr_calls);
 
 extern long
@@ -77,23 +77,23 @@ do_set_timer_op(
 
 extern long
 do_event_channel_op(
-    int cmd, XEN_GUEST_HANDLE(void) arg);
+    int cmd, XEN_GUEST_HANDLE_PARAM(void) arg);
 
 extern long
 do_xen_version(
     int cmd,
-    XEN_GUEST_HANDLE(void) arg);
+    XEN_GUEST_HANDLE_PARAM(void) arg);
 
 extern long
 do_console_io(
     int cmd,
     int count,
-    XEN_GUEST_HANDLE(char) buffer);
+    XEN_GUEST_HANDLE_PARAM(char) buffer);
 
 extern long
 do_grant_table_op(
     unsigned int cmd,
-    XEN_GUEST_HANDLE(void) uop,
+    XEN_GUEST_HANDLE_PARAM(void) uop,
     unsigned int count);
 
 extern long
@@ -105,72 +105,72 @@ extern long
 do_vcpu_op(
     int cmd,
     int vcpuid,
-    XEN_GUEST_HANDLE(void) arg);
+    XEN_GUEST_HANDLE_PARAM(void) arg);
 
 struct vcpu;
 extern long
 arch_do_vcpu_op(int cmd,
     struct vcpu *v,
-    XEN_GUEST_HANDLE(void) arg);
+    XEN_GUEST_HANDLE_PARAM(void) arg);
 
 extern long
 do_nmi_op(
     unsigned int cmd,
-    XEN_GUEST_HANDLE(void) arg);
+    XEN_GUEST_HANDLE_PARAM(void) arg);
 
 extern long
 do_hvm_op(
     unsigned long op,
-    XEN_GUEST_HANDLE(void) arg);
+    XEN_GUEST_HANDLE_PARAM(void) arg);
 
 extern long
 do_kexec_op(
     unsigned long op,
     int arg1,
-    XEN_GUEST_HANDLE(void) arg);
+    XEN_GUEST_HANDLE_PARAM(void) arg);
 
 extern long
 do_xsm_op(
-    XEN_GUEST_HANDLE(xsm_op_t) u_xsm_op);
+    XEN_GUEST_HANDLE_PARAM(xsm_op_t) u_xsm_op);
 
 extern long
 do_tmem_op(
-    XEN_GUEST_HANDLE(tmem_op_t) uops);
+    XEN_GUEST_HANDLE_PARAM(tmem_op_t) uops);
 
 extern long
-do_xenoprof_op(int op, XEN_GUEST_HANDLE(void) arg);
+do_xenoprof_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg);
 
 #ifdef CONFIG_COMPAT
 
 extern int
 compat_memory_op(
     unsigned int cmd,
-    XEN_GUEST_HANDLE(void) arg);
+    XEN_GUEST_HANDLE_PARAM(void) arg);
 
 extern int
 compat_grant_table_op(
     unsigned int cmd,
-    XEN_GUEST_HANDLE(void) uop,
+    XEN_GUEST_HANDLE_PARAM(void) uop,
     unsigned int count);
 
 extern int
 compat_vcpu_op(
     int cmd,
     int vcpuid,
-    XEN_GUEST_HANDLE(void) arg);
+    XEN_GUEST_HANDLE_PARAM(void) arg);
 
 extern int
-compat_xenoprof_op(int op, XEN_GUEST_HANDLE(void) arg);
+compat_xenoprof_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg);
 
 extern int
 compat_xen_version(
     int cmd,
-    XEN_GUEST_HANDLE(void) arg);
+    XEN_GUEST_HANDLE_PARAM(void) arg);
 
 extern int
 compat_sched_op(
     int cmd,
-    XEN_GUEST_HANDLE(void) arg);
+    XEN_GUEST_HANDLE_PARAM(void) arg);
 
 extern int
 compat_set_timer_op(
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/include/xen/iommu.h
--- a/xen/include/xen/iommu.h	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/include/xen/iommu.h	Wed Oct 17 16:43:53 2012 +0100
@@ -130,7 +130,7 @@ void iommu_crash_shutdown(void);
 void iommu_set_dom0_mapping(struct domain *d);
 void iommu_share_p2m_table(struct domain *d);
 
-int iommu_do_domctl(struct xen_domctl *, XEN_GUEST_HANDLE(xen_domctl_t));
+int iommu_do_domctl(struct xen_domctl *, XEN_GUEST_HANDLE_PARAM(xen_domctl_t));
 
 void iommu_iotlb_flush(struct domain *d, unsigned long gfn, unsigned int page_count);
 void iommu_iotlb_flush_all(struct domain *d);
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/include/xen/tmem_xen.h
--- a/xen/include/xen/tmem_xen.h	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/include/xen/tmem_xen.h	Wed Oct 17 16:43:53 2012 +0100
@@ -430,7 +430,8 @@ static inline void tmh_tze_copy_from_pfp
 typedef XEN_GUEST_HANDLE(void) cli_mfn_t;
 typedef XEN_GUEST_HANDLE(char) cli_va_t;
 */
-typedef XEN_GUEST_HANDLE(tmem_op_t) tmem_cli_op_t;
+typedef XEN_GUEST_HANDLE_PARAM(tmem_op_t) tmem_cli_op_t;
+typedef XEN_GUEST_HANDLE_PARAM(char) tmem_cli_va_param_t;
 
 static inline int tmh_get_tmemop_from_client(tmem_op_t *op, tmem_cli_op_t uops)
 {
@@ -466,8 +467,9 @@ static inline int tmh_get_tmemop_from_cl
 
 #define tmh_cli_buf_null guest_handle_from_ptr(NULL, char)
 
-static inline void tmh_copy_to_client_buf_offset(tmem_cli_va_t clibuf, int off,
-                                           char *tmembuf, int len)
+static inline void tmh_copy_to_client_buf_offset(tmem_cli_va_param_t clibuf,
+						 int off,
+						 char *tmembuf, int len)
 {
     copy_to_guest_offset(clibuf,off,tmembuf,len);
 }
@@ -482,15 +484,17 @@ static inline void tmh_copy_to_client_bu
 #define tmh_cli_id_str "domid"
 #define tmh_client_str "domain"
 
-int tmh_decompress_to_client(tmem_cli_mfn_t, void *, size_t, tmem_cli_va_t);
+int tmh_decompress_to_client(tmem_cli_mfn_t, void *, size_t,
+			     tmem_cli_va_param_t);
 
-int tmh_compress_from_client(tmem_cli_mfn_t, void **, size_t *, tmem_cli_va_t);
+int tmh_compress_from_client(tmem_cli_mfn_t, void **, size_t *,
+			     tmem_cli_va_param_t);
 
 int tmh_copy_from_client(pfp_t *, tmem_cli_mfn_t, pagesize_t tmem_offset,
-    pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t);
+    pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_param_t);
 
 int tmh_copy_to_client(tmem_cli_mfn_t, pfp_t *, pagesize_t tmem_offset,
-    pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t);
+    pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_param_t);
 
 extern int tmh_copy_tze_to_client(tmem_cli_mfn_t cmfn, void *tmem_va, pagesize_t len);
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/include/xsm/xsm.h
--- a/xen/include/xsm/xsm.h	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/include/xsm/xsm.h	Wed Oct 17 16:43:53 2012 +0100
@@ -139,7 +139,7 @@ struct xsm_operations {
     int (*cpupool_op)(void);
     int (*sched_op)(void);
 
-    long (*__do_xsm_op) (XEN_GUEST_HANDLE(xsm_op_t) op);
+    long (*__do_xsm_op) (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op);
 
 #ifdef CONFIG_X86
     int (*shadow_control) (struct domain *d, uint32_t op);
@@ -585,7 +585,7 @@ static inline int xsm_sched_op(void)
     return xsm_call(sched_op());
 }
 
-static inline long __do_xsm_op (XEN_GUEST_HANDLE(xsm_op_t) op)
+static inline long __do_xsm_op (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
 {
 #ifdef XSM_ENABLE
     return xsm_ops->__do_xsm_op(op);
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/xsm/dummy.c
--- a/xen/xsm/dummy.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/xsm/dummy.c	Wed Oct 17 16:43:53 2012 +0100
@@ -380,7 +380,7 @@ static int dummy_sched_op (void)
     return 0;
 }
 
-static long dummy___do_xsm_op(XEN_GUEST_HANDLE(xsm_op_t) op)
+static long dummy___do_xsm_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
 {
     return -ENOSYS;
 }
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/xsm/flask/flask_op.c
--- a/xen/xsm/flask/flask_op.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/xsm/flask/flask_op.c	Wed Oct 17 16:43:53 2012 +0100
@@ -71,7 +71,7 @@ static int domain_has_security(struct do
                         perms, NULL);
 }
 
-static int flask_copyin_string(XEN_GUEST_HANDLE(char) u_buf, char **buf, uint32_t size)
+static int flask_copyin_string(XEN_GUEST_HANDLE_PARAM(char) u_buf, char **buf, uint32_t size)
 {
     char *tmp = xmalloc_bytes(size + 1);
     if ( !tmp )
@@ -618,7 +618,7 @@ static int flask_relabel_domain(struct x
     return rc;
 }
 
-long do_flask_op(XEN_GUEST_HANDLE(xsm_op_t) u_flask_op)
+long do_flask_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) u_flask_op)
 {
     xen_flask_op_t op;
     int rv;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/xsm/flask/hooks.c
--- a/xen/xsm/flask/hooks.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/xsm/flask/hooks.c	Wed Oct 17 16:43:53 2012 +0100
@@ -1462,7 +1462,7 @@ static int flask_vcpuextstate (struct do
 }
 #endif
 
-long do_flask_op(XEN_GUEST_HANDLE(xsm_op_t) u_flask_op);
+long do_flask_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) u_flask_op);
 
 static struct xsm_operations flask_ops = {
     .security_domaininfo = flask_security_domaininfo,
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/xsm/xsm_core.c
--- a/xen/xsm/xsm_core.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/xsm/xsm_core.c	Wed Oct 17 16:43:53 2012 +0100
@@ -111,7 +111,7 @@ int unregister_xsm(struct xsm_operations
 
 #endif
 
-long do_xsm_op (XEN_GUEST_HANDLE(xsm_op_t) op)
+long do_xsm_op (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
 {
     return __do_xsm_op(op);
 }

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22: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 1TPKmo-0008L9-CS; Fri, 19 Oct 2012 22:11:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKml-0008Gl-SC
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:20 +0000
Received: from [85.158.137.99:21800] by server-11.bemta-3.messagelabs.com id
	93/CA-24008-600D1805; Fri, 19 Oct 2012 22:11:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-217.messagelabs.com!1350684674!22263745!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31939 invoked from network); 19 Oct 2012 22:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmg-0005Ux-4t
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmg-0008T8-2m
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:14 +0000
Message-Id: <E1TPKmg-0008T8-2m@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: replace XEN_GUEST_HANDLE with
	XEN_GUEST_HANDLE_PARAM when appropriate
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1350488633 -3600
# Node ID 9eafdcd5ff0b55acaf65dd482179a3ca1db78482
# Parent  1eb4b2f7465f8c7c15fe1d6a198d53dda30372a9
xen: replace XEN_GUEST_HANDLE with XEN_GUEST_HANDLE_PARAM when appropriate

Note: these changes don't make any difference on x86.

Replace XEN_GUEST_HANDLE with XEN_GUEST_HANDLE_PARAM when it is used as
an hypercall argument.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/arm/domain.c
--- a/xen/arch/arm/domain.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/arm/domain.c	Wed Oct 17 16:43:53 2012 +0100
@@ -519,7 +519,7 @@ void arch_dump_domain_info(struct domain
 {
 }
 
-long arch_do_vcpu_op(int cmd, struct vcpu *v, XEN_GUEST_HANDLE(void) arg)
+long arch_do_vcpu_op(int cmd, struct vcpu *v, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     return -ENOSYS;
 }
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/arm/domctl.c
--- a/xen/arch/arm/domctl.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/arm/domctl.c	Wed Oct 17 16:43:53 2012 +0100
@@ -11,7 +11,7 @@
 #include <public/domctl.h>
 
 long arch_do_domctl(struct xen_domctl *domctl,
-                    XEN_GUEST_HANDLE(xen_domctl_t) u_domctl)
+                    XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
     return -ENOSYS;
 }
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/arm/hvm.c
--- a/xen/arch/arm/hvm.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/arm/hvm.c	Wed Oct 17 16:43:53 2012 +0100
@@ -11,7 +11,7 @@
 
 #include <asm/hypercall.h>
 
-long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE(void) arg)
+long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
 
 {
     long rc = 0;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/arm/mm.c	Wed Oct 17 16:43:53 2012 +0100
@@ -579,7 +579,7 @@ out:
 
 }
 
-long arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg)
+long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     int rc;
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/arm/physdev.c
--- a/xen/arch/arm/physdev.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/arm/physdev.c	Wed Oct 17 16:43:53 2012 +0100
@@ -11,7 +11,7 @@
 #include <asm/hypercall.h>
 
 
-int do_physdev_op(int cmd, XEN_GUEST_HANDLE(void) arg)
+int do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     printk("%s %d cmd=%d: not implemented yet\n", __func__, __LINE__, cmd);
     return -ENOSYS;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/arm/sysctl.c
--- a/xen/arch/arm/sysctl.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/arm/sysctl.c	Wed Oct 17 16:43:53 2012 +0100
@@ -13,7 +13,7 @@
 #include <public/sysctl.h>
 
 long arch_do_sysctl(struct xen_sysctl *sysctl,
-                    XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl)
+                    XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 {
     return -ENOSYS;
 }
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/compat.c
--- a/xen/arch/x86/compat.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/compat.c	Wed Oct 17 16:43:53 2012 +0100
@@ -27,7 +27,7 @@ ret_t do_physdev_op_compat(XEN_GUEST_HAN
 #ifndef COMPAT
 
 /* Legacy hypercall (as of 0x00030202). */
-long do_event_channel_op_compat(XEN_GUEST_HANDLE(evtchn_op_t) uop)
+long do_event_channel_op_compat(XEN_GUEST_HANDLE_PARAM(evtchn_op_t) uop)
 {
     struct evtchn_op op;
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/cpu/mcheck/mce.c
--- a/xen/arch/x86/cpu/mcheck/mce.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce.c	Wed Oct 17 16:43:53 2012 +0100
@@ -1289,7 +1289,7 @@ CHECK_mcinfo_recovery;
 # undef xen_mcinfo_recovery
 
 /* Machine Check Architecture Hypercall */
-long do_mca(XEN_GUEST_HANDLE(xen_mc_t) u_xen_mc)
+long do_mca(XEN_GUEST_HANDLE_PARAM(xen_mc_t) u_xen_mc)
 {
     long ret = 0;
     struct xen_mc curop, *op = &curop;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/domain.c	Wed Oct 17 16:43:53 2012 +0100
@@ -1077,7 +1077,7 @@ map_vcpu_info(struct vcpu *v, unsigned l
 
 long
 arch_do_vcpu_op(
-    int cmd, struct vcpu *v, XEN_GUEST_HANDLE(void) arg)
+    int cmd, struct vcpu *v, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     long rc = 0;
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/domctl.c	Wed Oct 17 16:43:53 2012 +0100
@@ -48,7 +48,7 @@ static int gdbsx_guest_mem_io(
 
 long arch_do_domctl(
     struct xen_domctl *domctl,
-    XEN_GUEST_HANDLE(xen_domctl_t) u_domctl)
+    XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
     long ret = 0;
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/efi/runtime.c
--- a/xen/arch/x86/efi/runtime.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/efi/runtime.c	Wed Oct 17 16:43:53 2012 +0100
@@ -184,7 +184,7 @@ int efi_get_info(uint32_t idx, union xen
     return 0;
 }
 
-static long gwstrlen(XEN_GUEST_HANDLE(CHAR16) str)
+static long gwstrlen(XEN_GUEST_HANDLE_PARAM(CHAR16) str)
 {
     unsigned long len;
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/hvm/hvm.c	Wed Oct 17 16:43:53 2012 +0100
@@ -3091,14 +3091,14 @@ static int grant_table_op_is_allowed(uns
 }
 
 static long hvm_grant_table_op(
-    unsigned int cmd, XEN_GUEST_HANDLE(void) uop, unsigned int count)
+    unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) uop, unsigned int count)
 {
     if ( !grant_table_op_is_allowed(cmd) )
         return -ENOSYS; /* all other commands need auditing */
     return do_grant_table_op(cmd, uop, count);
 }
 
-static long hvm_memory_op(int cmd, XEN_GUEST_HANDLE(void) arg)
+static long hvm_memory_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     long rc;
 
@@ -3116,7 +3116,7 @@ static long hvm_memory_op(int cmd, XEN_G
     return do_memory_op(cmd, arg);
 }
 
-static long hvm_physdev_op(int cmd, XEN_GUEST_HANDLE(void) arg)
+static long hvm_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     switch ( cmd )
     {
@@ -3132,7 +3132,7 @@ static long hvm_physdev_op(int cmd, XEN_
 }
 
 static long hvm_vcpu_op(
-    int cmd, int vcpuid, XEN_GUEST_HANDLE(void) arg)
+    int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     long rc;
 
@@ -3163,7 +3163,7 @@ typedef unsigned long hvm_hypercall_t(
     [ __HYPERVISOR_ ## x ] = (hvm_hypercall_t *) do_ ## x
 
 static long hvm_grant_table_op_compat32(unsigned int cmd,
-                                        XEN_GUEST_HANDLE(void) uop,
+                                        XEN_GUEST_HANDLE_PARAM(void) uop,
                                         unsigned int count)
 {
     if ( !grant_table_op_is_allowed(cmd) )
@@ -3171,7 +3171,7 @@ static long hvm_grant_table_op_compat32(
     return compat_grant_table_op(cmd, uop, count);
 }
 
-static long hvm_memory_op_compat32(int cmd, XEN_GUEST_HANDLE(void) arg)
+static long hvm_memory_op_compat32(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     int rc;
 
@@ -3190,7 +3190,7 @@ static long hvm_memory_op_compat32(int c
 }
 
 static long hvm_vcpu_op_compat32(
-    int cmd, int vcpuid, XEN_GUEST_HANDLE(void) arg)
+    int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     long rc;
 
@@ -3214,7 +3214,7 @@ static long hvm_vcpu_op_compat32(
 }
 
 static long hvm_physdev_op_compat32(
-    int cmd, XEN_GUEST_HANDLE(void) arg)
+    int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     switch ( cmd )
     {
@@ -3380,7 +3380,7 @@ void hvm_hypercall_page_initialise(struc
 }
 
 static int hvmop_set_pci_intx_level(
-    XEN_GUEST_HANDLE(xen_hvm_set_pci_intx_level_t) uop)
+    XEN_GUEST_HANDLE_PARAM(xen_hvm_set_pci_intx_level_t) uop)
 {
     struct xen_hvm_set_pci_intx_level op;
     struct domain *d;
@@ -3547,7 +3547,7 @@ static void hvm_s3_resume(struct domain 
 }
 
 static int hvmop_set_isa_irq_level(
-    XEN_GUEST_HANDLE(xen_hvm_set_isa_irq_level_t) uop)
+    XEN_GUEST_HANDLE_PARAM(xen_hvm_set_isa_irq_level_t) uop)
 {
     struct xen_hvm_set_isa_irq_level op;
     struct domain *d;
@@ -3591,7 +3591,7 @@ static int hvmop_set_isa_irq_level(
 }
 
 static int hvmop_set_pci_link_route(
-    XEN_GUEST_HANDLE(xen_hvm_set_pci_link_route_t) uop)
+    XEN_GUEST_HANDLE_PARAM(xen_hvm_set_pci_link_route_t) uop)
 {
     struct xen_hvm_set_pci_link_route op;
     struct domain *d;
@@ -3624,7 +3624,7 @@ static int hvmop_set_pci_link_route(
 }
 
 static int hvmop_inject_msi(
-    XEN_GUEST_HANDLE(xen_hvm_inject_msi_t) uop)
+    XEN_GUEST_HANDLE_PARAM(xen_hvm_inject_msi_t) uop)
 {
     struct xen_hvm_inject_msi op;
     struct domain *d;
@@ -3708,7 +3708,7 @@ static int hvm_replace_event_channel(str
     return 0;
 }
 
-long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE(void) arg)
+long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
 
 {
     struct domain *curr_d = current->domain;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/microcode.c
--- a/xen/arch/x86/microcode.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/microcode.c	Wed Oct 17 16:43:53 2012 +0100
@@ -195,7 +195,7 @@ static long do_microcode_update(void *_i
     return error;
 }
 
-int microcode_update(XEN_GUEST_HANDLE(const_void) buf, unsigned long len)
+int microcode_update(XEN_GUEST_HANDLE_PARAM(const_void) buf, unsigned long len)
 {
     int ret;
     struct microcode_info *info;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/mm.c	Wed Oct 17 16:43:53 2012 +0100
@@ -2652,7 +2652,7 @@ static void put_pg_owner(struct domain *
 }
 
 static inline int vcpumask_to_pcpumask(
-    struct domain *d, XEN_GUEST_HANDLE(const_void) bmap, cpumask_t *pmask)
+    struct domain *d, XEN_GUEST_HANDLE_PARAM(const_void) bmap, cpumask_t *pmask)
 {
     unsigned int vcpu_id, vcpu_bias, offs;
     unsigned long vmask;
@@ -2692,9 +2692,9 @@ static inline int vcpumask_to_pcpumask(
 #define fixunmap_domain_page(ptr) ((void)(ptr))
 
 long do_mmuext_op(
-    XEN_GUEST_HANDLE(mmuext_op_t) uops,
+    XEN_GUEST_HANDLE_PARAM(mmuext_op_t) uops,
     unsigned int count,
-    XEN_GUEST_HANDLE(uint) pdone,
+    XEN_GUEST_HANDLE_PARAM(uint) pdone,
     unsigned int foreigndom)
 {
     struct mmuext_op op;
@@ -3151,9 +3151,9 @@ long do_mmuext_op(
 }
 
 long do_mmu_update(
-    XEN_GUEST_HANDLE(mmu_update_t) ureqs,
+    XEN_GUEST_HANDLE_PARAM(mmu_update_t) ureqs,
     unsigned int count,
-    XEN_GUEST_HANDLE(uint) pdone,
+    XEN_GUEST_HANDLE_PARAM(uint) pdone,
     unsigned int foreigndom)
 {
     struct mmu_update req;
@@ -4098,7 +4098,7 @@ long set_gdt(struct vcpu *v,
 }
 
 
-long do_set_gdt(XEN_GUEST_HANDLE(ulong) frame_list, unsigned int entries)
+long do_set_gdt(XEN_GUEST_HANDLE_PARAM(ulong) frame_list, unsigned int entries)
 {
     int nr_pages = (entries + 511) / 512;
     unsigned long frames[16];
@@ -4370,7 +4370,7 @@ static int xenmem_add_to_physmap(struct 
     return xenmem_add_to_physmap_once(d, xatp);
 }
 
-long arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg)
+long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     int rc;
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/mm/hap/hap.c	Wed Oct 17 16:43:53 2012 +0100
@@ -571,7 +571,7 @@ void hap_teardown(struct domain *d)
 }
 
 int hap_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
-               XEN_GUEST_HANDLE(void) u_domctl)
+               XEN_GUEST_HANDLE_PARAM(void) u_domctl)
 {
     int rc, preempted = 0;
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/mm/mem_event.c
--- a/xen/arch/x86/mm/mem_event.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/mm/mem_event.c	Wed Oct 17 16:43:53 2012 +0100
@@ -512,7 +512,7 @@ void mem_event_cleanup(struct domain *d)
 }
 
 int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec,
-                     XEN_GUEST_HANDLE(void) u_domctl)
+                     XEN_GUEST_HANDLE_PARAM(void) u_domctl)
 {
     int rc;
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/mm/paging.c
--- a/xen/arch/x86/mm/paging.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/mm/paging.c	Wed Oct 17 16:43:53 2012 +0100
@@ -654,7 +654,7 @@ void paging_vcpu_init(struct vcpu *v)
 
 
 int paging_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
-                  XEN_GUEST_HANDLE(void) u_domctl)
+                  XEN_GUEST_HANDLE_PARAM(void) u_domctl)
 {
     int rc;
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/mm/shadow/common.c
--- a/xen/arch/x86/mm/shadow/common.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/mm/shadow/common.c	Wed Oct 17 16:43:53 2012 +0100
@@ -3641,7 +3641,7 @@ out:
 
 int shadow_domctl(struct domain *d, 
                   xen_domctl_shadow_op_t *sc,
-                  XEN_GUEST_HANDLE(void) u_domctl)
+                  XEN_GUEST_HANDLE_PARAM(void) u_domctl)
 {
     int rc, preempted = 0;
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/oprofile/xenoprof.c
--- a/xen/arch/x86/oprofile/xenoprof.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/oprofile/xenoprof.c	Wed Oct 17 16:43:53 2012 +0100
@@ -17,7 +17,7 @@
 
 #include "op_counter.h"
 
-int xenoprof_arch_counter(XEN_GUEST_HANDLE(void) arg)
+int xenoprof_arch_counter(XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     struct xenoprof_counter counter;
 
@@ -37,7 +37,7 @@ int xenoprof_arch_counter(XEN_GUEST_HAND
     return 0;
 }
 
-int xenoprof_arch_ibs_counter(XEN_GUEST_HANDLE(void) arg)
+int xenoprof_arch_ibs_counter(XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     struct xenoprof_ibs_counter ibs_counter;
 
@@ -54,7 +54,7 @@ int xenoprof_arch_ibs_counter(XEN_GUEST_
     return 0;
 }
 
-int compat_oprof_arch_counter(XEN_GUEST_HANDLE(void) arg)
+int compat_oprof_arch_counter(XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     struct compat_oprof_counter counter;
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/physdev.c	Wed Oct 17 16:43:53 2012 +0100
@@ -258,7 +258,7 @@ int physdev_unmap_pirq(domid_t domid, in
 }
 #endif /* COMPAT */
 
-ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE(void) arg)
+ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     int irq;
     ret_t ret;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/sysctl.c
--- a/xen/arch/x86/sysctl.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/sysctl.c	Wed Oct 17 16:43:53 2012 +0100
@@ -58,7 +58,7 @@ long cpu_down_helper(void *data)
 }
 
 long arch_do_sysctl(
-    struct xen_sysctl *sysctl, XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl)
+    struct xen_sysctl *sysctl, XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 {
     long ret = 0;
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/traps.c	Wed Oct 17 16:43:53 2012 +0100
@@ -3536,7 +3536,7 @@ int send_guest_trap(struct domain *d, ui
 }
 
 
-long do_set_trap_table(XEN_GUEST_HANDLE(const_trap_info_t) traps)
+long do_set_trap_table(XEN_GUEST_HANDLE_PARAM(const_trap_info_t) traps)
 {
     struct trap_info cur;
     struct vcpu *curr = current;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/x86_64/compat/mm.c
--- a/xen/arch/x86/x86_64/compat/mm.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/x86_64/compat/mm.c	Wed Oct 17 16:43:53 2012 +0100
@@ -5,7 +5,7 @@
 #include <asm/mem_event.h>
 #include <asm/mem_sharing.h>
 
-int compat_set_gdt(XEN_GUEST_HANDLE(uint) frame_list, unsigned int entries)
+int compat_set_gdt(XEN_GUEST_HANDLE_PARAM(uint) frame_list, unsigned int entries)
 {
     unsigned int i, nr_pages = (entries + 511) / 512;
     unsigned long frames[16];
@@ -44,7 +44,7 @@ int compat_update_descriptor(u32 pa_lo, 
                                 desc_lo | ((u64)desc_hi << 32));
 }
 
-int compat_arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg)
+int compat_arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     struct compat_machphys_mfn_list xmml;
     l2_pgentry_t l2e;
@@ -260,14 +260,14 @@ int compat_update_va_mapping_otherdomain
 
 DEFINE_XEN_GUEST_HANDLE(mmuext_op_compat_t);
 
-int compat_mmuext_op(XEN_GUEST_HANDLE(mmuext_op_compat_t) cmp_uops,
+int compat_mmuext_op(XEN_GUEST_HANDLE_PARAM(mmuext_op_compat_t) cmp_uops,
                      unsigned int count,
-                     XEN_GUEST_HANDLE(uint) pdone,
+                     XEN_GUEST_HANDLE_PARAM(uint) pdone,
                      unsigned int foreigndom)
 {
     unsigned int i, preempt_mask;
     int rc = 0;
-    XEN_GUEST_HANDLE(mmuext_op_t) nat_ops;
+    XEN_GUEST_HANDLE_PARAM(mmuext_op_t) nat_ops;
 
     preempt_mask = count & MMU_UPDATE_PREEMPTED;
     count ^= preempt_mask;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/x86_64/domain.c
--- a/xen/arch/x86/x86_64/domain.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/x86_64/domain.c	Wed Oct 17 16:43:53 2012 +0100
@@ -23,7 +23,7 @@ CHECK_vcpu_get_physid;
 
 int
 arch_compat_vcpu_op(
-    int cmd, struct vcpu *v, XEN_GUEST_HANDLE(void) arg)
+    int cmd, struct vcpu *v, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     int rc = -ENOSYS;
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/x86_64/mm.c
--- a/xen/arch/x86/x86_64/mm.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/x86_64/mm.c	Wed Oct 17 16:43:53 2012 +0100
@@ -1027,7 +1027,7 @@ void __init subarch_init_memory(void)
     }
 }
 
-long subarch_memory_op(int op, XEN_GUEST_HANDLE(void) arg)
+long subarch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     struct xen_machphys_mfn_list xmml;
     l3_pgentry_t l3e;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/arch/x86/x86_64/traps.c
--- a/xen/arch/x86/x86_64/traps.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/arch/x86/x86_64/traps.c	Wed Oct 17 16:43:53 2012 +0100
@@ -519,7 +519,7 @@ static long unregister_guest_callback(st
 }
 
 
-long do_callback_op(int cmd, XEN_GUEST_HANDLE(const_void) arg)
+long do_callback_op(int cmd, XEN_GUEST_HANDLE_PARAM(const_void) arg)
 {
     long ret;
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/common/compat/domain.c
--- a/xen/common/compat/domain.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/common/compat/domain.c	Wed Oct 17 16:43:53 2012 +0100
@@ -15,7 +15,7 @@
 CHECK_vcpu_set_periodic_timer;
 #undef xen_vcpu_set_periodic_timer
 
-int compat_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE(void) arg)
+int compat_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     struct domain *d = current->domain;
     struct vcpu *v;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/common/compat/grant_table.c
--- a/xen/common/compat/grant_table.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/common/compat/grant_table.c	Wed Oct 17 16:43:53 2012 +0100
@@ -52,12 +52,12 @@ CHECK_gnttab_swap_grant_ref;
 #undef xen_gnttab_swap_grant_ref
 
 int compat_grant_table_op(unsigned int cmd,
-                          XEN_GUEST_HANDLE(void) cmp_uop,
+                          XEN_GUEST_HANDLE_PARAM(void) cmp_uop,
                           unsigned int count)
 {
     int rc = 0;
     unsigned int i;
-    XEN_GUEST_HANDLE(void) cnt_uop;
+    XEN_GUEST_HANDLE_PARAM(void) cnt_uop;
 
     set_xen_guest_handle(cnt_uop, NULL);
     switch ( cmd )
@@ -206,7 +206,7 @@ int compat_grant_table_op(unsigned int c
             }
             if ( rc >= 0 )
             {
-                XEN_GUEST_HANDLE(gnttab_transfer_compat_t) xfer;
+                XEN_GUEST_HANDLE_PARAM(gnttab_transfer_compat_t) xfer;
 
                 xfer = guest_handle_cast(cmp_uop, gnttab_transfer_compat_t);
                 guest_handle_add_offset(xfer, i);
@@ -251,7 +251,7 @@ int compat_grant_table_op(unsigned int c
             }
             if ( rc >= 0 )
             {
-                XEN_GUEST_HANDLE(gnttab_copy_compat_t) copy;
+                XEN_GUEST_HANDLE_PARAM(gnttab_copy_compat_t) copy;
 
                 copy = guest_handle_cast(cmp_uop, gnttab_copy_compat_t);
                 guest_handle_add_offset(copy, i);
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/common/compat/memory.c
--- a/xen/common/compat/memory.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/common/compat/memory.c	Wed Oct 17 16:43:53 2012 +0100
@@ -13,7 +13,7 @@ CHECK_TYPE(domid);
 #undef compat_domid_t
 #undef xen_domid_t
 
-int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE(void) compat)
+int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
 {
     int rc, split, op = cmd & MEMOP_CMD_MASK;
     unsigned int start_extent = cmd >> MEMOP_EXTENT_SHIFT;
@@ -22,7 +22,7 @@ int compat_memory_op(unsigned int cmd, X
     {
         unsigned int i, end_extent = 0;
         union {
-            XEN_GUEST_HANDLE(void) hnd;
+            XEN_GUEST_HANDLE_PARAM(void) hnd;
             struct xen_memory_reservation *rsrv;
             struct xen_memory_exchange *xchg;
             struct xen_remove_from_physmap *xrfp;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/common/domain.c
--- a/xen/common/domain.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/common/domain.c	Wed Oct 17 16:43:53 2012 +0100
@@ -827,7 +827,7 @@ void vcpu_reset(struct vcpu *v)
 }
 
 
-long do_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE(void) arg)
+long do_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     struct domain *d = current->domain;
     struct vcpu *v;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/common/domctl.c
--- a/xen/common/domctl.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/common/domctl.c	Wed Oct 17 16:43:53 2012 +0100
@@ -239,7 +239,7 @@ void domctl_lock_release(void)
     spin_unlock(&current->domain->hypercall_deadlock_mutex);
 }
 
-long do_domctl(XEN_GUEST_HANDLE(xen_domctl_t) u_domctl)
+long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
     long ret = 0;
     struct xen_domctl curop, *op = &curop;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/common/event_channel.c
--- a/xen/common/event_channel.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/common/event_channel.c	Wed Oct 17 16:43:53 2012 +0100
@@ -970,7 +970,7 @@ out:
 }
 
 
-long do_event_channel_op(int cmd, XEN_GUEST_HANDLE(void) arg)
+long do_event_channel_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     long rc;
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/common/grant_table.c
--- a/xen/common/grant_table.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/common/grant_table.c	Wed Oct 17 16:43:53 2012 +0100
@@ -833,7 +833,7 @@ __gnttab_map_grant_ref(
 
 static long
 gnttab_map_grant_ref(
-    XEN_GUEST_HANDLE(gnttab_map_grant_ref_t) uop, unsigned int count)
+    XEN_GUEST_HANDLE_PARAM(gnttab_map_grant_ref_t) uop, unsigned int count)
 {
     int i;
     struct gnttab_map_grant_ref op;
@@ -1102,7 +1102,7 @@ __gnttab_unmap_grant_ref(
 
 static long
 gnttab_unmap_grant_ref(
-    XEN_GUEST_HANDLE(gnttab_unmap_grant_ref_t) uop, unsigned int count)
+    XEN_GUEST_HANDLE_PARAM(gnttab_unmap_grant_ref_t) uop, unsigned int count)
 {
     int i, c, partial_done, done = 0;
     struct gnttab_unmap_grant_ref op;
@@ -1164,7 +1164,7 @@ __gnttab_unmap_and_replace(
 
 static long
 gnttab_unmap_and_replace(
-    XEN_GUEST_HANDLE(gnttab_unmap_and_replace_t) uop, unsigned int count)
+    XEN_GUEST_HANDLE_PARAM(gnttab_unmap_and_replace_t) uop, unsigned int count)
 {
     int i, c, partial_done, done = 0;
     struct gnttab_unmap_and_replace op;
@@ -1316,7 +1316,7 @@ active_alloc_failed:
 
 static long 
 gnttab_setup_table(
-    XEN_GUEST_HANDLE(gnttab_setup_table_t) uop, unsigned int count)
+    XEN_GUEST_HANDLE_PARAM(gnttab_setup_table_t) uop, unsigned int count)
 {
     struct gnttab_setup_table op;
     struct domain *d;
@@ -1395,7 +1395,7 @@ gnttab_setup_table(
 
 static long 
 gnttab_query_size(
-    XEN_GUEST_HANDLE(gnttab_query_size_t) uop, unsigned int count)
+    XEN_GUEST_HANDLE_PARAM(gnttab_query_size_t) uop, unsigned int count)
 {
     struct gnttab_query_size op;
     struct domain *d;
@@ -1517,7 +1517,7 @@ gnttab_prepare_for_transfer(
 
 static long
 gnttab_transfer(
-    XEN_GUEST_HANDLE(gnttab_transfer_t) uop, unsigned int count)
+    XEN_GUEST_HANDLE_PARAM(gnttab_transfer_t) uop, unsigned int count)
 {
     struct domain *d = current->domain;
     struct domain *e;
@@ -2125,7 +2125,7 @@ __gnttab_copy(
 
 static long
 gnttab_copy(
-    XEN_GUEST_HANDLE(gnttab_copy_t) uop, unsigned int count)
+    XEN_GUEST_HANDLE_PARAM(gnttab_copy_t) uop, unsigned int count)
 {
     int i;
     struct gnttab_copy op;
@@ -2144,7 +2144,7 @@ gnttab_copy(
 }
 
 static long
-gnttab_set_version(XEN_GUEST_HANDLE(gnttab_set_version_t uop))
+gnttab_set_version(XEN_GUEST_HANDLE_PARAM(gnttab_set_version_t uop))
 {
     gnttab_set_version_t op;
     struct domain *d = current->domain;
@@ -2263,7 +2263,7 @@ out:
 }
 
 static long
-gnttab_get_status_frames(XEN_GUEST_HANDLE(gnttab_get_status_frames_t) uop,
+gnttab_get_status_frames(XEN_GUEST_HANDLE_PARAM(gnttab_get_status_frames_t) uop,
                          int count)
 {
     gnttab_get_status_frames_t op;
@@ -2327,7 +2327,7 @@ out1:
 }
 
 static long
-gnttab_get_version(XEN_GUEST_HANDLE(gnttab_get_version_t uop))
+gnttab_get_version(XEN_GUEST_HANDLE_PARAM(gnttab_get_version_t uop))
 {
     gnttab_get_version_t op;
     struct domain *d;
@@ -2412,7 +2412,7 @@ out:
 }
 
 static long
-gnttab_swap_grant_ref(XEN_GUEST_HANDLE(gnttab_swap_grant_ref_t uop),
+gnttab_swap_grant_ref(XEN_GUEST_HANDLE_PARAM(gnttab_swap_grant_ref_t uop),
                       unsigned int count)
 {
     int i;
@@ -2433,7 +2433,7 @@ gnttab_swap_grant_ref(XEN_GUEST_HANDLE(g
 
 long
 do_grant_table_op(
-    unsigned int cmd, XEN_GUEST_HANDLE(void) uop, unsigned int count)
+    unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) uop, unsigned int count)
 {
     long rc;
     
@@ -2445,7 +2445,7 @@ do_grant_table_op(
     {
     case GNTTABOP_map_grant_ref:
     {
-        XEN_GUEST_HANDLE(gnttab_map_grant_ref_t) map =
+        XEN_GUEST_HANDLE_PARAM(gnttab_map_grant_ref_t) map =
             guest_handle_cast(uop, gnttab_map_grant_ref_t);
         if ( unlikely(!guest_handle_okay(map, count)) )
             goto out;
@@ -2459,7 +2459,7 @@ do_grant_table_op(
     }
     case GNTTABOP_unmap_grant_ref:
     {
-        XEN_GUEST_HANDLE(gnttab_unmap_grant_ref_t) unmap =
+        XEN_GUEST_HANDLE_PARAM(gnttab_unmap_grant_ref_t) unmap =
             guest_handle_cast(uop, gnttab_unmap_grant_ref_t);
         if ( unlikely(!guest_handle_okay(unmap, count)) )
             goto out;
@@ -2473,7 +2473,7 @@ do_grant_table_op(
     }
     case GNTTABOP_unmap_and_replace:
     {
-        XEN_GUEST_HANDLE(gnttab_unmap_and_replace_t) unmap =
+        XEN_GUEST_HANDLE_PARAM(gnttab_unmap_and_replace_t) unmap =
             guest_handle_cast(uop, gnttab_unmap_and_replace_t);
         if ( unlikely(!guest_handle_okay(unmap, count)) )
             goto out;
@@ -2497,7 +2497,7 @@ do_grant_table_op(
     }
     case GNTTABOP_transfer:
     {
-        XEN_GUEST_HANDLE(gnttab_transfer_t) transfer =
+        XEN_GUEST_HANDLE_PARAM(gnttab_transfer_t) transfer =
             guest_handle_cast(uop, gnttab_transfer_t);
         if ( unlikely(!guest_handle_okay(transfer, count)) )
             goto out;
@@ -2511,7 +2511,7 @@ do_grant_table_op(
     }
     case GNTTABOP_copy:
     {
-        XEN_GUEST_HANDLE(gnttab_copy_t) copy =
+        XEN_GUEST_HANDLE_PARAM(gnttab_copy_t) copy =
             guest_handle_cast(uop, gnttab_copy_t);
         if ( unlikely(!guest_handle_okay(copy, count)) )
             goto out;
@@ -2548,7 +2548,7 @@ do_grant_table_op(
     }
     case GNTTABOP_swap_grant_ref:
     {
-        XEN_GUEST_HANDLE(gnttab_swap_grant_ref_t) swap =
+        XEN_GUEST_HANDLE_PARAM(gnttab_swap_grant_ref_t) swap =
             guest_handle_cast(uop, gnttab_swap_grant_ref_t);
         if ( unlikely(!guest_handle_okay(swap, count)) )
             goto out;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/common/kernel.c
--- a/xen/common/kernel.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/common/kernel.c	Wed Oct 17 16:43:53 2012 +0100
@@ -204,7 +204,7 @@ void __init do_initcalls(void)
  * Simple hypercalls.
  */
 
-DO(xen_version)(int cmd, XEN_GUEST_HANDLE(void) arg)
+DO(xen_version)(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     switch ( cmd )
     {
@@ -332,7 +332,7 @@ DO(xen_version)(int cmd, XEN_GUEST_HANDL
     return -ENOSYS;
 }
 
-DO(nmi_op)(unsigned int cmd, XEN_GUEST_HANDLE(void) arg)
+DO(nmi_op)(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     struct xennmi_callback cb;
     long rc = 0;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/common/kexec.c
--- a/xen/common/kexec.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/common/kexec.c	Wed Oct 17 16:43:53 2012 +0100
@@ -613,7 +613,7 @@ static int kexec_get_range_internal(xen_
     return ret;
 }
 
-static int kexec_get_range(XEN_GUEST_HANDLE(void) uarg)
+static int kexec_get_range(XEN_GUEST_HANDLE_PARAM(void) uarg)
 {
     xen_kexec_range_t range;
     int ret = -EINVAL;
@@ -629,7 +629,7 @@ static int kexec_get_range(XEN_GUEST_HAN
     return ret;
 }
 
-static int kexec_get_range_compat(XEN_GUEST_HANDLE(void) uarg)
+static int kexec_get_range_compat(XEN_GUEST_HANDLE_PARAM(void) uarg)
 {
 #ifdef CONFIG_COMPAT
     xen_kexec_range_t range;
@@ -777,7 +777,7 @@ static int kexec_load_unload_internal(un
     return ret;
 }
 
-static int kexec_load_unload(unsigned long op, XEN_GUEST_HANDLE(void) uarg)
+static int kexec_load_unload(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) uarg)
 {
     xen_kexec_load_t load;
 
@@ -788,7 +788,7 @@ static int kexec_load_unload(unsigned lo
 }
 
 static int kexec_load_unload_compat(unsigned long op,
-                                    XEN_GUEST_HANDLE(void) uarg)
+                                    XEN_GUEST_HANDLE_PARAM(void) uarg)
 {
 #ifdef CONFIG_COMPAT
     compat_kexec_load_t compat_load;
@@ -813,7 +813,7 @@ static int kexec_load_unload_compat(unsi
 #endif /* CONFIG_COMPAT */
 }
 
-static int kexec_exec(XEN_GUEST_HANDLE(void) uarg)
+static int kexec_exec(XEN_GUEST_HANDLE_PARAM(void) uarg)
 {
     xen_kexec_exec_t exec;
     xen_kexec_image_t *image;
@@ -845,7 +845,8 @@ static int kexec_exec(XEN_GUEST_HANDLE(v
     return -EINVAL; /* never reached */
 }
 
-static int do_kexec_op_internal(unsigned long op, XEN_GUEST_HANDLE(void) uarg,
+static int do_kexec_op_internal(unsigned long op,
+                                XEN_GUEST_HANDLE_PARAM(void) uarg,
                                 bool_t compat)
 {
     unsigned long flags;
@@ -886,13 +887,13 @@ static int do_kexec_op_internal(unsigned
     return ret;
 }
 
-long do_kexec_op(unsigned long op, XEN_GUEST_HANDLE(void) uarg)
+long do_kexec_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) uarg)
 {
     return do_kexec_op_internal(op, uarg, 0);
 }
 
 #ifdef CONFIG_COMPAT
-int compat_kexec_op(unsigned long op, XEN_GUEST_HANDLE(void) uarg)
+int compat_kexec_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) uarg)
 {
     return do_kexec_op_internal(op, uarg, 1);
 }
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/common/memory.c
--- a/xen/common/memory.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/common/memory.c	Wed Oct 17 16:43:53 2012 +0100
@@ -277,7 +277,7 @@ static void decrease_reservation(struct 
     a->nr_done = i;
 }
 
-static long memory_exchange(XEN_GUEST_HANDLE(xen_memory_exchange_t) arg)
+static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_memory_exchange_t) arg)
 {
     struct xen_memory_exchange exch;
     PAGE_LIST_HEAD(in_chunk_list);
@@ -517,7 +517,7 @@ static long memory_exchange(XEN_GUEST_HA
     return rc;
 }
 
-long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE(void) arg)
+long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     struct domain *d;
     int rc, op;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/common/schedule.c
--- a/xen/common/schedule.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/common/schedule.c	Wed Oct 17 16:43:53 2012 +0100
@@ -836,7 +836,7 @@ typedef long ret_t;
 
 #endif /* !COMPAT */
 
-ret_t do_sched_op(int cmd, XEN_GUEST_HANDLE(void) arg)
+ret_t do_sched_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     ret_t ret = 0;
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/common/sysctl.c
--- a/xen/common/sysctl.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/common/sysctl.c	Wed Oct 17 16:43:53 2012 +0100
@@ -27,7 +27,7 @@
 #include <xsm/xsm.h>
 #include <xen/pmstat.h>
 
-long do_sysctl(XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl)
+long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 {
     long ret = 0;
     struct xen_sysctl curop, *op = &curop;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/common/tmem.c
--- a/xen/common/tmem.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/common/tmem.c	Wed Oct 17 16:43:53 2012 +0100
@@ -1444,7 +1444,7 @@ static inline void tmem_ensure_avail_pag
 /************ TMEM CORE OPERATIONS ************************************/
 
 static NOINLINE int do_tmem_put_compress(pgp_t *pgp, tmem_cli_mfn_t cmfn,
-                                         tmem_cli_va_t clibuf)
+                                         tmem_cli_va_param_t clibuf)
 {
     void *dst, *p;
     size_t size;
@@ -1488,7 +1488,7 @@ out:
 
 static NOINLINE int do_tmem_dup_put(pgp_t *pgp, tmem_cli_mfn_t cmfn,
        pagesize_t tmem_offset, pagesize_t pfn_offset, pagesize_t len,
-       tmem_cli_va_t clibuf)
+       tmem_cli_va_param_t clibuf)
 {
     pool_t *pool;
     obj_t *obj;
@@ -1579,7 +1579,7 @@ cleanup:
 static NOINLINE int do_tmem_put(pool_t *pool,
               OID *oidp, uint32_t index,
               tmem_cli_mfn_t cmfn, pagesize_t tmem_offset,
-              pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t clibuf)
+              pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_param_t clibuf)
 {
     obj_t *obj = NULL, *objfound = NULL, *objnew = NULL;
     pgp_t *pgp = NULL, *pgpdel = NULL;
@@ -1722,7 +1722,7 @@ free:
 
 static NOINLINE int do_tmem_get(pool_t *pool, OID *oidp, uint32_t index,
               tmem_cli_mfn_t cmfn, pagesize_t tmem_offset,
-              pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t clibuf)
+              pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_param_t clibuf)
 {
     obj_t *obj;
     pgp_t *pgp;
@@ -2066,8 +2066,8 @@ static int tmemc_flush_mem(cli_id_t cli_
  */
 #define BSIZE 1024
 
-static int tmemc_list_client(client_t *c, tmem_cli_va_t buf, int off, 
-                             uint32_t len, bool_t use_long)
+static int tmemc_list_client(client_t *c, tmem_cli_va_param_t buf,
+                             int off, uint32_t len, bool_t use_long)
 {
     char info[BSIZE];
     int i, n = 0, sum = 0;
@@ -2119,7 +2119,7 @@ static int tmemc_list_client(client_t *c
     return sum;
 }
 
-static int tmemc_list_shared(tmem_cli_va_t buf, int off, uint32_t len,
+static int tmemc_list_shared(tmem_cli_va_param_t buf, int off, uint32_t len,
                               bool_t use_long)
 {
     char info[BSIZE];
@@ -2159,8 +2159,8 @@ static int tmemc_list_shared(tmem_cli_va
 }
 
 #ifdef TMEM_PERF
-static int tmemc_list_global_perf(tmem_cli_va_t buf, int off, uint32_t len,
-                              bool_t use_long)
+static int tmemc_list_global_perf(tmem_cli_va_param_t buf, int off,
+                                  uint32_t len, bool_t use_long)
 {
     char info[BSIZE];
     int n = 0, sum = 0;
@@ -2194,7 +2194,7 @@ static int tmemc_list_global_perf(tmem_c
 #define tmemc_list_global_perf(_buf,_off,_len,_use) (0)
 #endif
 
-static int tmemc_list_global(tmem_cli_va_t buf, int off, uint32_t len,
+static int tmemc_list_global(tmem_cli_va_param_t buf, int off, uint32_t len,
                               bool_t use_long)
 {
     char info[BSIZE];
@@ -2226,7 +2226,7 @@ static int tmemc_list_global(tmem_cli_va
     return sum;
 }
 
-static int tmemc_list(cli_id_t cli_id, tmem_cli_va_t buf, uint32_t len,
+static int tmemc_list(cli_id_t cli_id, tmem_cli_va_param_t buf, uint32_t len,
                                bool_t use_long)
 {
     client_t *client;
@@ -2338,7 +2338,7 @@ static NOINLINE int tmemc_shared_pool_au
 }
 
 static NOINLINE int tmemc_save_subop(int cli_id, uint32_t pool_id,
-                        uint32_t subop, tmem_cli_va_t buf, uint32_t arg1)
+                        uint32_t subop, tmem_cli_va_param_t buf, uint32_t arg1)
 {
     client_t *client = tmh_client_from_cli_id(cli_id);
     pool_t *pool = (client == NULL || pool_id >= MAX_POOLS_PER_DOMAIN)
@@ -2427,7 +2427,7 @@ static NOINLINE int tmemc_save_subop(int
 }
 
 static NOINLINE int tmemc_save_get_next_page(int cli_id, uint32_t pool_id,
-                        tmem_cli_va_t buf, uint32_t bufsize)
+                        tmem_cli_va_param_t buf, uint32_t bufsize)
 {
     client_t *client = tmh_client_from_cli_id(cli_id);
     pool_t *pool = (client == NULL || pool_id >= MAX_POOLS_PER_DOMAIN)
@@ -2479,7 +2479,7 @@ out:
     return ret;
 }
 
-static NOINLINE int tmemc_save_get_next_inv(int cli_id, tmem_cli_va_t buf,
+static NOINLINE int tmemc_save_get_next_inv(int cli_id, tmem_cli_va_param_t buf,
                         uint32_t bufsize)
 {
     client_t *client = tmh_client_from_cli_id(cli_id);
@@ -2522,7 +2522,7 @@ out:
 }
 
 static int tmemc_restore_put_page(int cli_id, uint32_t pool_id, OID *oidp,
-                      uint32_t index, tmem_cli_va_t buf, uint32_t bufsize)
+                      uint32_t index, tmem_cli_va_param_t buf, uint32_t bufsize)
 {
     client_t *client = tmh_client_from_cli_id(cli_id);
     pool_t *pool = (client == NULL || pool_id >= MAX_POOLS_PER_DOMAIN)
@@ -2566,7 +2566,8 @@ static NOINLINE int do_tmem_control(stru
         ret = tmemc_flush_mem(op->u.ctrl.cli_id,op->u.ctrl.arg1);
         break;
     case TMEMC_LIST:
-        ret = tmemc_list(op->u.ctrl.cli_id,op->u.ctrl.buf,
+        ret = tmemc_list(op->u.ctrl.cli_id,
+                         guest_handle_cast(op->u.ctrl.buf, char),
                          op->u.ctrl.arg1,op->u.ctrl.arg2);
         break;
     case TMEMC_SET_WEIGHT:
@@ -2589,20 +2590,24 @@ static NOINLINE int do_tmem_control(stru
     case TMEMC_SAVE_GET_POOL_UUID:
     case TMEMC_SAVE_END:
         ret = tmemc_save_subop(op->u.ctrl.cli_id,pool_id,subop,
-                        op->u.ctrl.buf,op->u.ctrl.arg1);
+                               guest_handle_cast(op->u.ctrl.buf, char),
+                               op->u.ctrl.arg1);
         break;
     case TMEMC_SAVE_GET_NEXT_PAGE:
         ret = tmemc_save_get_next_page(op->u.ctrl.cli_id, pool_id,
-                                       op->u.ctrl.buf, op->u.ctrl.arg1);
+                                       guest_handle_cast(op->u.ctrl.buf, char),
+                                       op->u.ctrl.arg1);
         break;
     case TMEMC_SAVE_GET_NEXT_INV:
-        ret = tmemc_save_get_next_inv(op->u.ctrl.cli_id, op->u.ctrl.buf,
+        ret = tmemc_save_get_next_inv(op->u.ctrl.cli_id,
+                                      guest_handle_cast(op->u.ctrl.buf, char),
                                       op->u.ctrl.arg1);
         break;
     case TMEMC_RESTORE_PUT_PAGE:
         ret = tmemc_restore_put_page(op->u.ctrl.cli_id,pool_id,
                                      oidp, op->u.ctrl.arg2,
-                                     op->u.ctrl.buf, op->u.ctrl.arg1);
+                                     guest_handle_cast(op->u.ctrl.buf, char),
+                                     op->u.ctrl.arg1);
         break;
     case TMEMC_RESTORE_FLUSH_PAGE:
         ret = tmemc_restore_flush_page(op->u.ctrl.cli_id,pool_id,
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/common/tmem_xen.c
--- a/xen/common/tmem_xen.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/common/tmem_xen.c	Wed Oct 17 16:43:53 2012 +0100
@@ -146,7 +146,7 @@ static inline void cli_put_page(void *cl
 
 EXPORT int tmh_copy_from_client(pfp_t *pfp,
     tmem_cli_mfn_t cmfn, pagesize_t tmem_offset,
-    pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t clibuf)
+    pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_param_t clibuf)
 {
     unsigned long tmem_mfn, cli_mfn = 0;
     char *tmem_va, *cli_va = NULL;
@@ -194,7 +194,7 @@ EXPORT int tmh_copy_from_client(pfp_t *p
 }
 
 EXPORT int tmh_compress_from_client(tmem_cli_mfn_t cmfn,
-    void **out_va, size_t *out_len, tmem_cli_va_t clibuf)
+    void **out_va, size_t *out_len, tmem_cli_va_param_t clibuf)
 {
     int ret = 0;
     unsigned char *dmem = this_cpu(dstmem);
@@ -227,7 +227,7 @@ EXPORT int tmh_compress_from_client(tmem
 
 EXPORT int tmh_copy_to_client(tmem_cli_mfn_t cmfn, pfp_t *pfp,
     pagesize_t tmem_offset, pagesize_t pfn_offset, pagesize_t len,
-    tmem_cli_va_t clibuf)
+    tmem_cli_va_param_t clibuf)
 {
     unsigned long tmem_mfn, cli_mfn = 0;
     char *tmem_va, *cli_va = NULL;
@@ -265,7 +265,7 @@ EXPORT int tmh_copy_to_client(tmem_cli_m
 }
 
 EXPORT int tmh_decompress_to_client(tmem_cli_mfn_t cmfn, void *tmem_va,
-                                    size_t size, tmem_cli_va_t clibuf)
+                                    size_t size, tmem_cli_va_param_t clibuf)
 {
     unsigned long cli_mfn = 0;
     pfp_t *cli_pfp = NULL;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/common/xenoprof.c
--- a/xen/common/xenoprof.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/common/xenoprof.c	Wed Oct 17 16:43:53 2012 +0100
@@ -404,7 +404,7 @@ static int add_active_list(domid_t domid
     return 0;
 }
 
-static int add_passive_list(XEN_GUEST_HANDLE(void) arg)
+static int add_passive_list(XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     struct xenoprof_passive passive;
     struct domain *d;
@@ -585,7 +585,7 @@ void xenoprof_log_event(struct vcpu *vcp
 
 
 
-static int xenoprof_op_init(XEN_GUEST_HANDLE(void) arg)
+static int xenoprof_op_init(XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     struct domain *d = current->domain;
     struct xenoprof_init xenoprof_init;
@@ -611,7 +611,7 @@ static int xenoprof_op_init(XEN_GUEST_HA
 
 #endif /* !COMPAT */
 
-static int xenoprof_op_get_buffer(XEN_GUEST_HANDLE(void) arg)
+static int xenoprof_op_get_buffer(XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     struct xenoprof_get_buffer xenoprof_get_buffer;
     struct domain *d = current->domain;
@@ -662,7 +662,7 @@ static int xenoprof_op_get_buffer(XEN_GU
                       || (op == XENOPROF_disable_virq)  \
                       || (op == XENOPROF_get_buffer))
  
-ret_t do_xenoprof_op(int op, XEN_GUEST_HANDLE(void) arg)
+ret_t do_xenoprof_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     int ret = 0;
     
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/drivers/acpi/pmstat.c
--- a/xen/drivers/acpi/pmstat.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/drivers/acpi/pmstat.c	Wed Oct 17 16:43:53 2012 +0100
@@ -496,7 +496,7 @@ int do_pm_op(struct xen_sysctl_pm_op *op
     return ret;
 }
 
-int acpi_set_pdc_bits(u32 acpi_id, XEN_GUEST_HANDLE(uint32) pdc)
+int acpi_set_pdc_bits(u32 acpi_id, XEN_GUEST_HANDLE_PARAM(uint32) pdc)
 {
     u32 bits[3];
     int ret;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/drivers/char/console.c
--- a/xen/drivers/char/console.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/drivers/char/console.c	Wed Oct 17 16:43:53 2012 +0100
@@ -182,7 +182,7 @@ static void putchar_console_ring(int c)
 
 long read_console_ring(struct xen_sysctl_readconsole *op)
 {
-    XEN_GUEST_HANDLE(char) str;
+    XEN_GUEST_HANDLE_PARAM(char) str;
     uint32_t idx, len, max, sofar, c;
 
     str   = guest_handle_cast(op->buffer, char),
@@ -363,7 +363,7 @@ static void notify_dom0_con_ring(unsigne
 static DECLARE_SOFTIRQ_TASKLET(notify_dom0_con_ring_tasklet,
                                notify_dom0_con_ring, 0);
 
-static long guest_console_write(XEN_GUEST_HANDLE(char) buffer, int count)
+static long guest_console_write(XEN_GUEST_HANDLE_PARAM(char) buffer, int count)
 {
     char kbuf[128], *kptr;
     int kcount;
@@ -401,7 +401,7 @@ static long guest_console_write(XEN_GUES
     return 0;
 }
 
-long do_console_io(int cmd, int count, XEN_GUEST_HANDLE(char) buffer)
+long do_console_io(int cmd, int count, XEN_GUEST_HANDLE_PARAM(char) buffer)
 {
     long rc;
     unsigned int idx, len;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/drivers/passthrough/iommu.c	Wed Oct 17 16:43:53 2012 +0100
@@ -527,7 +527,7 @@ void iommu_crash_shutdown(void)
 
 int iommu_do_domctl(
     struct xen_domctl *domctl,
-    XEN_GUEST_HANDLE(xen_domctl_t) u_domctl)
+    XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
     struct domain *d;
     u16 seg;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/include/asm-arm/hypercall.h
--- a/xen/include/asm-arm/hypercall.h	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/include/asm-arm/hypercall.h	Wed Oct 17 16:43:53 2012 +0100
@@ -2,7 +2,7 @@
 #define __ASM_ARM_HYPERCALL_H__
 
 #include <public/domctl.h> /* for arch_do_domctl */
-int do_physdev_op(int cmd, XEN_GUEST_HANDLE(void) arg);
+int do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg);
 
 #endif /* __ASM_ARM_HYPERCALL_H__ */
 /*
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/include/asm-arm/mm.h
--- a/xen/include/asm-arm/mm.h	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/include/asm-arm/mm.h	Wed Oct 17 16:43:53 2012 +0100
@@ -267,7 +267,7 @@ static inline int relinquish_shared_page
 
 
 /* Arch-specific portion of memory_op hypercall. */
-long arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg);
+long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg);
 
 int steal_page(
     struct domain *d, struct page_info *page, unsigned int memflags);
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/include/asm-x86/hap.h
--- a/xen/include/asm-x86/hap.h	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/include/asm-x86/hap.h	Wed Oct 17 16:43:53 2012 +0100
@@ -51,7 +51,7 @@ hap_unmap_domain_page(void *p)
 /************************************************/
 void  hap_domain_init(struct domain *d);
 int   hap_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
-                 XEN_GUEST_HANDLE(void) u_domctl);
+                 XEN_GUEST_HANDLE_PARAM(void) u_domctl);
 int   hap_enable(struct domain *d, u32 mode);
 void  hap_final_teardown(struct domain *d);
 void  hap_teardown(struct domain *d);
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/include/asm-x86/hypercall.h
--- a/xen/include/asm-x86/hypercall.h	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/include/asm-x86/hypercall.h	Wed Oct 17 16:43:53 2012 +0100
@@ -18,22 +18,22 @@
 
 extern long
 do_event_channel_op_compat(
-    XEN_GUEST_HANDLE(evtchn_op_t) uop);
+    XEN_GUEST_HANDLE_PARAM(evtchn_op_t) uop);
 
 extern long
 do_set_trap_table(
-    XEN_GUEST_HANDLE(const_trap_info_t) traps);
+    XEN_GUEST_HANDLE_PARAM(const_trap_info_t) traps);
 
 extern long
 do_mmu_update(
-    XEN_GUEST_HANDLE(mmu_update_t) ureqs,
+    XEN_GUEST_HANDLE_PARAM(mmu_update_t) ureqs,
     unsigned int count,
-    XEN_GUEST_HANDLE(uint) pdone,
+    XEN_GUEST_HANDLE_PARAM(uint) pdone,
     unsigned int foreigndom);
 
 extern long
 do_set_gdt(
-    XEN_GUEST_HANDLE(ulong) frame_list,
+    XEN_GUEST_HANDLE_PARAM(ulong) frame_list,
     unsigned int entries);
 
 extern long
@@ -60,7 +60,7 @@ do_update_descriptor(
     u64 desc);
 
 extern long
-do_mca(XEN_GUEST_HANDLE(xen_mc_t) u_xen_mc);
+do_mca(XEN_GUEST_HANDLE_PARAM(xen_mc_t) u_xen_mc);
 
 extern long
 do_update_va_mapping(
@@ -70,7 +70,7 @@ do_update_va_mapping(
 
 extern long
 do_physdev_op(
-    int cmd, XEN_GUEST_HANDLE(void) arg);
+    int cmd, XEN_GUEST_HANDLE_PARAM(void) arg);
 
 extern long
 do_update_va_mapping_otherdomain(
@@ -81,9 +81,9 @@ do_update_va_mapping_otherdomain(
 
 extern long
 do_mmuext_op(
-    XEN_GUEST_HANDLE(mmuext_op_t) uops,
+    XEN_GUEST_HANDLE_PARAM(mmuext_op_t) uops,
     unsigned int count,
-    XEN_GUEST_HANDLE(uint) pdone,
+    XEN_GUEST_HANDLE_PARAM(uint) pdone,
     unsigned int foreigndom);
 
 extern unsigned long
@@ -104,10 +104,10 @@ do_set_segment_base(
 extern int
 compat_physdev_op(
     int cmd,
-    XEN_GUEST_HANDLE(void) arg);
+    XEN_GUEST_HANDLE_PARAM(void) arg);
 
 extern int
 arch_compat_vcpu_op(
-    int cmd, struct vcpu *v, XEN_GUEST_HANDLE(void) arg);
+    int cmd, struct vcpu *v, XEN_GUEST_HANDLE_PARAM(void) arg);
 
 #endif /* __ASM_X86_HYPERCALL_H__ */
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/include/asm-x86/mem_event.h
--- a/xen/include/asm-x86/mem_event.h	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/include/asm-x86/mem_event.h	Wed Oct 17 16:43:53 2012 +0100
@@ -65,7 +65,7 @@ int mem_event_get_response(struct domain
 struct domain *get_mem_event_op_target(uint32_t domain, int *rc);
 int do_mem_event_op(int op, uint32_t domain, void *arg);
 int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec,
-                     XEN_GUEST_HANDLE(void) u_domctl);
+                     XEN_GUEST_HANDLE_PARAM(void) u_domctl);
 
 #endif /* __MEM_EVENT_H__ */
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/include/asm-x86/mm.h
--- a/xen/include/asm-x86/mm.h	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/include/asm-x86/mm.h	Wed Oct 17 16:43:53 2012 +0100
@@ -555,10 +555,10 @@ void *do_page_walk(struct vcpu *v, unsig
 int __sync_local_execstate(void);
 
 /* Arch-specific portion of memory_op hypercall. */
-long arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg);
-long subarch_memory_op(int op, XEN_GUEST_HANDLE(void) arg);
-int compat_arch_memory_op(int op, XEN_GUEST_HANDLE(void));
-int compat_subarch_memory_op(int op, XEN_GUEST_HANDLE(void));
+long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg);
+long subarch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg);
+int compat_arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void));
+int compat_subarch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void));
 
 int steal_page(
     struct domain *d, struct page_info *page, unsigned int memflags);
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/include/asm-x86/paging.h
--- a/xen/include/asm-x86/paging.h	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/include/asm-x86/paging.h	Wed Oct 17 16:43:53 2012 +0100
@@ -207,7 +207,7 @@ int paging_domain_init(struct domain *d,
  * and disable ephemeral shadow modes (test mode and log-dirty mode) and
  * manipulate the log-dirty bitmap. */
 int paging_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
-                  XEN_GUEST_HANDLE(void) u_domctl);
+                  XEN_GUEST_HANDLE_PARAM(void) u_domctl);
 
 /* Call when destroying a domain */
 void paging_teardown(struct domain *d);
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/include/asm-x86/processor.h
--- a/xen/include/asm-x86/processor.h	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/include/asm-x86/processor.h	Wed Oct 17 16:43:53 2012 +0100
@@ -549,7 +549,7 @@ int rdmsr_hypervisor_regs(uint32_t idx, 
 int wrmsr_hypervisor_regs(uint32_t idx, uint64_t val);
 
 void microcode_set_module(unsigned int);
-int microcode_update(XEN_GUEST_HANDLE(const_void), unsigned long len);
+int microcode_update(XEN_GUEST_HANDLE_PARAM(const_void), unsigned long len);
 int microcode_resume_cpu(int cpu);
 
 #endif /* !__ASSEMBLY__ */
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/include/asm-x86/shadow.h
--- a/xen/include/asm-x86/shadow.h	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/include/asm-x86/shadow.h	Wed Oct 17 16:43:53 2012 +0100
@@ -73,7 +73,7 @@ int shadow_track_dirty_vram(struct domai
  * manipulate the log-dirty bitmap. */
 int shadow_domctl(struct domain *d, 
                   xen_domctl_shadow_op_t *sc,
-                  XEN_GUEST_HANDLE(void) u_domctl);
+                  XEN_GUEST_HANDLE_PARAM(void) u_domctl);
 
 /* Call when destroying a domain */
 void shadow_teardown(struct domain *d);
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/include/asm-x86/xenoprof.h
--- a/xen/include/asm-x86/xenoprof.h	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/include/asm-x86/xenoprof.h	Wed Oct 17 16:43:53 2012 +0100
@@ -40,9 +40,9 @@ int xenoprof_arch_init(int *num_events, 
 #define xenoprof_arch_disable_virq()            nmi_disable_virq()
 #define xenoprof_arch_release_counters()        nmi_release_counters()
 
-int xenoprof_arch_counter(XEN_GUEST_HANDLE(void) arg);
-int compat_oprof_arch_counter(XEN_GUEST_HANDLE(void) arg);
-int xenoprof_arch_ibs_counter(XEN_GUEST_HANDLE(void) arg);
+int xenoprof_arch_counter(XEN_GUEST_HANDLE_PARAM(void) arg);
+int compat_oprof_arch_counter(XEN_GUEST_HANDLE_PARAM(void) arg);
+int xenoprof_arch_ibs_counter(XEN_GUEST_HANDLE_PARAM(void) arg);
 
 struct vcpu;
 struct cpu_user_regs;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/include/xen/acpi.h
--- a/xen/include/xen/acpi.h	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/include/xen/acpi.h	Wed Oct 17 16:43:53 2012 +0100
@@ -145,8 +145,8 @@ static inline unsigned int acpi_get_csta
 static inline void acpi_set_cstate_limit(unsigned int new_limit) { return; }
 #endif
 
-#ifdef XEN_GUEST_HANDLE
-int acpi_set_pdc_bits(u32 acpi_id, XEN_GUEST_HANDLE(uint32));
+#ifdef XEN_GUEST_HANDLE_PARAM
+int acpi_set_pdc_bits(u32 acpi_id, XEN_GUEST_HANDLE_PARAM(uint32));
 #endif
 int arch_acpi_set_pdc_bits(u32 acpi_id, u32 *, u32 mask);
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/include/xen/compat.h
--- a/xen/include/xen/compat.h	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/include/xen/compat.h	Wed Oct 17 16:43:53 2012 +0100
@@ -22,6 +22,9 @@
     __DEFINE_COMPAT_HANDLE(const_ ## name, const name)
 #define COMPAT_HANDLE(name)          __compat_handle_ ## name
 
+/* NB: it is assumed that if an arch uses the compat layer it does not
+ * distinguish handles from parameter handles. */
+#define COMPAT_HANDLE_PARAM(name)    __compat_handle_ ## name
 /* Is the compat handle a NULL reference? */
 #define compat_handle_is_null(hnd)        ((hnd).c == 0)
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/include/xen/hypercall.h
--- a/xen/include/xen/hypercall.h	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/include/xen/hypercall.h	Wed Oct 17 16:43:53 2012 +0100
@@ -29,29 +29,29 @@ do_sched_op_compat(
 extern long
 do_sched_op(
     int cmd,
-    XEN_GUEST_HANDLE(void) arg);
+    XEN_GUEST_HANDLE_PARAM(void) arg);
 
 extern long
 do_domctl(
-    XEN_GUEST_HANDLE(xen_domctl_t) u_domctl);
+    XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl);
 
 extern long
 arch_do_domctl(
     struct xen_domctl *domctl,
-    XEN_GUEST_HANDLE(xen_domctl_t) u_domctl);
+    XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl);
 
 extern long
 do_sysctl(
-    XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl);
+    XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl);
 
 extern long
 arch_do_sysctl(
     struct xen_sysctl *sysctl,
-    XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl);
+    XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl);
 
 extern long
 do_platform_op(
-    XEN_GUEST_HANDLE(xen_platform_op_t) u_xenpf_op);
+    XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op);
 
 /*
  * To allow safe resume of do_memory_op() after preemption, we need to know
@@ -64,11 +64,11 @@ do_platform_op(
 extern long
 do_memory_op(
     unsigned long cmd,
-    XEN_GUEST_HANDLE(void) arg);
+    XEN_GUEST_HANDLE_PARAM(void) arg);
 
 extern long
 do_multicall(
-    XEN_GUEST_HANDLE(multicall_entry_t) call_list,
+    XEN_GUEST_HANDLE_PARAM(multicall_entry_t) call_list,
     unsigned int nr_calls);
 
 extern long
@@ -77,23 +77,23 @@ do_set_timer_op(
 
 extern long
 do_event_channel_op(
-    int cmd, XEN_GUEST_HANDLE(void) arg);
+    int cmd, XEN_GUEST_HANDLE_PARAM(void) arg);
 
 extern long
 do_xen_version(
     int cmd,
-    XEN_GUEST_HANDLE(void) arg);
+    XEN_GUEST_HANDLE_PARAM(void) arg);
 
 extern long
 do_console_io(
     int cmd,
     int count,
-    XEN_GUEST_HANDLE(char) buffer);
+    XEN_GUEST_HANDLE_PARAM(char) buffer);
 
 extern long
 do_grant_table_op(
     unsigned int cmd,
-    XEN_GUEST_HANDLE(void) uop,
+    XEN_GUEST_HANDLE_PARAM(void) uop,
     unsigned int count);
 
 extern long
@@ -105,72 +105,72 @@ extern long
 do_vcpu_op(
     int cmd,
     int vcpuid,
-    XEN_GUEST_HANDLE(void) arg);
+    XEN_GUEST_HANDLE_PARAM(void) arg);
 
 struct vcpu;
 extern long
 arch_do_vcpu_op(int cmd,
     struct vcpu *v,
-    XEN_GUEST_HANDLE(void) arg);
+    XEN_GUEST_HANDLE_PARAM(void) arg);
 
 extern long
 do_nmi_op(
     unsigned int cmd,
-    XEN_GUEST_HANDLE(void) arg);
+    XEN_GUEST_HANDLE_PARAM(void) arg);
 
 extern long
 do_hvm_op(
     unsigned long op,
-    XEN_GUEST_HANDLE(void) arg);
+    XEN_GUEST_HANDLE_PARAM(void) arg);
 
 extern long
 do_kexec_op(
     unsigned long op,
     int arg1,
-    XEN_GUEST_HANDLE(void) arg);
+    XEN_GUEST_HANDLE_PARAM(void) arg);
 
 extern long
 do_xsm_op(
-    XEN_GUEST_HANDLE(xsm_op_t) u_xsm_op);
+    XEN_GUEST_HANDLE_PARAM(xsm_op_t) u_xsm_op);
 
 extern long
 do_tmem_op(
-    XEN_GUEST_HANDLE(tmem_op_t) uops);
+    XEN_GUEST_HANDLE_PARAM(tmem_op_t) uops);
 
 extern long
-do_xenoprof_op(int op, XEN_GUEST_HANDLE(void) arg);
+do_xenoprof_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg);
 
 #ifdef CONFIG_COMPAT
 
 extern int
 compat_memory_op(
     unsigned int cmd,
-    XEN_GUEST_HANDLE(void) arg);
+    XEN_GUEST_HANDLE_PARAM(void) arg);
 
 extern int
 compat_grant_table_op(
     unsigned int cmd,
-    XEN_GUEST_HANDLE(void) uop,
+    XEN_GUEST_HANDLE_PARAM(void) uop,
     unsigned int count);
 
 extern int
 compat_vcpu_op(
     int cmd,
     int vcpuid,
-    XEN_GUEST_HANDLE(void) arg);
+    XEN_GUEST_HANDLE_PARAM(void) arg);
 
 extern int
-compat_xenoprof_op(int op, XEN_GUEST_HANDLE(void) arg);
+compat_xenoprof_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg);
 
 extern int
 compat_xen_version(
     int cmd,
-    XEN_GUEST_HANDLE(void) arg);
+    XEN_GUEST_HANDLE_PARAM(void) arg);
 
 extern int
 compat_sched_op(
     int cmd,
-    XEN_GUEST_HANDLE(void) arg);
+    XEN_GUEST_HANDLE_PARAM(void) arg);
 
 extern int
 compat_set_timer_op(
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/include/xen/iommu.h
--- a/xen/include/xen/iommu.h	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/include/xen/iommu.h	Wed Oct 17 16:43:53 2012 +0100
@@ -130,7 +130,7 @@ void iommu_crash_shutdown(void);
 void iommu_set_dom0_mapping(struct domain *d);
 void iommu_share_p2m_table(struct domain *d);
 
-int iommu_do_domctl(struct xen_domctl *, XEN_GUEST_HANDLE(xen_domctl_t));
+int iommu_do_domctl(struct xen_domctl *, XEN_GUEST_HANDLE_PARAM(xen_domctl_t));
 
 void iommu_iotlb_flush(struct domain *d, unsigned long gfn, unsigned int page_count);
 void iommu_iotlb_flush_all(struct domain *d);
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/include/xen/tmem_xen.h
--- a/xen/include/xen/tmem_xen.h	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/include/xen/tmem_xen.h	Wed Oct 17 16:43:53 2012 +0100
@@ -430,7 +430,8 @@ static inline void tmh_tze_copy_from_pfp
 typedef XEN_GUEST_HANDLE(void) cli_mfn_t;
 typedef XEN_GUEST_HANDLE(char) cli_va_t;
 */
-typedef XEN_GUEST_HANDLE(tmem_op_t) tmem_cli_op_t;
+typedef XEN_GUEST_HANDLE_PARAM(tmem_op_t) tmem_cli_op_t;
+typedef XEN_GUEST_HANDLE_PARAM(char) tmem_cli_va_param_t;
 
 static inline int tmh_get_tmemop_from_client(tmem_op_t *op, tmem_cli_op_t uops)
 {
@@ -466,8 +467,9 @@ static inline int tmh_get_tmemop_from_cl
 
 #define tmh_cli_buf_null guest_handle_from_ptr(NULL, char)
 
-static inline void tmh_copy_to_client_buf_offset(tmem_cli_va_t clibuf, int off,
-                                           char *tmembuf, int len)
+static inline void tmh_copy_to_client_buf_offset(tmem_cli_va_param_t clibuf,
+						 int off,
+						 char *tmembuf, int len)
 {
     copy_to_guest_offset(clibuf,off,tmembuf,len);
 }
@@ -482,15 +484,17 @@ static inline void tmh_copy_to_client_bu
 #define tmh_cli_id_str "domid"
 #define tmh_client_str "domain"
 
-int tmh_decompress_to_client(tmem_cli_mfn_t, void *, size_t, tmem_cli_va_t);
+int tmh_decompress_to_client(tmem_cli_mfn_t, void *, size_t,
+			     tmem_cli_va_param_t);
 
-int tmh_compress_from_client(tmem_cli_mfn_t, void **, size_t *, tmem_cli_va_t);
+int tmh_compress_from_client(tmem_cli_mfn_t, void **, size_t *,
+			     tmem_cli_va_param_t);
 
 int tmh_copy_from_client(pfp_t *, tmem_cli_mfn_t, pagesize_t tmem_offset,
-    pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t);
+    pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_param_t);
 
 int tmh_copy_to_client(tmem_cli_mfn_t, pfp_t *, pagesize_t tmem_offset,
-    pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t);
+    pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_param_t);
 
 extern int tmh_copy_tze_to_client(tmem_cli_mfn_t cmfn, void *tmem_va, pagesize_t len);
 
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/include/xsm/xsm.h
--- a/xen/include/xsm/xsm.h	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/include/xsm/xsm.h	Wed Oct 17 16:43:53 2012 +0100
@@ -139,7 +139,7 @@ struct xsm_operations {
     int (*cpupool_op)(void);
     int (*sched_op)(void);
 
-    long (*__do_xsm_op) (XEN_GUEST_HANDLE(xsm_op_t) op);
+    long (*__do_xsm_op) (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op);
 
 #ifdef CONFIG_X86
     int (*shadow_control) (struct domain *d, uint32_t op);
@@ -585,7 +585,7 @@ static inline int xsm_sched_op(void)
     return xsm_call(sched_op());
 }
 
-static inline long __do_xsm_op (XEN_GUEST_HANDLE(xsm_op_t) op)
+static inline long __do_xsm_op (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
 {
 #ifdef XSM_ENABLE
     return xsm_ops->__do_xsm_op(op);
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/xsm/dummy.c
--- a/xen/xsm/dummy.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/xsm/dummy.c	Wed Oct 17 16:43:53 2012 +0100
@@ -380,7 +380,7 @@ static int dummy_sched_op (void)
     return 0;
 }
 
-static long dummy___do_xsm_op(XEN_GUEST_HANDLE(xsm_op_t) op)
+static long dummy___do_xsm_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
 {
     return -ENOSYS;
 }
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/xsm/flask/flask_op.c
--- a/xen/xsm/flask/flask_op.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/xsm/flask/flask_op.c	Wed Oct 17 16:43:53 2012 +0100
@@ -71,7 +71,7 @@ static int domain_has_security(struct do
                         perms, NULL);
 }
 
-static int flask_copyin_string(XEN_GUEST_HANDLE(char) u_buf, char **buf, uint32_t size)
+static int flask_copyin_string(XEN_GUEST_HANDLE_PARAM(char) u_buf, char **buf, uint32_t size)
 {
     char *tmp = xmalloc_bytes(size + 1);
     if ( !tmp )
@@ -618,7 +618,7 @@ static int flask_relabel_domain(struct x
     return rc;
 }
 
-long do_flask_op(XEN_GUEST_HANDLE(xsm_op_t) u_flask_op)
+long do_flask_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) u_flask_op)
 {
     xen_flask_op_t op;
     int rv;
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/xsm/flask/hooks.c
--- a/xen/xsm/flask/hooks.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/xsm/flask/hooks.c	Wed Oct 17 16:43:53 2012 +0100
@@ -1462,7 +1462,7 @@ static int flask_vcpuextstate (struct do
 }
 #endif
 
-long do_flask_op(XEN_GUEST_HANDLE(xsm_op_t) u_flask_op);
+long do_flask_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) u_flask_op);
 
 static struct xsm_operations flask_ops = {
     .security_domaininfo = flask_security_domaininfo,
diff -r 1eb4b2f7465f -r 9eafdcd5ff0b xen/xsm/xsm_core.c
--- a/xen/xsm/xsm_core.c	Wed Oct 17 16:43:51 2012 +0100
+++ b/xen/xsm/xsm_core.c	Wed Oct 17 16:43:53 2012 +0100
@@ -111,7 +111,7 @@ int unregister_xsm(struct xsm_operations
 
 #endif
 
-long do_xsm_op (XEN_GUEST_HANDLE(xsm_op_t) op)
+long do_xsm_op (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
 {
     return __do_xsm_op(op);
 }

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 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 1TPKmq-0008NZ-3I; Fri, 19 Oct 2012 22:11:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmo-0008LD-S2
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:22 +0000
Received: from [85.158.143.35:52141] by server-3.bemta-4.messagelabs.com id
	A8/C5-03544-A00D1805; Fri, 19 Oct 2012 22:11:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-21.messagelabs.com!1350684680!14703890!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.9 required=7.0 tests=SUBJ_HAS_UNIQ_ID
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30164 invoked from network); 19 Oct 2012 22:11:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmm-0005VU-21
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmm-0008Vo-0k
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:20 +0000
Message-Id: <E1TPKmm-0008Vo-0k@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] stubdom: fix rpmlint warning
	spurious-executable-perm
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1350549303 -3600
# Node ID 02064298ebcbfda7de999848b50d91b8e25f57b4
# Parent  25b2f53d25839ddfd9a81b97c7b8013a535013fa
stubdom: fix rpmlint warning spurious-executable-perm

[ 1758s] xen-tools.x86_64: E: spurious-executable-perm (Badness: 50) /usr/lib/xen/boot/xenstore-stubdom.gz
[ 1758s] The file is installed with executable permissions, but was identified as one
[ 1758s] that probably should not be executable.  Verify if the executable bits are
[ 1758s] desired, and remove if not. NOTE: example scripts should be packaged under
[ 1758s] %docdir/examples, which will avoid this warning.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 25b2f53d2583 -r 02064298ebcb stubdom/Makefile
--- a/stubdom/Makefile	Thu Oct 18 09:35:02 2012 +0100
+++ b/stubdom/Makefile	Thu Oct 18 09:35:03 2012 +0100
@@ -396,7 +396,7 @@ install-grub: pv-grub
 
 install-xenstore: xenstore-stubdom
 	$(INSTALL_DIR) "$(DESTDIR)/usr/lib/xen/boot"
-	$(INSTALL_PROG) mini-os-$(XEN_TARGET_ARCH)-xenstore/mini-os.gz "$(DESTDIR)/usr/lib/xen/boot/xenstore-stubdom.gz"
+	$(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-xenstore/mini-os.gz "$(DESTDIR)/usr/lib/xen/boot/xenstore-stubdom.gz"
 
 #######
 # clean

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 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 1TPKmq-0008NZ-3I; Fri, 19 Oct 2012 22:11:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmo-0008LD-S2
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:22 +0000
Received: from [85.158.143.35:52141] by server-3.bemta-4.messagelabs.com id
	A8/C5-03544-A00D1805; Fri, 19 Oct 2012 22:11:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-21.messagelabs.com!1350684680!14703890!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.9 required=7.0 tests=SUBJ_HAS_UNIQ_ID
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30164 invoked from network); 19 Oct 2012 22:11:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmm-0005VU-21
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmm-0008Vo-0k
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:20 +0000
Message-Id: <E1TPKmm-0008Vo-0k@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] stubdom: fix rpmlint warning
	spurious-executable-perm
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1350549303 -3600
# Node ID 02064298ebcbfda7de999848b50d91b8e25f57b4
# Parent  25b2f53d25839ddfd9a81b97c7b8013a535013fa
stubdom: fix rpmlint warning spurious-executable-perm

[ 1758s] xen-tools.x86_64: E: spurious-executable-perm (Badness: 50) /usr/lib/xen/boot/xenstore-stubdom.gz
[ 1758s] The file is installed with executable permissions, but was identified as one
[ 1758s] that probably should not be executable.  Verify if the executable bits are
[ 1758s] desired, and remove if not. NOTE: example scripts should be packaged under
[ 1758s] %docdir/examples, which will avoid this warning.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 25b2f53d2583 -r 02064298ebcb stubdom/Makefile
--- a/stubdom/Makefile	Thu Oct 18 09:35:02 2012 +0100
+++ b/stubdom/Makefile	Thu Oct 18 09:35:03 2012 +0100
@@ -396,7 +396,7 @@ install-grub: pv-grub
 
 install-xenstore: xenstore-stubdom
 	$(INSTALL_DIR) "$(DESTDIR)/usr/lib/xen/boot"
-	$(INSTALL_PROG) mini-os-$(XEN_TARGET_ARCH)-xenstore/mini-os.gz "$(DESTDIR)/usr/lib/xen/boot/xenstore-stubdom.gz"
+	$(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-xenstore/mini-os.gz "$(DESTDIR)/usr/lib/xen/boot/xenstore-stubdom.gz"
 
 #######
 # clean

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 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 1TPKmq-0008Np-6W; Fri, 19 Oct 2012 22:11:24 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmp-0008ID-5B
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:23 +0000
Received: from [85.158.137.99:21856] by server-9.bemta-3.messagelabs.com id
	19/F5-16841-A00D1805; Fri, 19 Oct 2012 22:11:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-217.messagelabs.com!1350684681!22294639!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.9 required=7.0 tests=SUBJ_HAS_UNIQ_ID, UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20700 invoked from network); 19 Oct 2012 22:11:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmn-0005Va-2v
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmn-0008WI-1T
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:21 +0000
Message-Id: <E1TPKmn-0008WI-1T@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] blktap: fix rpmlint warning
	spurious-executable-perm
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1350549304 -3600
# Node ID 3fbeb019d522e62ec02e5245f0784568513efc5c
# Parent  8cf26ace9ca0cda8aa5e16e9c9ece85931c15ed5
blktap: fix rpmlint warning spurious-executable-perm

[ 1758s] xen-devel.x86_64: E: spurious-executable-perm (Badness: 50) /usr/lib64/libblktap.a
[ 1758s] The file is installed with executable permissions, but was identified as one
[ 1758s] that probably should not be executable.  Verify if the executable bits are
[ 1758s] desired, and remove if not. NOTE: example scripts should be packaged under
[ 1758s] %docdir/examples, which will avoid this warning.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 8cf26ace9ca0 -r 3fbeb019d522 tools/blktap/lib/Makefile
--- a/tools/blktap/lib/Makefile	Thu Oct 18 09:35:03 2012 +0100
+++ b/tools/blktap/lib/Makefile	Thu Oct 18 09:35:04 2012 +0100
@@ -23,23 +23,25 @@ OBJS     = $(SRCS:.c=.o)
 OBJS_PIC = $(SRCS:.c=.opic)
 IBINS   :=
 
-LIB      = libblktap.a libblktap.so.$(MAJOR).$(MINOR)
+LIB      = libblktap.a
+LIB_SO   = libblktap.so.$(MAJOR).$(MINOR)
 
 .PHONY: all
-all: $(LIB)
+all: $(LIB) $(LIB_SO)
 
 .PHONY: install
 install: all
 	$(INSTALL_DIR) $(DESTDIR)$(LIBDIR)
 	$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)
-	$(INSTALL_PROG) $(LIB) $(DESTDIR)$(LIBDIR)
+	$(INSTALL_PROG) $(LIB_SO) $(DESTDIR)$(LIBDIR)
+	$(INSTALL_DATA) $(LIB) $(DESTDIR)$(LIBDIR)
 	ln -sf libblktap.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libblktap.so.$(MAJOR)
 	ln -sf libblktap.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libblktap.so
 	$(INSTALL_DATA) blktaplib.h $(DESTDIR)$(INCLUDEDIR)
 
 .PHONY: clean
 clean:
-	rm -rf *.a *.so* *.o *.opic *.rpm $(LIB) *~ $(DEPS) xen TAGS
+	rm -rf *.a *.so* *.o *.opic *.rpm $(LIB) $(LIB_SO) *~ $(DEPS) xen TAGS
 
 libblktap.so.$(MAJOR).$(MINOR): $(OBJS_PIC) 
 	$(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,$(SONAME) $(SHLIB_LDFLAGS) \

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 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 1TPKmq-0008Np-6W; Fri, 19 Oct 2012 22:11:24 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmp-0008ID-5B
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:23 +0000
Received: from [85.158.137.99:21856] by server-9.bemta-3.messagelabs.com id
	19/F5-16841-A00D1805; Fri, 19 Oct 2012 22:11:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-217.messagelabs.com!1350684681!22294639!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.9 required=7.0 tests=SUBJ_HAS_UNIQ_ID, UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20700 invoked from network); 19 Oct 2012 22:11:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmn-0005Va-2v
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmn-0008WI-1T
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:21 +0000
Message-Id: <E1TPKmn-0008WI-1T@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] blktap: fix rpmlint warning
	spurious-executable-perm
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1350549304 -3600
# Node ID 3fbeb019d522e62ec02e5245f0784568513efc5c
# Parent  8cf26ace9ca0cda8aa5e16e9c9ece85931c15ed5
blktap: fix rpmlint warning spurious-executable-perm

[ 1758s] xen-devel.x86_64: E: spurious-executable-perm (Badness: 50) /usr/lib64/libblktap.a
[ 1758s] The file is installed with executable permissions, but was identified as one
[ 1758s] that probably should not be executable.  Verify if the executable bits are
[ 1758s] desired, and remove if not. NOTE: example scripts should be packaged under
[ 1758s] %docdir/examples, which will avoid this warning.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 8cf26ace9ca0 -r 3fbeb019d522 tools/blktap/lib/Makefile
--- a/tools/blktap/lib/Makefile	Thu Oct 18 09:35:03 2012 +0100
+++ b/tools/blktap/lib/Makefile	Thu Oct 18 09:35:04 2012 +0100
@@ -23,23 +23,25 @@ OBJS     = $(SRCS:.c=.o)
 OBJS_PIC = $(SRCS:.c=.opic)
 IBINS   :=
 
-LIB      = libblktap.a libblktap.so.$(MAJOR).$(MINOR)
+LIB      = libblktap.a
+LIB_SO   = libblktap.so.$(MAJOR).$(MINOR)
 
 .PHONY: all
-all: $(LIB)
+all: $(LIB) $(LIB_SO)
 
 .PHONY: install
 install: all
 	$(INSTALL_DIR) $(DESTDIR)$(LIBDIR)
 	$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)
-	$(INSTALL_PROG) $(LIB) $(DESTDIR)$(LIBDIR)
+	$(INSTALL_PROG) $(LIB_SO) $(DESTDIR)$(LIBDIR)
+	$(INSTALL_DATA) $(LIB) $(DESTDIR)$(LIBDIR)
 	ln -sf libblktap.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libblktap.so.$(MAJOR)
 	ln -sf libblktap.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libblktap.so
 	$(INSTALL_DATA) blktaplib.h $(DESTDIR)$(INCLUDEDIR)
 
 .PHONY: clean
 clean:
-	rm -rf *.a *.so* *.o *.opic *.rpm $(LIB) *~ $(DEPS) xen TAGS
+	rm -rf *.a *.so* *.o *.opic *.rpm $(LIB) $(LIB_SO) *~ $(DEPS) xen TAGS
 
 libblktap.so.$(MAJOR).$(MINOR): $(OBJS_PIC) 
 	$(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,$(SONAME) $(SHLIB_LDFLAGS) \

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 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 1TPKmp-0008NA-SQ; Fri, 19 Oct 2012 22:11:23 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmn-0008Jg-Nu
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:22 +0000
Received: from [193.109.254.147:11125] by server-13.bemta-14.messagelabs.com
	id B6/63-21440-800D1805; Fri, 19 Oct 2012 22:11:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-27.messagelabs.com!1350684678!3498233!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17393 invoked from network); 19 Oct 2012 22:11:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmk-0005VL-Ff
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmk-0008V5-EO
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:18 +0000
Message-Id: <E1TPKmk-0008V5-EO@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hotplug/Linux: remove hotplug
	support, rely on udev instead
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1350549300 -3600
# Node ID 019ca95dfa34efc71b1707f785b5112573e7d02e
# Parent  33348baecf37df1146730c527e0f023465abb91e
hotplug/Linux: remove hotplug support, rely on udev instead

Hotplug has been replaced by udev since several years. Remove the
hotplug related files and install udev unconditionally.

This makes it possible to remove udev from rpm BuildRequires which
reduces the buildtime dependency chain. For openSuSE:Factory it was
done just now:
http://lists.opensuse.org/opensuse-buildservice/2012-10/msg00085.html

The patch by itself will have no practical impact unless someone
attempts to build and run a Xen dom0 on a really old base system. e.g.
circa SLES9/2007 or earlier

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 33348baecf37 -r 019ca95dfa34 Makefile
--- a/Makefile	Thu Oct 18 09:34:59 2012 +0100
+++ b/Makefile	Thu Oct 18 09:35:00 2012 +0100
@@ -223,7 +223,6 @@ uninstall:
 	$(MAKE) -C xen uninstall
 	rm -rf $(D)$(CONFIG_DIR)/init.d/xendomains $(D)$(CONFIG_DIR)/init.d/xend
 	rm -rf $(D)$(CONFIG_DIR)/init.d/xencommons $(D)$(CONFIG_DIR)/init.d/xen-watchdog
-	rm -rf $(D)$(CONFIG_DIR)/hotplug/xen-backend.agent
 	rm -f  $(D)$(CONFIG_DIR)/udev/rules.d/xen-backend.rules
 	rm -f  $(D)$(CONFIG_DIR)/udev/rules.d/xend.rules
 	rm -f  $(D)$(SYSCONFIG_DIR)/xendomains
diff -r 33348baecf37 -r 019ca95dfa34 README
--- a/README	Thu Oct 18 09:34:59 2012 +0100
+++ b/README	Thu Oct 18 09:35:00 2012 +0100
@@ -54,7 +54,7 @@ provided by your OS distributor:
     * pkg-config
     * bridge-utils package (/sbin/brctl)
     * iproute package (/sbin/ip)
-    * hotplug or udev
+    * udev
     * GNU bison and GNU flex
     * GNU gettext
     * 16-bit x86 assembler, loader and compiler (dev86 rpm or bin86 & bcc debs)
@@ -120,9 +120,9 @@ 4. To rebuild an existing tree without m
 
    make install and make dist differ in that make install does the
    right things for your local machine (installing the appropriate
-   version of hotplug or udev scripts, for example), but make dist
-   includes all versions of those scripts, so that you can copy the dist
-   directory to another machine and install from that distribution.
+   version of udev scripts, for example), but make dist includes all
+   versions of those scripts, so that you can copy the dist directory
+   to another machine and install from that distribution.
    
 Python Runtime Libraries
 ========================
diff -r 33348baecf37 -r 019ca95dfa34 install.sh
--- a/install.sh	Thu Oct 18 09:34:59 2012 +0100
+++ b/install.sh	Thu Oct 18 09:35:00 2012 +0100
@@ -27,20 +27,6 @@ tmp="`mktemp -d`"
 echo "Installing Xen from '$src' to '$dst'..."
 (cd $src; tar -cf - * ) | tar -C "$tmp" -xf -
 
-[ -x "$(which udevinfo)" ] && \
-  UDEV_VERSION=$(udevinfo -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/')
-
-[ -z "$UDEV_VERSION" -a -x /sbin/udevadm ] && \
-  UDEV_VERSION=$(/sbin/udevadm info -V | awk '{print $NF}')
-
-if [ -n "$UDEV_VERSION" ] && [ $UDEV_VERSION -ge 059 ]; then
-  echo " - installing for udev-based system"
-  rm -rf "$tmp/etc/hotplug"
-else
-  echo " - installing for hotplug-based system"
-  rm -rf "$tmp/etc/udev"
-fi
-
 echo " - modifying permissions"
 chmod -R a+rX "$tmp"
 
diff -r 33348baecf37 -r 019ca95dfa34 tools/hotplug/Linux/Makefile
--- a/tools/hotplug/Linux/Makefile	Thu Oct 18 09:34:59 2012 +0100
+++ b/tools/hotplug/Linux/Makefile	Thu Oct 18 09:35:00 2012 +0100
@@ -27,32 +27,9 @@ XEN_SCRIPT_DATA += xen-hotplug-common.sh
 XEN_SCRIPT_DATA += block-common.sh vtpm-common.sh vtpm-hotplug-common.sh
 XEN_SCRIPT_DATA += vtpm-migration.sh vtpm-impl
 
-XEN_HOTPLUG_DIR = $(CONFIG_DIR)/hotplug
-XEN_HOTPLUG_SCRIPTS = xen-backend.agent
-
-UDEVVER = 0
-ifeq ($(shell [ -x /sbin/udevadm ] && echo 1),1)
-UDEVVER = $(shell /sbin/udevadm info -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/' )
-endif
-ifeq ($(shell [ -x /usr/bin/udevinfo ] && echo 1),1)
-UDEVVER = $(shell /usr/bin/udevinfo -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/' )
-endif
-
 UDEV_RULES_DIR = $(CONFIG_DIR)/udev
 UDEV_RULES = xen-backend.rules xend.rules
 
-DI = $(if $(DISTDIR),$(shell readlink -f $(DISTDIR)),)
-DE = $(if $(DESTDIR),$(shell readlink -f $(DESTDIR)),)
-ifeq ($(findstring $(DI),$(DE)),$(DI))
-HOTPLUGS=install-hotplug install-udev
-else
-ifeq ($(shell [ $(UDEVVER) -ge 059 ] && echo 1),1)
-HOTPLUGS=install-udev
-else
-HOTPLUGS=install-hotplug
-endif
-endif
-
 .PHONY: all
 all:
 
@@ -60,7 +37,7 @@ all:
 build:
 
 .PHONY: install
-install: all install-initd install-scripts $(HOTPLUGS)
+install: all install-initd install-scripts install-udev
 
 # See docs/misc/distro_mapping.txt for INITD_DIR location
 .PHONY: install-initd
@@ -87,15 +64,6 @@ install-scripts:
 	    $(INSTALL_DATA) $$i $(DESTDIR)$(XEN_SCRIPT_DIR); \
 	done
 
-.PHONY: install-hotplug
-install-hotplug:
-	[ -d $(DESTDIR)$(XEN_HOTPLUG_DIR) ] || \
-		$(INSTALL_DIR) $(DESTDIR)$(XEN_HOTPLUG_DIR)
-	set -e; for i in $(XEN_HOTPLUG_SCRIPTS); \
-	    do \
-	    $(INSTALL_PROG) $$i $(DESTDIR)$(XEN_HOTPLUG_DIR); \
-	done
-
 .PHONY: install-udev
 install-udev:
 	[ -d $(DESTDIR)$(UDEV_RULES_DIR) ] || \
diff -r 33348baecf37 -r 019ca95dfa34 tools/hotplug/Linux/xen-backend.agent
--- a/tools/hotplug/Linux/xen-backend.agent	Thu Oct 18 09:34:59 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-#! /bin/bash
-
-PATH=/etc/xen/scripts:$PATH
-
-. /etc/xen/scripts/locking.sh
-
-claim_lock xenbus_hotplug_global
-
-case "$XENBUS_TYPE" in
-  tap)
-    /etc/xen/scripts/blktap "$ACTION"
-    ;;
-  vbd)
-    /etc/xen/scripts/block "$ACTION"
-    ;;
-  vtpm)
-    /etc/xen/scripts/vtpm "$ACTION"
-    ;;
-  vif)
-    [ -n "$script" ] && $script "$ACTION"
-    ;;
-  vscsi)
-    /etc/xen/scripts/vscsi "$ACTION"
-    ;;
-esac
-
-case "$ACTION" in
-  add)
-    ;;
-  remove)
-    /etc/xen/scripts/xen-hotplug-cleanup
-    ;;
-  online)
-    ;;
-  offline)
-    ;;
-esac
-
-release_lock xenbus_hotplug_global

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 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 1TPKmp-0008NA-SQ; Fri, 19 Oct 2012 22:11:23 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmn-0008Jg-Nu
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:22 +0000
Received: from [193.109.254.147:11125] by server-13.bemta-14.messagelabs.com
	id B6/63-21440-800D1805; Fri, 19 Oct 2012 22:11:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-27.messagelabs.com!1350684678!3498233!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17393 invoked from network); 19 Oct 2012 22:11:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmk-0005VL-Ff
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmk-0008V5-EO
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:18 +0000
Message-Id: <E1TPKmk-0008V5-EO@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hotplug/Linux: remove hotplug
	support, rely on udev instead
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1350549300 -3600
# Node ID 019ca95dfa34efc71b1707f785b5112573e7d02e
# Parent  33348baecf37df1146730c527e0f023465abb91e
hotplug/Linux: remove hotplug support, rely on udev instead

Hotplug has been replaced by udev since several years. Remove the
hotplug related files and install udev unconditionally.

This makes it possible to remove udev from rpm BuildRequires which
reduces the buildtime dependency chain. For openSuSE:Factory it was
done just now:
http://lists.opensuse.org/opensuse-buildservice/2012-10/msg00085.html

The patch by itself will have no practical impact unless someone
attempts to build and run a Xen dom0 on a really old base system. e.g.
circa SLES9/2007 or earlier

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 33348baecf37 -r 019ca95dfa34 Makefile
--- a/Makefile	Thu Oct 18 09:34:59 2012 +0100
+++ b/Makefile	Thu Oct 18 09:35:00 2012 +0100
@@ -223,7 +223,6 @@ uninstall:
 	$(MAKE) -C xen uninstall
 	rm -rf $(D)$(CONFIG_DIR)/init.d/xendomains $(D)$(CONFIG_DIR)/init.d/xend
 	rm -rf $(D)$(CONFIG_DIR)/init.d/xencommons $(D)$(CONFIG_DIR)/init.d/xen-watchdog
-	rm -rf $(D)$(CONFIG_DIR)/hotplug/xen-backend.agent
 	rm -f  $(D)$(CONFIG_DIR)/udev/rules.d/xen-backend.rules
 	rm -f  $(D)$(CONFIG_DIR)/udev/rules.d/xend.rules
 	rm -f  $(D)$(SYSCONFIG_DIR)/xendomains
diff -r 33348baecf37 -r 019ca95dfa34 README
--- a/README	Thu Oct 18 09:34:59 2012 +0100
+++ b/README	Thu Oct 18 09:35:00 2012 +0100
@@ -54,7 +54,7 @@ provided by your OS distributor:
     * pkg-config
     * bridge-utils package (/sbin/brctl)
     * iproute package (/sbin/ip)
-    * hotplug or udev
+    * udev
     * GNU bison and GNU flex
     * GNU gettext
     * 16-bit x86 assembler, loader and compiler (dev86 rpm or bin86 & bcc debs)
@@ -120,9 +120,9 @@ 4. To rebuild an existing tree without m
 
    make install and make dist differ in that make install does the
    right things for your local machine (installing the appropriate
-   version of hotplug or udev scripts, for example), but make dist
-   includes all versions of those scripts, so that you can copy the dist
-   directory to another machine and install from that distribution.
+   version of udev scripts, for example), but make dist includes all
+   versions of those scripts, so that you can copy the dist directory
+   to another machine and install from that distribution.
    
 Python Runtime Libraries
 ========================
diff -r 33348baecf37 -r 019ca95dfa34 install.sh
--- a/install.sh	Thu Oct 18 09:34:59 2012 +0100
+++ b/install.sh	Thu Oct 18 09:35:00 2012 +0100
@@ -27,20 +27,6 @@ tmp="`mktemp -d`"
 echo "Installing Xen from '$src' to '$dst'..."
 (cd $src; tar -cf - * ) | tar -C "$tmp" -xf -
 
-[ -x "$(which udevinfo)" ] && \
-  UDEV_VERSION=$(udevinfo -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/')
-
-[ -z "$UDEV_VERSION" -a -x /sbin/udevadm ] && \
-  UDEV_VERSION=$(/sbin/udevadm info -V | awk '{print $NF}')
-
-if [ -n "$UDEV_VERSION" ] && [ $UDEV_VERSION -ge 059 ]; then
-  echo " - installing for udev-based system"
-  rm -rf "$tmp/etc/hotplug"
-else
-  echo " - installing for hotplug-based system"
-  rm -rf "$tmp/etc/udev"
-fi
-
 echo " - modifying permissions"
 chmod -R a+rX "$tmp"
 
diff -r 33348baecf37 -r 019ca95dfa34 tools/hotplug/Linux/Makefile
--- a/tools/hotplug/Linux/Makefile	Thu Oct 18 09:34:59 2012 +0100
+++ b/tools/hotplug/Linux/Makefile	Thu Oct 18 09:35:00 2012 +0100
@@ -27,32 +27,9 @@ XEN_SCRIPT_DATA += xen-hotplug-common.sh
 XEN_SCRIPT_DATA += block-common.sh vtpm-common.sh vtpm-hotplug-common.sh
 XEN_SCRIPT_DATA += vtpm-migration.sh vtpm-impl
 
-XEN_HOTPLUG_DIR = $(CONFIG_DIR)/hotplug
-XEN_HOTPLUG_SCRIPTS = xen-backend.agent
-
-UDEVVER = 0
-ifeq ($(shell [ -x /sbin/udevadm ] && echo 1),1)
-UDEVVER = $(shell /sbin/udevadm info -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/' )
-endif
-ifeq ($(shell [ -x /usr/bin/udevinfo ] && echo 1),1)
-UDEVVER = $(shell /usr/bin/udevinfo -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/' )
-endif
-
 UDEV_RULES_DIR = $(CONFIG_DIR)/udev
 UDEV_RULES = xen-backend.rules xend.rules
 
-DI = $(if $(DISTDIR),$(shell readlink -f $(DISTDIR)),)
-DE = $(if $(DESTDIR),$(shell readlink -f $(DESTDIR)),)
-ifeq ($(findstring $(DI),$(DE)),$(DI))
-HOTPLUGS=install-hotplug install-udev
-else
-ifeq ($(shell [ $(UDEVVER) -ge 059 ] && echo 1),1)
-HOTPLUGS=install-udev
-else
-HOTPLUGS=install-hotplug
-endif
-endif
-
 .PHONY: all
 all:
 
@@ -60,7 +37,7 @@ all:
 build:
 
 .PHONY: install
-install: all install-initd install-scripts $(HOTPLUGS)
+install: all install-initd install-scripts install-udev
 
 # See docs/misc/distro_mapping.txt for INITD_DIR location
 .PHONY: install-initd
@@ -87,15 +64,6 @@ install-scripts:
 	    $(INSTALL_DATA) $$i $(DESTDIR)$(XEN_SCRIPT_DIR); \
 	done
 
-.PHONY: install-hotplug
-install-hotplug:
-	[ -d $(DESTDIR)$(XEN_HOTPLUG_DIR) ] || \
-		$(INSTALL_DIR) $(DESTDIR)$(XEN_HOTPLUG_DIR)
-	set -e; for i in $(XEN_HOTPLUG_SCRIPTS); \
-	    do \
-	    $(INSTALL_PROG) $$i $(DESTDIR)$(XEN_HOTPLUG_DIR); \
-	done
-
 .PHONY: install-udev
 install-udev:
 	[ -d $(DESTDIR)$(UDEV_RULES_DIR) ] || \
diff -r 33348baecf37 -r 019ca95dfa34 tools/hotplug/Linux/xen-backend.agent
--- a/tools/hotplug/Linux/xen-backend.agent	Thu Oct 18 09:34:59 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-#! /bin/bash
-
-PATH=/etc/xen/scripts:$PATH
-
-. /etc/xen/scripts/locking.sh
-
-claim_lock xenbus_hotplug_global
-
-case "$XENBUS_TYPE" in
-  tap)
-    /etc/xen/scripts/blktap "$ACTION"
-    ;;
-  vbd)
-    /etc/xen/scripts/block "$ACTION"
-    ;;
-  vtpm)
-    /etc/xen/scripts/vtpm "$ACTION"
-    ;;
-  vif)
-    [ -n "$script" ] && $script "$ACTION"
-    ;;
-  vscsi)
-    /etc/xen/scripts/vscsi "$ACTION"
-    ;;
-esac
-
-case "$ACTION" in
-  add)
-    ;;
-  remove)
-    /etc/xen/scripts/xen-hotplug-cleanup
-    ;;
-  online)
-    ;;
-  offline)
-    ;;
-esac
-
-release_lock xenbus_hotplug_global

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 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 1TPKmp-0008NH-Ul; Fri, 19 Oct 2012 22:11:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmo-0008K4-4I
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:22 +0000
Received: from [85.158.137.99:46439] by server-7.bemta-3.messagelabs.com id
	5A/FD-06991-900D1805; Fri, 19 Oct 2012 22:11:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-217.messagelabs.com!1350684679!17501868!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17741 invoked from network); 19 Oct 2012 22:11:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKml-0005VR-HF
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKml-0008VZ-G0
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:19 +0000
Message-Id: <E1TPKml-0008VZ-G0@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: ao: cope with fast ao
	completion with progess events
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1350549302 -3600
# Node ID 25b2f53d25839ddfd9a81b97c7b8013a535013fa
# Parent  b3b03536789abbf2c4b7d62377034c1f14c6340c
libxl: ao: cope with fast ao completion with progess events

There are two egcs in an ao initiator: the one in the AO_CREATE
function, and the one in libxl__ao_inprogress.  If synchronous ao
operation generates progress events and completes immediately, the
progress callbacks end up queued in the outer egc.  These callbacks
are currently only called after libxl__ao_inprogress has returned, and
keep the ao alive until they happen.  This is not good because the
principle is that a synchronous ao is not supposed to survive beyond
libxl__ao_inprogress's return.

The fix is to ensure that the callbacks queued in the outer egc are
called early enough that they don't preserve the ao.  This is
straightforward in the AO_INPROGRESS macro because AO_CREATE's egc is
not used inside that macro other than to destroy it.  All we have to
do is destroy it a bit sooner.

This involves unlocking and relocking the ctx since EGC_FREE expects
to be called with the lock released but libxl__ao_inprogress needs it
locked.  This hole in our lock tenure is fine - libxl__ao_inprogress
has such holes already.

It is still possible to use the CTX_LOCK macros for this unlock/lock
because the gc we are using is destroyed only afterwards by
libxl__ao_inprogress.

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


diff -r b3b03536789a -r 25b2f53d2583 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Thu Oct 18 09:35:01 2012 +0100
+++ b/tools/libxl/libxl_internal.h	Thu Oct 18 09:35:02 2012 +0100
@@ -1709,10 +1709,12 @@ _hidden void libxl__egc_cleanup(libxl__e
 
 #define AO_INPROGRESS ({                                        \
         libxl_ctx *ao__ctx = libxl__gc_owner(&ao->gc);          \
+        CTX_UNLOCK;                                             \
+        EGC_FREE;                                               \
+        CTX_LOCK;                                               \
         int ao__rc = libxl__ao_inprogress(ao,                   \
                                __FILE__, __LINE__, __func__);   \
         libxl__ctx_unlock(ao__ctx); /* gc is now invalid */     \
-        EGC_FREE;                                               \
         (ao__rc);                                               \
    })
 

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 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 1TPKmp-0008NH-Ul; Fri, 19 Oct 2012 22:11:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmo-0008K4-4I
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:22 +0000
Received: from [85.158.137.99:46439] by server-7.bemta-3.messagelabs.com id
	5A/FD-06991-900D1805; Fri, 19 Oct 2012 22:11:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-217.messagelabs.com!1350684679!17501868!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17741 invoked from network); 19 Oct 2012 22:11:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKml-0005VR-HF
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKml-0008VZ-G0
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:19 +0000
Message-Id: <E1TPKml-0008VZ-G0@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: ao: cope with fast ao
	completion with progess events
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1350549302 -3600
# Node ID 25b2f53d25839ddfd9a81b97c7b8013a535013fa
# Parent  b3b03536789abbf2c4b7d62377034c1f14c6340c
libxl: ao: cope with fast ao completion with progess events

There are two egcs in an ao initiator: the one in the AO_CREATE
function, and the one in libxl__ao_inprogress.  If synchronous ao
operation generates progress events and completes immediately, the
progress callbacks end up queued in the outer egc.  These callbacks
are currently only called after libxl__ao_inprogress has returned, and
keep the ao alive until they happen.  This is not good because the
principle is that a synchronous ao is not supposed to survive beyond
libxl__ao_inprogress's return.

The fix is to ensure that the callbacks queued in the outer egc are
called early enough that they don't preserve the ao.  This is
straightforward in the AO_INPROGRESS macro because AO_CREATE's egc is
not used inside that macro other than to destroy it.  All we have to
do is destroy it a bit sooner.

This involves unlocking and relocking the ctx since EGC_FREE expects
to be called with the lock released but libxl__ao_inprogress needs it
locked.  This hole in our lock tenure is fine - libxl__ao_inprogress
has such holes already.

It is still possible to use the CTX_LOCK macros for this unlock/lock
because the gc we are using is destroyed only afterwards by
libxl__ao_inprogress.

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


diff -r b3b03536789a -r 25b2f53d2583 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Thu Oct 18 09:35:01 2012 +0100
+++ b/tools/libxl/libxl_internal.h	Thu Oct 18 09:35:02 2012 +0100
@@ -1709,10 +1709,12 @@ _hidden void libxl__egc_cleanup(libxl__e
 
 #define AO_INPROGRESS ({                                        \
         libxl_ctx *ao__ctx = libxl__gc_owner(&ao->gc);          \
+        CTX_UNLOCK;                                             \
+        EGC_FREE;                                               \
+        CTX_LOCK;                                               \
         int ao__rc = libxl__ao_inprogress(ao,                   \
                                __FILE__, __LINE__, __func__);   \
         libxl__ctx_unlock(ao__ctx); /* gc is now invalid */     \
-        EGC_FREE;                                               \
         (ao__rc);                                               \
    })
 

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22: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 1TPKmp-0008N1-Pw; Fri, 19 Oct 2012 22:11:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmn-0008JX-Lu
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:21 +0000
Received: from [85.158.137.99:3509] by server-16.bemta-3.messagelabs.com id
	31/DC-16565-800D1805; Fri, 19 Oct 2012 22:11:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-217.messagelabs.com!1350684679!22186322!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31499 invoked from network); 19 Oct 2012 22:11:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKml-0005VO-2z
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmk-0008VK-V0
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:18 +0000
Message-Id: <E1TPKmk-0008VK-V0@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hotplug/Linux: close lockfd after
	lock attempt
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1350549301 -3600
# Node ID b3b03536789abbf2c4b7d62377034c1f14c6340c
# Parent  019ca95dfa34efc71b1707f785b5112573e7d02e
hotplug/Linux: close lockfd after lock attempt

When a HVM guest is shutdown some of the 'remove' events can not claim
the lock for some reason. Instead they try to grab the lock in a busy
loop, until udev reaps the xen-hotplug-cleanup helper.
After analyzing the resulting logfile its not obvious what the cause is.
The only explanation is that bash (?) gets confused if the same lockfd
is opened again and again. Closing it in each iteration seem to fix the
issue.

This was observed with sles11sp2 (bash 3.2) and 4.2 xend.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <Ian.campbell@citrix.com>
[ ijc -- added the comment ]
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 019ca95dfa34 -r b3b03536789a tools/hotplug/Linux/locking.sh
--- a/tools/hotplug/Linux/locking.sh	Thu Oct 18 09:35:00 2012 +0100
+++ b/tools/hotplug/Linux/locking.sh	Thu Oct 18 09:35:01 2012 +0100
@@ -59,6 +59,9 @@ claim_lock()
             print "y\n" if $fd_inum eq $file_inum;
                              ' "$_lockfile" )
         if [ x$rightfile = xy ]; then break; fi
+	# Some versions of bash appear to be buggy if the same
+	# $_lockfile is opened repeatedly. Close the current fd here.
+        eval "exec $_lockfd<&-"
     done
 }
 

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22: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 1TPKmp-0008N1-Pw; Fri, 19 Oct 2012 22:11:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmn-0008JX-Lu
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:21 +0000
Received: from [85.158.137.99:3509] by server-16.bemta-3.messagelabs.com id
	31/DC-16565-800D1805; Fri, 19 Oct 2012 22:11:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-217.messagelabs.com!1350684679!22186322!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31499 invoked from network); 19 Oct 2012 22:11:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKml-0005VO-2z
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmk-0008VK-V0
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:18 +0000
Message-Id: <E1TPKmk-0008VK-V0@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hotplug/Linux: close lockfd after
	lock attempt
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1350549301 -3600
# Node ID b3b03536789abbf2c4b7d62377034c1f14c6340c
# Parent  019ca95dfa34efc71b1707f785b5112573e7d02e
hotplug/Linux: close lockfd after lock attempt

When a HVM guest is shutdown some of the 'remove' events can not claim
the lock for some reason. Instead they try to grab the lock in a busy
loop, until udev reaps the xen-hotplug-cleanup helper.
After analyzing the resulting logfile its not obvious what the cause is.
The only explanation is that bash (?) gets confused if the same lockfd
is opened again and again. Closing it in each iteration seem to fix the
issue.

This was observed with sles11sp2 (bash 3.2) and 4.2 xend.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <Ian.campbell@citrix.com>
[ ijc -- added the comment ]
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 019ca95dfa34 -r b3b03536789a tools/hotplug/Linux/locking.sh
--- a/tools/hotplug/Linux/locking.sh	Thu Oct 18 09:35:00 2012 +0100
+++ b/tools/hotplug/Linux/locking.sh	Thu Oct 18 09:35:01 2012 +0100
@@ -59,6 +59,9 @@ claim_lock()
             print "y\n" if $fd_inum eq $file_inum;
                              ' "$_lockfile" )
         if [ x$rightfile = xy ]; then break; fi
+	# Some versions of bash appear to be buggy if the same
+	# $_lockfile is opened repeatedly. Close the current fd here.
+        eval "exec $_lockfd<&-"
     done
 }
 

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22: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 1TPKmr-0008QK-CR; Fri, 19 Oct 2012 22:11:25 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmq-0008Mw-4n
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:24 +0000
Received: from [193.109.254.147:25490] by server-10.bemta-14.messagelabs.com
	id 85/EB-12590-B00D1805; Fri, 19 Oct 2012 22:11:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1350684680!15309716!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.9 required=7.0 tests=SUBJ_HAS_UNIQ_ID
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26218 invoked from network); 19 Oct 2012 22:11:21 -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;
	19 Oct 2012 22:11:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmm-0005VX-Il
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmm-0008W3-HE
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:20 +0000
Message-Id: <E1TPKmm-0008W3-HE@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] blktap2/libvhd: fix rpmlint warning
	spurious-executable-perm
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1350549303 -3600
# Node ID 8cf26ace9ca0cda8aa5e16e9c9ece85931c15ed5
# Parent  02064298ebcbfda7de999848b50d91b8e25f57b4
blktap2/libvhd: fix rpmlint warning spurious-executable-perm

[ 1758s] xen-devel.x86_64: E: spurious-executable-perm (Badness: 50) /usr/lib64/libvhd.a
[ 1758s] The file is installed with executable permissions, but was identified as one
[ 1758s] that probably should not be executable.  Verify if the executable bits are
[ 1758s] desired, and remove if not. NOTE: example scripts should be packaged under
[ 1758s] %docdir/examples, which will avoid this warning.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 02064298ebcb -r 8cf26ace9ca0 tools/blktap2/vhd/lib/Makefile
--- a/tools/blktap2/vhd/lib/Makefile	Thu Oct 18 09:35:03 2012 +0100
+++ b/tools/blktap2/vhd/lib/Makefile	Thu Oct 18 09:35:03 2012 +0100
@@ -68,7 +68,7 @@ libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR
 
 install: all
 	$(INSTALL_DIR) -p $(DESTDIR)$(INST-DIR)
-	$(INSTALL_PROG) libvhd.a $(DESTDIR)$(INST-DIR)
+	$(INSTALL_DATA) libvhd.a $(DESTDIR)$(INST-DIR)
 	$(INSTALL_PROG) libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR) $(DESTDIR)$(INST-DIR)
 	ln -sf libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR) $(DESTDIR)$(INST-DIR)/libvhd.so.$(LIBVHD-MAJOR)
 	ln -sf libvhd.so.$(LIBVHD-MAJOR) $(DESTDIR)$(INST-DIR)/libvhd.so

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22: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 1TPKmr-0008QK-CR; Fri, 19 Oct 2012 22:11:25 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmq-0008Mw-4n
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:24 +0000
Received: from [193.109.254.147:25490] by server-10.bemta-14.messagelabs.com
	id 85/EB-12590-B00D1805; Fri, 19 Oct 2012 22:11:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1350684680!15309716!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.9 required=7.0 tests=SUBJ_HAS_UNIQ_ID
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26218 invoked from network); 19 Oct 2012 22:11:21 -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;
	19 Oct 2012 22:11:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmm-0005VX-Il
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmm-0008W3-HE
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:20 +0000
Message-Id: <E1TPKmm-0008W3-HE@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] blktap2/libvhd: fix rpmlint warning
	spurious-executable-perm
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1350549303 -3600
# Node ID 8cf26ace9ca0cda8aa5e16e9c9ece85931c15ed5
# Parent  02064298ebcbfda7de999848b50d91b8e25f57b4
blktap2/libvhd: fix rpmlint warning spurious-executable-perm

[ 1758s] xen-devel.x86_64: E: spurious-executable-perm (Badness: 50) /usr/lib64/libvhd.a
[ 1758s] The file is installed with executable permissions, but was identified as one
[ 1758s] that probably should not be executable.  Verify if the executable bits are
[ 1758s] desired, and remove if not. NOTE: example scripts should be packaged under
[ 1758s] %docdir/examples, which will avoid this warning.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 02064298ebcb -r 8cf26ace9ca0 tools/blktap2/vhd/lib/Makefile
--- a/tools/blktap2/vhd/lib/Makefile	Thu Oct 18 09:35:03 2012 +0100
+++ b/tools/blktap2/vhd/lib/Makefile	Thu Oct 18 09:35:03 2012 +0100
@@ -68,7 +68,7 @@ libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR
 
 install: all
 	$(INSTALL_DIR) -p $(DESTDIR)$(INST-DIR)
-	$(INSTALL_PROG) libvhd.a $(DESTDIR)$(INST-DIR)
+	$(INSTALL_DATA) libvhd.a $(DESTDIR)$(INST-DIR)
 	$(INSTALL_PROG) libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR) $(DESTDIR)$(INST-DIR)
 	ln -sf libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR) $(DESTDIR)$(INST-DIR)/libvhd.so.$(LIBVHD-MAJOR)
 	ln -sf libvhd.so.$(LIBVHD-MAJOR) $(DESTDIR)$(INST-DIR)/libvhd.so

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmr-0008QW-FP; Fri, 19 Oct 2012 22:11:25 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmq-0008NN-FJ
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:24 +0000
Received: from [193.109.254.147:11217] by server-7.bemta-14.messagelabs.com id
	23/56-24122-B00D1805; Fri, 19 Oct 2012 22:11:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1350684681!10508305!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11413 invoked from network); 19 Oct 2012 22:11:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmn-0005Vg-Jh
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmn-00004r-IT
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:21 +0000
Message-Id: <E1TPKmn-00004r-IT@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hotplug: install hotplugpath.sh as
	data 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

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1350549305 -3600
# Node ID fe9a0eb9aaaa5c52e2892fea14c77431362d6129
# Parent  3fbeb019d522e62ec02e5245f0784568513efc5c
hotplug: install hotplugpath.sh as data file

rpmlint complains a script helper which is only sourced:

[ 1875s] xen-tools.i586: W: script-without-shebang /etc/xen/scripts/hotplugpath.sh
[ 1875s] This text file has executable bits set or is located in a path dedicated for
[ 1875s] executables, but lacks a shebang and cannot thus be executed.  If the file is
[ 1875s] meant to be an executable script, add the shebang, otherwise remove the
[ 1875s] executable bits or move the file elsewhere.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 3fbeb019d522 -r fe9a0eb9aaaa tools/hotplug/common/Makefile
--- a/tools/hotplug/common/Makefile	Thu Oct 18 09:35:04 2012 +0100
+++ b/tools/hotplug/common/Makefile	Thu Oct 18 09:35:05 2012 +0100
@@ -6,8 +6,8 @@ HOTPLUGPATH="hotplugpath.sh"
 # OS-independent hotplug scripts go in this directory
 
 # Xen scripts to go there.
-XEN_SCRIPTS = $(HOTPLUGPATH)
-XEN_SCRIPT_DATA =
+XEN_SCRIPTS =
+XEN_SCRIPT_DATA = $(HOTPLUGPATH)
 
 genpath-target = $(call buildmakevars2file,$(HOTPLUGPATH))
 $(eval $(genpath-target))

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmr-0008QW-FP; Fri, 19 Oct 2012 22:11:25 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmq-0008NN-FJ
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:24 +0000
Received: from [193.109.254.147:11217] by server-7.bemta-14.messagelabs.com id
	23/56-24122-B00D1805; Fri, 19 Oct 2012 22:11:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1350684681!10508305!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11413 invoked from network); 19 Oct 2012 22:11:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmn-0005Vg-Jh
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmn-00004r-IT
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:21 +0000
Message-Id: <E1TPKmn-00004r-IT@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hotplug: install hotplugpath.sh as
	data 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

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1350549305 -3600
# Node ID fe9a0eb9aaaa5c52e2892fea14c77431362d6129
# Parent  3fbeb019d522e62ec02e5245f0784568513efc5c
hotplug: install hotplugpath.sh as data file

rpmlint complains a script helper which is only sourced:

[ 1875s] xen-tools.i586: W: script-without-shebang /etc/xen/scripts/hotplugpath.sh
[ 1875s] This text file has executable bits set or is located in a path dedicated for
[ 1875s] executables, but lacks a shebang and cannot thus be executed.  If the file is
[ 1875s] meant to be an executable script, add the shebang, otherwise remove the
[ 1875s] executable bits or move the file elsewhere.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 3fbeb019d522 -r fe9a0eb9aaaa tools/hotplug/common/Makefile
--- a/tools/hotplug/common/Makefile	Thu Oct 18 09:35:04 2012 +0100
+++ b/tools/hotplug/common/Makefile	Thu Oct 18 09:35:05 2012 +0100
@@ -6,8 +6,8 @@ HOTPLUGPATH="hotplugpath.sh"
 # OS-independent hotplug scripts go in this directory
 
 # Xen scripts to go there.
-XEN_SCRIPTS = $(HOTPLUGPATH)
-XEN_SCRIPT_DATA =
+XEN_SCRIPTS =
+XEN_SCRIPT_DATA = $(HOTPLUGPATH)
 
 genpath-target = $(call buildmakevars2file,$(HOTPLUGPATH))
 $(eval $(genpath-target))

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmr-0008Q9-9H; Fri, 19 Oct 2012 22:11:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmq-0008ND-D3
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:24 +0000
Received: from [85.158.139.211:32419] by server-2.bemta-5.messagelabs.com id
	2B/C4-10520-B00D1805; Fri, 19 Oct 2012 22:11:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-206.messagelabs.com!1350684682!23054974!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23208 invoked from network); 19 Oct 2012 22:11:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmo-0005Vo-3r
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmo-000056-2c
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:22 +0000
Message-Id: <E1TPKmo-000056-2c@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] stubdom: install stubdompath.sh as
	data 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

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1350549306 -3600
# Node ID e32f4301f3845ea6764a0d6cff7529bdfedf35ec
# Parent  fe9a0eb9aaaa5c52e2892fea14c77431362d6129
stubdom: install stubdompath.sh as data file

rpmlint complains a script helper which is only sourced:

[ 1875s] xen-tools.i586: W: script-without-shebang /usr/lib/xen/bin/stubdompath.sh
[ 1875s] This text file has executable bits set or is located in a path dedicated for
[ 1875s] executables, but lacks a shebang and cannot thus be executed.  If the file is
[ 1875s] meant to be an executable script, add the shebang, otherwise remove the
[ 1875s] executable bits or move the file elsewhere.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r fe9a0eb9aaaa -r e32f4301f384 stubdom/Makefile
--- a/stubdom/Makefile	Thu Oct 18 09:35:05 2012 +0100
+++ b/stubdom/Makefile	Thu Oct 18 09:35:06 2012 +0100
@@ -386,7 +386,8 @@ install-readme:
 
 install-ioemu: ioemu-stubdom
 	$(INSTALL_DIR) "$(DESTDIR)$(LIBEXEC)"
-	$(INSTALL_PROG) stubdompath.sh stubdom-dm "$(DESTDIR)$(LIBEXEC)"
+	$(INSTALL_PROG) stubdom-dm "$(DESTDIR)$(LIBEXEC)"
+	$(INSTALL_DATA) stubdompath.sh "$(DESTDIR)$(LIBEXEC)"
 	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
 	$(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-ioemu/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/ioemu-stubdom.gz"
 

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmr-0008Q9-9H; Fri, 19 Oct 2012 22:11:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmq-0008ND-D3
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:24 +0000
Received: from [85.158.139.211:32419] by server-2.bemta-5.messagelabs.com id
	2B/C4-10520-B00D1805; Fri, 19 Oct 2012 22:11:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-206.messagelabs.com!1350684682!23054974!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23208 invoked from network); 19 Oct 2012 22:11:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmo-0005Vo-3r
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmo-000056-2c
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:22 +0000
Message-Id: <E1TPKmo-000056-2c@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] stubdom: install stubdompath.sh as
	data 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

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1350549306 -3600
# Node ID e32f4301f3845ea6764a0d6cff7529bdfedf35ec
# Parent  fe9a0eb9aaaa5c52e2892fea14c77431362d6129
stubdom: install stubdompath.sh as data file

rpmlint complains a script helper which is only sourced:

[ 1875s] xen-tools.i586: W: script-without-shebang /usr/lib/xen/bin/stubdompath.sh
[ 1875s] This text file has executable bits set or is located in a path dedicated for
[ 1875s] executables, but lacks a shebang and cannot thus be executed.  If the file is
[ 1875s] meant to be an executable script, add the shebang, otherwise remove the
[ 1875s] executable bits or move the file elsewhere.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r fe9a0eb9aaaa -r e32f4301f384 stubdom/Makefile
--- a/stubdom/Makefile	Thu Oct 18 09:35:05 2012 +0100
+++ b/stubdom/Makefile	Thu Oct 18 09:35:06 2012 +0100
@@ -386,7 +386,8 @@ install-readme:
 
 install-ioemu: ioemu-stubdom
 	$(INSTALL_DIR) "$(DESTDIR)$(LIBEXEC)"
-	$(INSTALL_PROG) stubdompath.sh stubdom-dm "$(DESTDIR)$(LIBEXEC)"
+	$(INSTALL_PROG) stubdom-dm "$(DESTDIR)$(LIBEXEC)"
+	$(INSTALL_DATA) stubdompath.sh "$(DESTDIR)$(LIBEXEC)"
 	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
 	$(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-ioemu/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/ioemu-stubdom.gz"
 

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22: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 1TPKms-0008Sk-Qi; Fri, 19 Oct 2012 22:11:26 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmr-0008PQ-DC
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:25 +0000
Received: from [85.158.137.99:21875] by server-4.bemta-3.messagelabs.com id
	C7/87-01405-C00D1805; Fri, 19 Oct 2012 22:11:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-217.messagelabs.com!1350684682!22192108!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26110 invoked from network); 19 Oct 2012 22:11:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmo-0005W0-L5
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmo-00005L-Jm
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:22 +0000
Message-Id: <E1TPKmo-00005L-Jm@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hotplug/Linux: correct sysconfig tag
	in xendomains
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1350549307 -3600
# Node ID ba6b1db89ec8a67943fe114f1c732ba93a903e9b
# Parent  e32f4301f3845ea6764a0d6cff7529bdfedf35ec
hotplug/Linux: correct sysconfig tag in xendomains

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r e32f4301f384 -r ba6b1db89ec8 tools/hotplug/Linux/init.d/sysconfig.xendomains
--- a/tools/hotplug/Linux/init.d/sysconfig.xendomains	Thu Oct 18 09:35:06 2012 +0100
+++ b/tools/hotplug/Linux/init.d/sysconfig.xendomains	Thu Oct 18 09:35:07 2012 +0100
@@ -1,4 +1,4 @@
-## Path: System/xen
+## Path: System/Virtualization
 ## Description: xen domain start/stop on boot
 ## Type: string
 ## Default: 

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22: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 1TPKms-0008Sk-Qi; Fri, 19 Oct 2012 22:11:26 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmr-0008PQ-DC
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:25 +0000
Received: from [85.158.137.99:21875] by server-4.bemta-3.messagelabs.com id
	C7/87-01405-C00D1805; Fri, 19 Oct 2012 22:11:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-217.messagelabs.com!1350684682!22192108!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26110 invoked from network); 19 Oct 2012 22:11:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmo-0005W0-L5
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmo-00005L-Jm
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:22 +0000
Message-Id: <E1TPKmo-00005L-Jm@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hotplug/Linux: correct sysconfig tag
	in xendomains
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1350549307 -3600
# Node ID ba6b1db89ec8a67943fe114f1c732ba93a903e9b
# Parent  e32f4301f3845ea6764a0d6cff7529bdfedf35ec
hotplug/Linux: correct sysconfig tag in xendomains

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r e32f4301f384 -r ba6b1db89ec8 tools/hotplug/Linux/init.d/sysconfig.xendomains
--- a/tools/hotplug/Linux/init.d/sysconfig.xendomains	Thu Oct 18 09:35:06 2012 +0100
+++ b/tools/hotplug/Linux/init.d/sysconfig.xendomains	Thu Oct 18 09:35:07 2012 +0100
@@ -1,4 +1,4 @@
-## Path: System/xen
+## Path: System/Virtualization
 ## Description: xen domain start/stop on boot
 ## Type: string
 ## Default: 

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:28 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmu-0008V1-66; Fri, 19 Oct 2012 22:11:28 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKms-0008Rm-PJ
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:27 +0000
Received: from [193.109.254.147:30231] by server-2.bemta-14.messagelabs.com id
	76/00-19917-D00D1805; Fri, 19 Oct 2012 22:11:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1350684683!15309719!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26265 invoked from network); 19 Oct 2012 22:11:24 -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;
	19 Oct 2012 22:11:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmp-0005WG-5X
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmp-00005a-4F
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:23 +0000
Message-Id: <E1TPKmp-00005a-4F@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hotplug/Linux: install sysconfig
	files as data files
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1350549307 -3600
# Node ID 6239ace16749ae8f80a765d4b284ffec4153a05c
# Parent  ba6b1db89ec8a67943fe114f1c732ba93a903e9b
hotplug/Linux: install sysconfig files as data files

rpmlint complains about wrong permissions of config files:

[  455s] xen-tools.i586: W: script-without-shebang /var/adm/fillup-templates/sysconfig.xendomains
[  455s] xen-tools.i586: W: script-without-shebang /var/adm/fillup-templates/sysconfig.xencommons
[  455s] This text file has executable bits set or is located in a path dedicated for
[  455s] executables, but lacks a shebang and cannot thus be executed.  If the file is
[  455s] meant to be an executable script, add the shebang, otherwise remove the
[  455s] executable bits or move the file elsewhere.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r ba6b1db89ec8 -r 6239ace16749 tools/hotplug/Linux/Makefile
--- a/tools/hotplug/Linux/Makefile	Thu Oct 18 09:35:07 2012 +0100
+++ b/tools/hotplug/Linux/Makefile	Thu Oct 18 09:35:07 2012 +0100
@@ -46,9 +46,9 @@ install-initd:
 	[ -d $(DESTDIR)$(SYSCONFIG_DIR) ] || $(INSTALL_DIR) $(DESTDIR)$(SYSCONFIG_DIR)
 	$(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)$(INITD_DIR)
 	$(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)$(INITD_DIR)
-	$(INSTALL_PROG) $(XENDOMAINS_SYSCONFIG) $(DESTDIR)$(SYSCONFIG_DIR)/xendomains
+	$(INSTALL_DATA) $(XENDOMAINS_SYSCONFIG) $(DESTDIR)$(SYSCONFIG_DIR)/xendomains
 	$(INSTALL_PROG) $(XENCOMMONS_INITD) $(DESTDIR)$(INITD_DIR)
-	$(INSTALL_PROG) $(XENCOMMONS_SYSCONFIG) $(DESTDIR)$(SYSCONFIG_DIR)/xencommons
+	$(INSTALL_DATA) $(XENCOMMONS_SYSCONFIG) $(DESTDIR)$(SYSCONFIG_DIR)/xencommons
 	$(INSTALL_PROG) init.d/xen-watchdog $(DESTDIR)$(INITD_DIR)
 
 .PHONY: install-scripts

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:28 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmu-0008V1-66; Fri, 19 Oct 2012 22:11:28 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKms-0008Rm-PJ
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:27 +0000
Received: from [193.109.254.147:30231] by server-2.bemta-14.messagelabs.com id
	76/00-19917-D00D1805; Fri, 19 Oct 2012 22:11:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1350684683!15309719!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26265 invoked from network); 19 Oct 2012 22:11:24 -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;
	19 Oct 2012 22:11:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmp-0005WG-5X
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmp-00005a-4F
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:23 +0000
Message-Id: <E1TPKmp-00005a-4F@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hotplug/Linux: install sysconfig
	files as data files
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1350549307 -3600
# Node ID 6239ace16749ae8f80a765d4b284ffec4153a05c
# Parent  ba6b1db89ec8a67943fe114f1c732ba93a903e9b
hotplug/Linux: install sysconfig files as data files

rpmlint complains about wrong permissions of config files:

[  455s] xen-tools.i586: W: script-without-shebang /var/adm/fillup-templates/sysconfig.xendomains
[  455s] xen-tools.i586: W: script-without-shebang /var/adm/fillup-templates/sysconfig.xencommons
[  455s] This text file has executable bits set or is located in a path dedicated for
[  455s] executables, but lacks a shebang and cannot thus be executed.  If the file is
[  455s] meant to be an executable script, add the shebang, otherwise remove the
[  455s] executable bits or move the file elsewhere.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r ba6b1db89ec8 -r 6239ace16749 tools/hotplug/Linux/Makefile
--- a/tools/hotplug/Linux/Makefile	Thu Oct 18 09:35:07 2012 +0100
+++ b/tools/hotplug/Linux/Makefile	Thu Oct 18 09:35:07 2012 +0100
@@ -46,9 +46,9 @@ install-initd:
 	[ -d $(DESTDIR)$(SYSCONFIG_DIR) ] || $(INSTALL_DIR) $(DESTDIR)$(SYSCONFIG_DIR)
 	$(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)$(INITD_DIR)
 	$(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)$(INITD_DIR)
-	$(INSTALL_PROG) $(XENDOMAINS_SYSCONFIG) $(DESTDIR)$(SYSCONFIG_DIR)/xendomains
+	$(INSTALL_DATA) $(XENDOMAINS_SYSCONFIG) $(DESTDIR)$(SYSCONFIG_DIR)/xendomains
 	$(INSTALL_PROG) $(XENCOMMONS_INITD) $(DESTDIR)$(INITD_DIR)
-	$(INSTALL_PROG) $(XENCOMMONS_SYSCONFIG) $(DESTDIR)$(SYSCONFIG_DIR)/xencommons
+	$(INSTALL_DATA) $(XENCOMMONS_SYSCONFIG) $(DESTDIR)$(SYSCONFIG_DIR)/xencommons
 	$(INSTALL_PROG) init.d/xen-watchdog $(DESTDIR)$(INITD_DIR)
 
 .PHONY: install-scripts

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:28 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmu-0008Uo-3o; Fri, 19 Oct 2012 22:11:28 +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 1TPKms-0008Qy-Dh
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:26 +0000
Received: from [85.158.139.211:51920] by server-16.bemta-5.messagelabs.com id
	6F/10-09196-D00D1805; Fri, 19 Oct 2012 22:11:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-206.messagelabs.com!1350684683!22555375!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32327 invoked from network); 19 Oct 2012 22:11:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmp-0005WL-Lo
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmp-00005p-KZ
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:23 +0000
Message-Id: <E1TPKmp-00005p-KZ@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:23 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools: xend: fix wrong condition
	check for xml 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

# HG changeset patch
# User Joe Jin <joe.jin@oracle.com>
# Date 1350549308 -3600
# Node ID dd64a1bdbe3a2f141b729ee086016a3f40615daf
# Parent  6239ace16749ae8f80a765d4b284ffec4153a05c
tools: xend: fix wrong condition check for xml file

In commit e8d40584, it intended to check xml file size and when empty will
return, the condition should be "if os.path.getsize(xml_path) == 0" rather
then "if not os.path.getsize(xml_path) == 0".

Signed-off-by: Chuang Cao <chuang.cao@oracle.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 6239ace16749 -r dd64a1bdbe3a tools/python/xen/xend/XendStateStore.py
--- a/tools/python/xen/xend/XendStateStore.py	Thu Oct 18 09:35:07 2012 +0100
+++ b/tools/python/xen/xend/XendStateStore.py	Thu Oct 18 09:35:08 2012 +0100
@@ -101,7 +101,7 @@ class XendStateStore:
         if not os.path.exists(xml_path):
             return {}
 
-        if not os.path.getsize(xml_path) == 0:
+        if os.path.getsize(xml_path) == 0:
             return {}
 
         dom = minidom.parse(xml_path)

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:28 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmu-0008Uo-3o; Fri, 19 Oct 2012 22:11:28 +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 1TPKms-0008Qy-Dh
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:26 +0000
Received: from [85.158.139.211:51920] by server-16.bemta-5.messagelabs.com id
	6F/10-09196-D00D1805; Fri, 19 Oct 2012 22:11:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-206.messagelabs.com!1350684683!22555375!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32327 invoked from network); 19 Oct 2012 22:11:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmp-0005WL-Lo
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmp-00005p-KZ
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:23 +0000
Message-Id: <E1TPKmp-00005p-KZ@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:23 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools: xend: fix wrong condition
	check for xml 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

# HG changeset patch
# User Joe Jin <joe.jin@oracle.com>
# Date 1350549308 -3600
# Node ID dd64a1bdbe3a2f141b729ee086016a3f40615daf
# Parent  6239ace16749ae8f80a765d4b284ffec4153a05c
tools: xend: fix wrong condition check for xml file

In commit e8d40584, it intended to check xml file size and when empty will
return, the condition should be "if os.path.getsize(xml_path) == 0" rather
then "if not os.path.getsize(xml_path) == 0".

Signed-off-by: Chuang Cao <chuang.cao@oracle.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 6239ace16749 -r dd64a1bdbe3a tools/python/xen/xend/XendStateStore.py
--- a/tools/python/xen/xend/XendStateStore.py	Thu Oct 18 09:35:07 2012 +0100
+++ b/tools/python/xen/xend/XendStateStore.py	Thu Oct 18 09:35:08 2012 +0100
@@ -101,7 +101,7 @@ class XendStateStore:
         if not os.path.exists(xml_path):
             return {}
 
-        if not os.path.getsize(xml_path) == 0:
+        if os.path.getsize(xml_path) == 0:
             return {}
 
         dom = minidom.parse(xml_path)

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:28 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmu-0008Vm-GQ; Fri, 19 Oct 2012 22:11:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmt-0008TK-HZ
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:27 +0000
Received: from [85.158.137.99:21924] by server-3.bemta-3.messagelabs.com id
	97/F4-09368-E00D1805; Fri, 19 Oct 2012 22:11:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-217.messagelabs.com!1350684684!22263758!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32362 invoked from network); 19 Oct 2012 22:11:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmq-0005WQ-8J
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmq-000064-6h
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:24 +0000
Message-Id: <E1TPKmq-000064-6h@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:23 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: propagate user supplied
	values into event for_user field.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1350549309 -3600
# Node ID fb5cf014b38710d36ac937b9de978f49f1a05039
# Parent  dd64a1bdbe3a2f141b729ee086016a3f40615daf
libxl: propagate user supplied values into event for_user field.

This was ommited in the majority of cases. Add as a parameter to
libxl__event_new and the NEW_EVENT wrapper to help prevent it being
forgotten in the future.

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


diff -r dd64a1bdbe3a -r fb5cf014b387 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Thu Oct 18 09:35:08 2012 +0100
+++ b/tools/libxl/libxl.c	Thu Oct 18 09:35:09 2012 +0100
@@ -955,7 +955,7 @@ static void domain_death_occurred(libxl_
     libxl_evgen_domain_death *evg_next = LIBXL_TAILQ_NEXT(evg, entry);
     *evg_upd = evg_next;
 
-    libxl_event *ev = NEW_EVENT(egc, DOMAIN_DEATH, evg->domid);
+    libxl_event *ev = NEW_EVENT(egc, DOMAIN_DEATH, evg->domid, evg->user);
 
     libxl__event_occurred(egc, ev);
 
@@ -1041,8 +1041,9 @@ static void domain_death_xswatch_callbac
 
             if (!evg->shutdown_reported &&
                 (got->flags & XEN_DOMINF_shutdown)) {
-                libxl_event *ev = NEW_EVENT(egc, DOMAIN_SHUTDOWN, got->domain);
-                
+                libxl_event *ev = NEW_EVENT(egc, DOMAIN_SHUTDOWN,
+                                            got->domain, evg->user);
+
                 LIBXL__LOG(CTX, LIBXL__LOG_DEBUG, " shutdown reporting");
 
                 ev->u.domain_shutdown.shutdown_reason =
@@ -1141,7 +1142,7 @@ static void disk_eject_xswatch_callback(
         return;
     }
 
-    libxl_event *ev = NEW_EVENT(egc, DISK_EJECT, evg->domid);
+    libxl_event *ev = NEW_EVENT(egc, DISK_EJECT, evg->domid, evg->user);
     libxl_device_disk *disk = &ev->u.disk_eject.disk;
     
     backend = libxl__xs_read(gc, XBT_NULL,
diff -r dd64a1bdbe3a -r fb5cf014b387 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Oct 18 09:35:08 2012 +0100
+++ b/tools/libxl/libxl_create.c	Thu Oct 18 09:35:09 2012 +0100
@@ -705,7 +705,8 @@ static void domcreate_console_available(
                                         libxl__domain_create_state *dcs) {
     libxl__ao_progress_report(egc, dcs->ao, &dcs->aop_console_how,
                               NEW_EVENT(egc, DOMAIN_CREATE_CONSOLE_AVAILABLE,
-                                        dcs->guest_domid));
+                                        dcs->guest_domid,
+                                        dcs->aop_console_how.for_event));
 }
 
 static void domcreate_bootloader_done(libxl__egc *egc,
diff -r dd64a1bdbe3a -r fb5cf014b387 tools/libxl/libxl_event.c
--- a/tools/libxl/libxl_event.c	Thu Oct 18 09:35:08 2012 +0100
+++ b/tools/libxl/libxl_event.c	Thu Oct 18 09:35:09 2012 +0100
@@ -1157,7 +1157,8 @@ void libxl_event_free(libxl_ctx *ctx, li
 }
 
 libxl_event *libxl__event_new(libxl__egc *egc,
-                              libxl_event_type type, uint32_t domid)
+                              libxl_event_type type, uint32_t domid,
+                              libxl_ev_user for_user)
 {
     EGC_GC;
     libxl_event *ev;
@@ -1168,6 +1169,7 @@ libxl_event *libxl__event_new(libxl__egc
     libxl_event_init_type(ev, type);
 
     ev->domid = domid;
+    ev->for_user = for_user;
 
     return ev;
 }
@@ -1528,9 +1530,8 @@ void libxl__ao_complete_check_progress_r
         LIBXL_TAILQ_INSERT_TAIL(&egc->aos_for_callback, ao, entry_for_callback);
     } else {
         libxl_event *ev;
-        ev = NEW_EVENT(egc, OPERATION_COMPLETE, ao->domid);
+        ev = NEW_EVENT(egc, OPERATION_COMPLETE, ao->domid, ao->how.u.for_event);
         if (ev) {
-            ev->for_user = ao->how.u.for_event;
             ev->u.operation_complete.rc = ao->rc;
             libxl__event_occurred(egc, ev);
         }
@@ -1662,7 +1663,6 @@ void libxl__ao_progress_report(libxl__eg
         const libxl_asyncprogress_how *how, libxl_event *ev)
 {
     AO_GC;
-    ev->for_user = how->for_event;
     if (how->callback == dummy_asyncprogress_callback_ignore) {
         LOG(DEBUG,"ao %p: progress report: ignored",ao);
         libxl_event_free(CTX,ev);
diff -r dd64a1bdbe3a -r fb5cf014b387 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Thu Oct 18 09:35:08 2012 +0100
+++ b/tools/libxl/libxl_internal.h	Thu Oct 18 09:35:09 2012 +0100
@@ -783,13 +783,14 @@ _hidden void libxl__event_occurred(libxl
    * event should be suitable for passing to libxl_event_free. */
 
 _hidden libxl_event *libxl__event_new(libxl__egc*, libxl_event_type,
-                                      uint32_t domid);
+                                      uint32_t domid,
+                                      libxl_ev_user for_user);
   /* Convenience function.
    * Allocates a new libxl_event, fills in domid and type.
    * Cannot fail. */
 
-#define NEW_EVENT(egc, type, domid)                              \
-    libxl__event_new((egc), LIBXL_EVENT_TYPE_##type, (domid))
+#define NEW_EVENT(egc, type, domid, user)                        \
+    libxl__event_new((egc), LIBXL_EVENT_TYPE_##type, (domid), (user))
     /* Convenience macro. */
 
 /*

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:28 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmu-0008Vm-GQ; Fri, 19 Oct 2012 22:11:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmt-0008TK-HZ
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:27 +0000
Received: from [85.158.137.99:21924] by server-3.bemta-3.messagelabs.com id
	97/F4-09368-E00D1805; Fri, 19 Oct 2012 22:11:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-217.messagelabs.com!1350684684!22263758!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32362 invoked from network); 19 Oct 2012 22:11:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmq-0005WQ-8J
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmq-000064-6h
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:24 +0000
Message-Id: <E1TPKmq-000064-6h@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:23 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: propagate user supplied
	values into event for_user field.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1350549309 -3600
# Node ID fb5cf014b38710d36ac937b9de978f49f1a05039
# Parent  dd64a1bdbe3a2f141b729ee086016a3f40615daf
libxl: propagate user supplied values into event for_user field.

This was ommited in the majority of cases. Add as a parameter to
libxl__event_new and the NEW_EVENT wrapper to help prevent it being
forgotten in the future.

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


diff -r dd64a1bdbe3a -r fb5cf014b387 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Thu Oct 18 09:35:08 2012 +0100
+++ b/tools/libxl/libxl.c	Thu Oct 18 09:35:09 2012 +0100
@@ -955,7 +955,7 @@ static void domain_death_occurred(libxl_
     libxl_evgen_domain_death *evg_next = LIBXL_TAILQ_NEXT(evg, entry);
     *evg_upd = evg_next;
 
-    libxl_event *ev = NEW_EVENT(egc, DOMAIN_DEATH, evg->domid);
+    libxl_event *ev = NEW_EVENT(egc, DOMAIN_DEATH, evg->domid, evg->user);
 
     libxl__event_occurred(egc, ev);
 
@@ -1041,8 +1041,9 @@ static void domain_death_xswatch_callbac
 
             if (!evg->shutdown_reported &&
                 (got->flags & XEN_DOMINF_shutdown)) {
-                libxl_event *ev = NEW_EVENT(egc, DOMAIN_SHUTDOWN, got->domain);
-                
+                libxl_event *ev = NEW_EVENT(egc, DOMAIN_SHUTDOWN,
+                                            got->domain, evg->user);
+
                 LIBXL__LOG(CTX, LIBXL__LOG_DEBUG, " shutdown reporting");
 
                 ev->u.domain_shutdown.shutdown_reason =
@@ -1141,7 +1142,7 @@ static void disk_eject_xswatch_callback(
         return;
     }
 
-    libxl_event *ev = NEW_EVENT(egc, DISK_EJECT, evg->domid);
+    libxl_event *ev = NEW_EVENT(egc, DISK_EJECT, evg->domid, evg->user);
     libxl_device_disk *disk = &ev->u.disk_eject.disk;
     
     backend = libxl__xs_read(gc, XBT_NULL,
diff -r dd64a1bdbe3a -r fb5cf014b387 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Oct 18 09:35:08 2012 +0100
+++ b/tools/libxl/libxl_create.c	Thu Oct 18 09:35:09 2012 +0100
@@ -705,7 +705,8 @@ static void domcreate_console_available(
                                         libxl__domain_create_state *dcs) {
     libxl__ao_progress_report(egc, dcs->ao, &dcs->aop_console_how,
                               NEW_EVENT(egc, DOMAIN_CREATE_CONSOLE_AVAILABLE,
-                                        dcs->guest_domid));
+                                        dcs->guest_domid,
+                                        dcs->aop_console_how.for_event));
 }
 
 static void domcreate_bootloader_done(libxl__egc *egc,
diff -r dd64a1bdbe3a -r fb5cf014b387 tools/libxl/libxl_event.c
--- a/tools/libxl/libxl_event.c	Thu Oct 18 09:35:08 2012 +0100
+++ b/tools/libxl/libxl_event.c	Thu Oct 18 09:35:09 2012 +0100
@@ -1157,7 +1157,8 @@ void libxl_event_free(libxl_ctx *ctx, li
 }
 
 libxl_event *libxl__event_new(libxl__egc *egc,
-                              libxl_event_type type, uint32_t domid)
+                              libxl_event_type type, uint32_t domid,
+                              libxl_ev_user for_user)
 {
     EGC_GC;
     libxl_event *ev;
@@ -1168,6 +1169,7 @@ libxl_event *libxl__event_new(libxl__egc
     libxl_event_init_type(ev, type);
 
     ev->domid = domid;
+    ev->for_user = for_user;
 
     return ev;
 }
@@ -1528,9 +1530,8 @@ void libxl__ao_complete_check_progress_r
         LIBXL_TAILQ_INSERT_TAIL(&egc->aos_for_callback, ao, entry_for_callback);
     } else {
         libxl_event *ev;
-        ev = NEW_EVENT(egc, OPERATION_COMPLETE, ao->domid);
+        ev = NEW_EVENT(egc, OPERATION_COMPLETE, ao->domid, ao->how.u.for_event);
         if (ev) {
-            ev->for_user = ao->how.u.for_event;
             ev->u.operation_complete.rc = ao->rc;
             libxl__event_occurred(egc, ev);
         }
@@ -1662,7 +1663,6 @@ void libxl__ao_progress_report(libxl__eg
         const libxl_asyncprogress_how *how, libxl_event *ev)
 {
     AO_GC;
-    ev->for_user = how->for_event;
     if (how->callback == dummy_asyncprogress_callback_ignore) {
         LOG(DEBUG,"ao %p: progress report: ignored",ao);
         libxl_event_free(CTX,ev);
diff -r dd64a1bdbe3a -r fb5cf014b387 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Thu Oct 18 09:35:08 2012 +0100
+++ b/tools/libxl/libxl_internal.h	Thu Oct 18 09:35:09 2012 +0100
@@ -783,13 +783,14 @@ _hidden void libxl__event_occurred(libxl
    * event should be suitable for passing to libxl_event_free. */
 
 _hidden libxl_event *libxl__event_new(libxl__egc*, libxl_event_type,
-                                      uint32_t domid);
+                                      uint32_t domid,
+                                      libxl_ev_user for_user);
   /* Convenience function.
    * Allocates a new libxl_event, fills in domid and type.
    * Cannot fail. */
 
-#define NEW_EVENT(egc, type, domid)                              \
-    libxl__event_new((egc), LIBXL_EVENT_TYPE_##type, (domid))
+#define NEW_EVENT(egc, type, domid, user)                        \
+    libxl__event_new((egc), LIBXL_EVENT_TYPE_##type, (domid), (user))
     /* Convenience macro. */
 
 /*

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmv-000069-La; Fri, 19 Oct 2012 22:11:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmu-0008UM-Al
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:28 +0000
Received: from [85.158.143.35:52179] by server-1.bemta-4.messagelabs.com id
	07/7B-19134-F00D1805; Fri, 19 Oct 2012 22:11:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1350684684!5679996!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16243 invoked from network); 19 Oct 2012 22:11:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmq-0005WX-QA
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmq-00006J-Ow
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:24 +0000
Message-Id: <E1TPKmq-00006J-Ow@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:24 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: Introduce xl shutdown --all
	support for xm compatibility
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1350549310 -3600
# Node ID 7a77bdbafe07cee94bf9a1511cdddfdc8b532023
# Parent  fb5cf014b38710d36ac937b9de978f49f1a05039
xl: Introduce xl shutdown --all support for xm compatibility

Based on a patch by Sander Eikelenboom

Signed-off-by: Sander Eikelenboom <linux@eikelenboom.it>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
[ ijc -- fixed sizeof(foo) vs sizeof(*foo) issue pointed out by Ian J ]
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r fb5cf014b387 -r 7a77bdbafe07 docs/man/xl.pod.1
--- a/docs/man/xl.pod.1	Thu Oct 18 09:35:09 2012 +0100
+++ b/docs/man/xl.pod.1	Thu Oct 18 09:35:10 2012 +0100
@@ -527,7 +527,7 @@ List specifically for that domain. Other
 
 =back
 
-=item B<shutdown> [I<OPTIONS>] I<domain-id>
+=item B<shutdown> [I<OPTIONS>] I<-a|domain-id>
 
 Gracefully shuts down a domain.  This coordinates with the domain OS
 to perform graceful shutdown, so there is no guarantee that it will
@@ -550,6 +550,11 @@ B<OPTIONS>
 
 =over 4
 
+=item B<-a>, B<--all>
+
+Shutdown all guest domains.  Often used when doing a complete shutdown
+of a Xen system.
+
 =item B<-w>, B<--wait>
 
 Wait for the domain to complete shutdown before returning.
diff -r fb5cf014b387 -r 7a77bdbafe07 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Oct 18 09:35:09 2012 +0100
+++ b/tools/libxl/xl_cmdimpl.c	Thu Oct 18 09:35:10 2012 +0100
@@ -2713,12 +2713,46 @@ static void destroy_domain(uint32_t domi
     if (rc) { fprintf(stderr,"destroy failed (rc=%d)\n",rc); exit(-1); }
 }
 
-static void shutdown_domain(uint32_t domid, int wait_for_it,
+static void wait_for_domain_deaths(libxl_evgen_domain_death **deathws, int nr)
+{
+    int rc, count = 0;
+    LOG("Waiting for %d domains to shutdown", nr);
+    while(1 && count < nr) {
+        libxl_event *event;
+        rc = libxl_event_wait(ctx, &event, LIBXL_EVENTMASK_ALL, 0,0);
+        if (rc) {
+            LOG("Failed to get event, quitting (rc=%d)", rc);
+            exit(-1);
+        }
+
+        switch (event->type) {
+        case LIBXL_EVENT_TYPE_DOMAIN_DEATH:
+            LOG("Domain %d has been destroyed", event->domid);
+            libxl_evdisable_domain_death(ctx, deathws[event->for_user]);
+            count++;
+            break;
+        case LIBXL_EVENT_TYPE_DOMAIN_SHUTDOWN:
+            LOG("Domain %d has been shut down, reason code %d",
+                event->domid, event->u.domain_shutdown.shutdown_reason);
+            libxl_evdisable_domain_death(ctx, deathws[event->for_user]);
+            count++;
+            break;
+        default:
+            LOG("Unexpected event type %d", event->type);
+            break;
+        }
+        libxl_event_free(ctx, event);
+    }
+}
+
+static void shutdown_domain(uint32_t domid,
+                            libxl_evgen_domain_death **deathw,
+                            libxl_ev_user for_user,
                             int fallback_trigger)
 {
     int rc;
-    libxl_event *event;
-
+
+    fprintf(stderr, "Shutting down domain %d\n", domid);
     rc=libxl_domain_shutdown(ctx, domid);
     if (rc == ERROR_NOPARAVIRT) {
         if (fallback_trigger) {
@@ -2731,44 +2765,19 @@ static void shutdown_domain(uint32_t dom
             fprintf(stderr, "Use \"-F\" to fallback to ACPI power event.\n");
         }
     }
+
     if (rc) {
         fprintf(stderr,"shutdown failed (rc=%d)\n",rc);exit(-1);
     }
 
-    if (wait_for_it) {
-        libxl_evgen_domain_death *deathw;
-
-        rc = libxl_evenable_domain_death(ctx, domid, 0, &deathw);
+    if (deathw) {
+        rc = libxl_evenable_domain_death(ctx, domid, for_user, deathw);
         if (rc) {
             fprintf(stderr,"wait for death failed (evgen, rc=%d)\n",rc);
             exit(-1);
         }
-
-        for (;;) {
-            rc = domain_wait_event(domid, &event);
-            if (rc) exit(-1);
-
-            switch (event->type) {
-
-            case LIBXL_EVENT_TYPE_DOMAIN_DEATH:
-                LOG("Domain %d has been destroyed", domid);
-                goto done;
-
-            case LIBXL_EVENT_TYPE_DOMAIN_SHUTDOWN:
-                LOG("Domain %d has been shut down, reason code %d %x", domid,
-                    event->u.domain_shutdown.shutdown_reason,
-                    event->u.domain_shutdown.shutdown_reason);
-                goto done;
-
-            default:
-                LOG("Unexpected event type %d", event->type);
-                break;
-            }
-            libxl_event_free(ctx, event);
-        }
-    done:
-        libxl_event_free(ctx, event);
-        libxl_evdisable_domain_death(ctx, deathw);
+        printf("Waiting for domain %d death %p %"PRIx64"\n",
+               domid, *deathw, for_user);
     }
 }
 
@@ -3706,18 +3715,21 @@ int main_destroy(int argc, char **argv)
 
 int main_shutdown(int argc, char **argv)
 {
-    int opt;
-    int wait_for_it = 0;
+    int opt, i, nb_domain;
+    int wait_for_it = 0, all =0;
     int fallback_trigger = 0;
     static struct option long_options[] = {
+        {"all", 0, 0, 'a'},
         {"wait", 0, 0, 'w'},
         {0, 0, 0, 0}
     };
 
-    while ((opt = getopt_long(argc, argv, "wF", long_options, NULL)) != -1) {
+    while ((opt = getopt_long(argc, argv, "awF", long_options, NULL)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
+        case 'a':
+            all = 1;
         case 'w':
             wait_for_it = 1;
             break;
@@ -3727,7 +3739,44 @@ int main_shutdown(int argc, char **argv)
         }
     }
 
-    shutdown_domain(find_domain(argv[optind]), wait_for_it, fallback_trigger);
+    if (!argv[optind] && !all) {
+        fprintf(stderr, "You must specify -a or a domain id.\n\n");
+        return opt;
+    }
+
+    if (all) {
+        libxl_dominfo *dominfo;
+        libxl_evgen_domain_death **deathws = NULL;
+        if (!(dominfo = libxl_list_domain(ctx, &nb_domain))) {
+            fprintf(stderr, "libxl_list_domain failed.\n");
+            return -1;
+        }
+
+        if (wait_for_it)
+            deathws = calloc(nb_domain, sizeof(*deathws));
+
+        for (i = 0; i<nb_domain; i++) {
+            if (dominfo[i].domid == 0)
+                continue;
+            shutdown_domain(dominfo[i].domid,
+                            deathws ? &deathws[i] : NULL, i,
+                            fallback_trigger);
+        }
+
+        wait_for_domain_deaths(deathws, nb_domain - 1 /* not dom 0 */);
+        libxl_dominfo_list_free(dominfo, nb_domain);
+    } else {
+        libxl_evgen_domain_death *deathw = NULL;
+        uint32_t domid = find_domain(argv[optind]);
+
+        shutdown_domain(domid, wait_for_it ? &deathw : NULL, 0,
+                        fallback_trigger);
+
+        if (wait_for_it)
+            wait_for_domain_deaths(&deathw, 1);
+    }
+
+
     return 0;
 }
 
diff -r fb5cf014b387 -r 7a77bdbafe07 tools/libxl/xl_cmdtable.c
--- a/tools/libxl/xl_cmdtable.c	Thu Oct 18 09:35:09 2012 +0100
+++ b/tools/libxl/xl_cmdtable.c	Thu Oct 18 09:35:10 2012 +0100
@@ -60,11 +60,12 @@ struct cmd_spec cmd_table[] = {
     { "shutdown",
       &main_shutdown, 0, 1,
       "Issue a shutdown signal to a domain",
-      "[options] <Domain>",
+      "[options] <-a|Domain>",
+      "-a, --all               Shutdown all guest domains.\n"
       "-h                      Print this help.\n"
       "-F                      Fallback to ACPI power event for HVM guests with\n"
       "                        no PV drivers.\n"
-      "-w, --wait              Wait for guest to shutdown.\n"
+      "-w, --wait              Wait for guest(s) to shutdown.\n"
     },
     { "reboot",
       &main_reboot, 0, 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 19 22:11:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmv-000069-La; Fri, 19 Oct 2012 22:11:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmu-0008UM-Al
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:28 +0000
Received: from [85.158.143.35:52179] by server-1.bemta-4.messagelabs.com id
	07/7B-19134-F00D1805; Fri, 19 Oct 2012 22:11:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1350684684!5679996!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16243 invoked from network); 19 Oct 2012 22:11:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmq-0005WX-QA
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmq-00006J-Ow
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:24 +0000
Message-Id: <E1TPKmq-00006J-Ow@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:24 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: Introduce xl shutdown --all
	support for xm compatibility
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1350549310 -3600
# Node ID 7a77bdbafe07cee94bf9a1511cdddfdc8b532023
# Parent  fb5cf014b38710d36ac937b9de978f49f1a05039
xl: Introduce xl shutdown --all support for xm compatibility

Based on a patch by Sander Eikelenboom

Signed-off-by: Sander Eikelenboom <linux@eikelenboom.it>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
[ ijc -- fixed sizeof(foo) vs sizeof(*foo) issue pointed out by Ian J ]
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r fb5cf014b387 -r 7a77bdbafe07 docs/man/xl.pod.1
--- a/docs/man/xl.pod.1	Thu Oct 18 09:35:09 2012 +0100
+++ b/docs/man/xl.pod.1	Thu Oct 18 09:35:10 2012 +0100
@@ -527,7 +527,7 @@ List specifically for that domain. Other
 
 =back
 
-=item B<shutdown> [I<OPTIONS>] I<domain-id>
+=item B<shutdown> [I<OPTIONS>] I<-a|domain-id>
 
 Gracefully shuts down a domain.  This coordinates with the domain OS
 to perform graceful shutdown, so there is no guarantee that it will
@@ -550,6 +550,11 @@ B<OPTIONS>
 
 =over 4
 
+=item B<-a>, B<--all>
+
+Shutdown all guest domains.  Often used when doing a complete shutdown
+of a Xen system.
+
 =item B<-w>, B<--wait>
 
 Wait for the domain to complete shutdown before returning.
diff -r fb5cf014b387 -r 7a77bdbafe07 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Oct 18 09:35:09 2012 +0100
+++ b/tools/libxl/xl_cmdimpl.c	Thu Oct 18 09:35:10 2012 +0100
@@ -2713,12 +2713,46 @@ static void destroy_domain(uint32_t domi
     if (rc) { fprintf(stderr,"destroy failed (rc=%d)\n",rc); exit(-1); }
 }
 
-static void shutdown_domain(uint32_t domid, int wait_for_it,
+static void wait_for_domain_deaths(libxl_evgen_domain_death **deathws, int nr)
+{
+    int rc, count = 0;
+    LOG("Waiting for %d domains to shutdown", nr);
+    while(1 && count < nr) {
+        libxl_event *event;
+        rc = libxl_event_wait(ctx, &event, LIBXL_EVENTMASK_ALL, 0,0);
+        if (rc) {
+            LOG("Failed to get event, quitting (rc=%d)", rc);
+            exit(-1);
+        }
+
+        switch (event->type) {
+        case LIBXL_EVENT_TYPE_DOMAIN_DEATH:
+            LOG("Domain %d has been destroyed", event->domid);
+            libxl_evdisable_domain_death(ctx, deathws[event->for_user]);
+            count++;
+            break;
+        case LIBXL_EVENT_TYPE_DOMAIN_SHUTDOWN:
+            LOG("Domain %d has been shut down, reason code %d",
+                event->domid, event->u.domain_shutdown.shutdown_reason);
+            libxl_evdisable_domain_death(ctx, deathws[event->for_user]);
+            count++;
+            break;
+        default:
+            LOG("Unexpected event type %d", event->type);
+            break;
+        }
+        libxl_event_free(ctx, event);
+    }
+}
+
+static void shutdown_domain(uint32_t domid,
+                            libxl_evgen_domain_death **deathw,
+                            libxl_ev_user for_user,
                             int fallback_trigger)
 {
     int rc;
-    libxl_event *event;
-
+
+    fprintf(stderr, "Shutting down domain %d\n", domid);
     rc=libxl_domain_shutdown(ctx, domid);
     if (rc == ERROR_NOPARAVIRT) {
         if (fallback_trigger) {
@@ -2731,44 +2765,19 @@ static void shutdown_domain(uint32_t dom
             fprintf(stderr, "Use \"-F\" to fallback to ACPI power event.\n");
         }
     }
+
     if (rc) {
         fprintf(stderr,"shutdown failed (rc=%d)\n",rc);exit(-1);
     }
 
-    if (wait_for_it) {
-        libxl_evgen_domain_death *deathw;
-
-        rc = libxl_evenable_domain_death(ctx, domid, 0, &deathw);
+    if (deathw) {
+        rc = libxl_evenable_domain_death(ctx, domid, for_user, deathw);
         if (rc) {
             fprintf(stderr,"wait for death failed (evgen, rc=%d)\n",rc);
             exit(-1);
         }
-
-        for (;;) {
-            rc = domain_wait_event(domid, &event);
-            if (rc) exit(-1);
-
-            switch (event->type) {
-
-            case LIBXL_EVENT_TYPE_DOMAIN_DEATH:
-                LOG("Domain %d has been destroyed", domid);
-                goto done;
-
-            case LIBXL_EVENT_TYPE_DOMAIN_SHUTDOWN:
-                LOG("Domain %d has been shut down, reason code %d %x", domid,
-                    event->u.domain_shutdown.shutdown_reason,
-                    event->u.domain_shutdown.shutdown_reason);
-                goto done;
-
-            default:
-                LOG("Unexpected event type %d", event->type);
-                break;
-            }
-            libxl_event_free(ctx, event);
-        }
-    done:
-        libxl_event_free(ctx, event);
-        libxl_evdisable_domain_death(ctx, deathw);
+        printf("Waiting for domain %d death %p %"PRIx64"\n",
+               domid, *deathw, for_user);
     }
 }
 
@@ -3706,18 +3715,21 @@ int main_destroy(int argc, char **argv)
 
 int main_shutdown(int argc, char **argv)
 {
-    int opt;
-    int wait_for_it = 0;
+    int opt, i, nb_domain;
+    int wait_for_it = 0, all =0;
     int fallback_trigger = 0;
     static struct option long_options[] = {
+        {"all", 0, 0, 'a'},
         {"wait", 0, 0, 'w'},
         {0, 0, 0, 0}
     };
 
-    while ((opt = getopt_long(argc, argv, "wF", long_options, NULL)) != -1) {
+    while ((opt = getopt_long(argc, argv, "awF", long_options, NULL)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
+        case 'a':
+            all = 1;
         case 'w':
             wait_for_it = 1;
             break;
@@ -3727,7 +3739,44 @@ int main_shutdown(int argc, char **argv)
         }
     }
 
-    shutdown_domain(find_domain(argv[optind]), wait_for_it, fallback_trigger);
+    if (!argv[optind] && !all) {
+        fprintf(stderr, "You must specify -a or a domain id.\n\n");
+        return opt;
+    }
+
+    if (all) {
+        libxl_dominfo *dominfo;
+        libxl_evgen_domain_death **deathws = NULL;
+        if (!(dominfo = libxl_list_domain(ctx, &nb_domain))) {
+            fprintf(stderr, "libxl_list_domain failed.\n");
+            return -1;
+        }
+
+        if (wait_for_it)
+            deathws = calloc(nb_domain, sizeof(*deathws));
+
+        for (i = 0; i<nb_domain; i++) {
+            if (dominfo[i].domid == 0)
+                continue;
+            shutdown_domain(dominfo[i].domid,
+                            deathws ? &deathws[i] : NULL, i,
+                            fallback_trigger);
+        }
+
+        wait_for_domain_deaths(deathws, nb_domain - 1 /* not dom 0 */);
+        libxl_dominfo_list_free(dominfo, nb_domain);
+    } else {
+        libxl_evgen_domain_death *deathw = NULL;
+        uint32_t domid = find_domain(argv[optind]);
+
+        shutdown_domain(domid, wait_for_it ? &deathw : NULL, 0,
+                        fallback_trigger);
+
+        if (wait_for_it)
+            wait_for_domain_deaths(&deathw, 1);
+    }
+
+
     return 0;
 }
 
diff -r fb5cf014b387 -r 7a77bdbafe07 tools/libxl/xl_cmdtable.c
--- a/tools/libxl/xl_cmdtable.c	Thu Oct 18 09:35:09 2012 +0100
+++ b/tools/libxl/xl_cmdtable.c	Thu Oct 18 09:35:10 2012 +0100
@@ -60,11 +60,12 @@ struct cmd_spec cmd_table[] = {
     { "shutdown",
       &main_shutdown, 0, 1,
       "Issue a shutdown signal to a domain",
-      "[options] <Domain>",
+      "[options] <-a|Domain>",
+      "-a, --all               Shutdown all guest domains.\n"
       "-h                      Print this help.\n"
       "-F                      Fallback to ACPI power event for HVM guests with\n"
       "                        no PV drivers.\n"
-      "-w, --wait              Wait for guest to shutdown.\n"
+      "-w, --wait              Wait for guest(s) to shutdown.\n"
     },
     { "reboot",
       &main_reboot, 0, 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 19 22:11:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmv-00006R-P3; Fri, 19 Oct 2012 22:11:29 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmu-0008Uh-LF
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:28 +0000
Received: from [193.109.254.147:11285] by server-4.bemta-14.messagelabs.com id
	32/55-04248-F00D1805; Fri, 19 Oct 2012 22:11:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-27.messagelabs.com!1350684685!2884424!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29342 invoked from network); 19 Oct 2012 22:11:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmr-0005Wf-C5
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmr-00006Y-Aa
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:25 +0000
Message-Id: <E1TPKmr-00006Y-Aa@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:24 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: Add --wait and --all to xl
	reboot.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1350549311 -3600
# Node ID 3fa2ab30bb05297f30d9a33b30f29db960900971
# Parent  7a77bdbafe07cee94bf9a1511cdddfdc8b532023
xl: Add --wait and --all to xl reboot.

Inspired by a patch by Sander Eikelenboom.

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


diff -r 7a77bdbafe07 -r 3fa2ab30bb05 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Oct 18 09:35:10 2012 +0100
+++ b/tools/libxl/xl_cmdimpl.c	Thu Oct 18 09:35:11 2012 +0100
@@ -2716,7 +2716,7 @@ static void destroy_domain(uint32_t domi
 static void wait_for_domain_deaths(libxl_evgen_domain_death **deathws, int nr)
 {
     int rc, count = 0;
-    LOG("Waiting for %d domains to shutdown", nr);
+    LOG("Waiting for %d domains", nr);
     while(1 && count < nr) {
         libxl_event *event;
         rc = libxl_event_wait(ctx, &event, LIBXL_EVENTMASK_ALL, 0,0);
@@ -2776,15 +2776,15 @@ static void shutdown_domain(uint32_t dom
             fprintf(stderr,"wait for death failed (evgen, rc=%d)\n",rc);
             exit(-1);
         }
-        printf("Waiting for domain %d death %p %"PRIx64"\n",
-               domid, *deathw, for_user);
-    }
-}
-
-static void reboot_domain(uint32_t domid, int fallback_trigger)
+    }
+}
+
+static void reboot_domain(uint32_t domid, libxl_evgen_domain_death **deathw,
+                          libxl_ev_user for_user, int fallback_trigger)
 {
     int rc;
 
+    fprintf(stderr, "Rebooting domain %d\n", domid);
     rc=libxl_domain_reboot(ctx, domid);
     if (rc == ERROR_NOPARAVIRT) {
         if (fallback_trigger) {
@@ -2800,6 +2800,14 @@ static void reboot_domain(uint32_t domid
     if (rc) {
         fprintf(stderr,"reboot failed (rc=%d)\n",rc);exit(-1);
     }
+
+    if (deathw) {
+        rc = libxl_evenable_domain_death(ctx, domid, for_user, deathw);
+        if (rc) {
+            fprintf(stderr,"wait for death failed (evgen, rc=%d)\n",rc);
+            exit(-1);
+        }
+    }
 }
 
 static void list_domains_details(const libxl_dominfo *info, int nb_domain)
@@ -3713,8 +3721,11 @@ int main_destroy(int argc, char **argv)
     return 0;
 }
 
-int main_shutdown(int argc, char **argv)
-{
+static int main_shutdown_or_reboot(int reboot, int argc, char **argv)
+{
+    void (*fn)(uint32_t domid,
+               libxl_evgen_domain_death **, libxl_ev_user, int) =
+        reboot ? &reboot_domain : &shutdown_domain;
     int opt, i, nb_domain;
     int wait_for_it = 0, all =0;
     int fallback_trigger = 0;
@@ -3730,6 +3741,7 @@ int main_shutdown(int argc, char **argv)
             return opt;
         case 'a':
             all = 1;
+            break;
         case 'w':
             wait_for_it = 1;
             break;
@@ -3758,9 +3770,8 @@ int main_shutdown(int argc, char **argv)
         for (i = 0; i<nb_domain; i++) {
             if (dominfo[i].domid == 0)
                 continue;
-            shutdown_domain(dominfo[i].domid,
-                            deathws ? &deathws[i] : NULL, i,
-                            fallback_trigger);
+            fn(dominfo[i].domid, deathws ? &deathws[i] : NULL, i,
+               fallback_trigger);
         }
 
         wait_for_domain_deaths(deathws, nb_domain - 1 /* not dom 0 */);
@@ -3769,8 +3780,7 @@ int main_shutdown(int argc, char **argv)
         libxl_evgen_domain_death *deathw = NULL;
         uint32_t domid = find_domain(argv[optind]);
 
-        shutdown_domain(domid, wait_for_it ? &deathw : NULL, 0,
-                        fallback_trigger);
+        fn(domid, wait_for_it ? &deathw : NULL, 0, fallback_trigger);
 
         if (wait_for_it)
             wait_for_domain_deaths(&deathw, 1);
@@ -3780,23 +3790,14 @@ int main_shutdown(int argc, char **argv)
     return 0;
 }
 
+int main_shutdown(int argc, char **argv)
+{
+    return main_shutdown_or_reboot(0, argc, argv);
+}
+
 int main_reboot(int argc, char **argv)
 {
-    int opt;
-    int fallback_trigger = 0;
-
-    while ((opt = def_getopt(argc, argv, "F", "reboot", 1)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'F':
-            fallback_trigger = 1;
-            break;
-        }
-    }
-
-    reboot_domain(find_domain(argv[optind]), fallback_trigger);
-    return 0;
+    return main_shutdown_or_reboot(1, argc, argv);
 }
 
 int main_list(int argc, char **argv)
diff -r 7a77bdbafe07 -r 3fa2ab30bb05 tools/libxl/xl_cmdtable.c
--- a/tools/libxl/xl_cmdtable.c	Thu Oct 18 09:35:10 2012 +0100
+++ b/tools/libxl/xl_cmdtable.c	Thu Oct 18 09:35:11 2012 +0100
@@ -70,10 +70,12 @@ struct cmd_spec cmd_table[] = {
     { "reboot",
       &main_reboot, 0, 1,
       "Issue a reboot signal to a domain",
-      "[options] <Domain>",
+      "[options] <-a|Domain>",
+      "-a, --all               Shutdown all guest domains.\n"
       "-h                      Print this help.\n"
       "-F                      Fallback to ACPI reset event for HVM guests with\n"
       "                        no PV drivers.\n"
+      "-w, --wait              Wait for guest(s) to reboot.\n"
     },
     { "pci-attach",
       &main_pciattach, 0, 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 19 22:11:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TPKmv-00006R-P3; Fri, 19 Oct 2012 22:11:29 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmu-0008Uh-LF
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:28 +0000
Received: from [193.109.254.147:11285] by server-4.bemta-14.messagelabs.com id
	32/55-04248-F00D1805; Fri, 19 Oct 2012 22:11:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-27.messagelabs.com!1350684685!2884424!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29342 invoked from network); 19 Oct 2012 22:11:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmr-0005Wf-C5
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmr-00006Y-Aa
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:25 +0000
Message-Id: <E1TPKmr-00006Y-Aa@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:24 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: Add --wait and --all to xl
	reboot.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1350549311 -3600
# Node ID 3fa2ab30bb05297f30d9a33b30f29db960900971
# Parent  7a77bdbafe07cee94bf9a1511cdddfdc8b532023
xl: Add --wait and --all to xl reboot.

Inspired by a patch by Sander Eikelenboom.

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


diff -r 7a77bdbafe07 -r 3fa2ab30bb05 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Oct 18 09:35:10 2012 +0100
+++ b/tools/libxl/xl_cmdimpl.c	Thu Oct 18 09:35:11 2012 +0100
@@ -2716,7 +2716,7 @@ static void destroy_domain(uint32_t domi
 static void wait_for_domain_deaths(libxl_evgen_domain_death **deathws, int nr)
 {
     int rc, count = 0;
-    LOG("Waiting for %d domains to shutdown", nr);
+    LOG("Waiting for %d domains", nr);
     while(1 && count < nr) {
         libxl_event *event;
         rc = libxl_event_wait(ctx, &event, LIBXL_EVENTMASK_ALL, 0,0);
@@ -2776,15 +2776,15 @@ static void shutdown_domain(uint32_t dom
             fprintf(stderr,"wait for death failed (evgen, rc=%d)\n",rc);
             exit(-1);
         }
-        printf("Waiting for domain %d death %p %"PRIx64"\n",
-               domid, *deathw, for_user);
-    }
-}
-
-static void reboot_domain(uint32_t domid, int fallback_trigger)
+    }
+}
+
+static void reboot_domain(uint32_t domid, libxl_evgen_domain_death **deathw,
+                          libxl_ev_user for_user, int fallback_trigger)
 {
     int rc;
 
+    fprintf(stderr, "Rebooting domain %d\n", domid);
     rc=libxl_domain_reboot(ctx, domid);
     if (rc == ERROR_NOPARAVIRT) {
         if (fallback_trigger) {
@@ -2800,6 +2800,14 @@ static void reboot_domain(uint32_t domid
     if (rc) {
         fprintf(stderr,"reboot failed (rc=%d)\n",rc);exit(-1);
     }
+
+    if (deathw) {
+        rc = libxl_evenable_domain_death(ctx, domid, for_user, deathw);
+        if (rc) {
+            fprintf(stderr,"wait for death failed (evgen, rc=%d)\n",rc);
+            exit(-1);
+        }
+    }
 }
 
 static void list_domains_details(const libxl_dominfo *info, int nb_domain)
@@ -3713,8 +3721,11 @@ int main_destroy(int argc, char **argv)
     return 0;
 }
 
-int main_shutdown(int argc, char **argv)
-{
+static int main_shutdown_or_reboot(int reboot, int argc, char **argv)
+{
+    void (*fn)(uint32_t domid,
+               libxl_evgen_domain_death **, libxl_ev_user, int) =
+        reboot ? &reboot_domain : &shutdown_domain;
     int opt, i, nb_domain;
     int wait_for_it = 0, all =0;
     int fallback_trigger = 0;
@@ -3730,6 +3741,7 @@ int main_shutdown(int argc, char **argv)
             return opt;
         case 'a':
             all = 1;
+            break;
         case 'w':
             wait_for_it = 1;
             break;
@@ -3758,9 +3770,8 @@ int main_shutdown(int argc, char **argv)
         for (i = 0; i<nb_domain; i++) {
             if (dominfo[i].domid == 0)
                 continue;
-            shutdown_domain(dominfo[i].domid,
-                            deathws ? &deathws[i] : NULL, i,
-                            fallback_trigger);
+            fn(dominfo[i].domid, deathws ? &deathws[i] : NULL, i,
+               fallback_trigger);
         }
 
         wait_for_domain_deaths(deathws, nb_domain - 1 /* not dom 0 */);
@@ -3769,8 +3780,7 @@ int main_shutdown(int argc, char **argv)
         libxl_evgen_domain_death *deathw = NULL;
         uint32_t domid = find_domain(argv[optind]);
 
-        shutdown_domain(domid, wait_for_it ? &deathw : NULL, 0,
-                        fallback_trigger);
+        fn(domid, wait_for_it ? &deathw : NULL, 0, fallback_trigger);
 
         if (wait_for_it)
             wait_for_domain_deaths(&deathw, 1);
@@ -3780,23 +3790,14 @@ int main_shutdown(int argc, char **argv)
     return 0;
 }
 
+int main_shutdown(int argc, char **argv)
+{
+    return main_shutdown_or_reboot(0, argc, argv);
+}
+
 int main_reboot(int argc, char **argv)
 {
-    int opt;
-    int fallback_trigger = 0;
-
-    while ((opt = def_getopt(argc, argv, "F", "reboot", 1)) != -1) {
-        switch (opt) {
-        case 0: case 2:
-            return opt;
-        case 'F':
-            fallback_trigger = 1;
-            break;
-        }
-    }
-
-    reboot_domain(find_domain(argv[optind]), fallback_trigger);
-    return 0;
+    return main_shutdown_or_reboot(1, argc, argv);
 }
 
 int main_list(int argc, char **argv)
diff -r 7a77bdbafe07 -r 3fa2ab30bb05 tools/libxl/xl_cmdtable.c
--- a/tools/libxl/xl_cmdtable.c	Thu Oct 18 09:35:10 2012 +0100
+++ b/tools/libxl/xl_cmdtable.c	Thu Oct 18 09:35:11 2012 +0100
@@ -70,10 +70,12 @@ struct cmd_spec cmd_table[] = {
     { "reboot",
       &main_reboot, 0, 1,
       "Issue a reboot signal to a domain",
-      "[options] <Domain>",
+      "[options] <-a|Domain>",
+      "-a, --all               Shutdown all guest domains.\n"
       "-h                      Print this help.\n"
       "-F                      Fallback to ACPI reset event for HVM guests with\n"
       "                        no PV drivers.\n"
+      "-w, --wait              Wait for guest(s) to reboot.\n"
     },
     { "pci-attach",
       &main_pciattach, 0, 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 19 22:11:31 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11: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 1TPKmw-00008J-S7; Fri, 19 Oct 2012 22:11:30 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmv-00005e-JS
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:29 +0000
Received: from [193.109.254.147:25578] by server-6.bemta-14.messagelabs.com id
	BC/8B-17826-010D1805; Fri, 19 Oct 2012 22:11:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1350684686!10508310!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11468 invoked from network); 19 Oct 2012 22:11:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmr-0005Wl-T4
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmr-00006n-Rm
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:25 +0000
Message-Id: <E1TPKmr-00006n-Rm@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:25 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] IOMMU: fail HPET MSI setup on AMD
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1350658284 -7200
# Node ID 478ba3f146df23d2cfa95fc603d0b4b9d21ba15d
# Parent  3fa2ab30bb05297f30d9a33b30f29db960900971
IOMMU: fail HPET MSI setup on AMD

While the MSI message format doesn't need adjustment for AMD IOMMUs,
the interrupt remapping tables still need updating. The respective code
has to be able to determine the IOMMU responsible, which currently
requires an associated PCI device. The absence of that device in the
HPET case causes the code to crash, and the code determining the source
ID to be used for HPETs (parse_ivhd_device_special() afaict) isn't even
looking at whether it's dealing with an IO-APIC or a HPET (i.e. ignores
the "variety" structure member). If I tried to fix that, I would have
no way to test that I did things right, so all I can do to fix the
crash is make the setup fail if the IOMMU did not provide a handler
(which, considering the above, is the right thing anyway).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Wei Wang <wei.wang2@amd.com>
---


diff -r 3fa2ab30bb05 -r 478ba3f146df xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c	Thu Oct 18 09:35:11 2012 +0100
+++ b/xen/drivers/passthrough/iommu.c	Fri Oct 19 16:51:24 2012 +0200
@@ -498,7 +498,7 @@ unsigned int iommu_read_apic_from_ire(un
 int __init iommu_setup_hpet_msi(struct msi_desc *msi)
 {
     const struct iommu_ops *ops = iommu_get_ops();
-    return ops->setup_hpet_msi ? ops->setup_hpet_msi(msi) : 0;
+    return ops->setup_hpet_msi ? ops->setup_hpet_msi(msi) : -ENODEV;
 }
 
 void iommu_resume()

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

From xen-changelog-bounces@lists.xen.org Fri Oct 19 22:11:31 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Oct 2012 22:11: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 1TPKmw-00008J-S7; Fri, 19 Oct 2012 22:11:30 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmv-00005e-JS
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:29 +0000
Received: from [193.109.254.147:25578] by server-6.bemta-14.messagelabs.com id
	BC/8B-17826-010D1805; Fri, 19 Oct 2012 22:11:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1350684686!10508310!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11468 invoked from network); 19 Oct 2012 22:11:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Oct 2012 22:11:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmr-0005Wl-T4
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TPKmr-00006n-Rm
	for xen-changelog@lists.xensource.com; Fri, 19 Oct 2012 22:11:25 +0000
Message-Id: <E1TPKmr-00006n-Rm@xenbits.xen.org>
Date: Fri, 19 Oct 2012 22:11:25 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] IOMMU: fail HPET MSI setup on AMD
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1350658284 -7200
# Node ID 478ba3f146df23d2cfa95fc603d0b4b9d21ba15d
# Parent  3fa2ab30bb05297f30d9a33b30f29db960900971
IOMMU: fail HPET MSI setup on AMD

While the MSI message format doesn't need adjustment for AMD IOMMUs,
the interrupt remapping tables still need updating. The respective code
has to be able to determine the IOMMU responsible, which currently
requires an associated PCI device. The absence of that device in the
HPET case causes the code to crash, and the code determining the source
ID to be used for HPETs (parse_ivhd_device_special() afaict) isn't even
looking at whether it's dealing with an IO-APIC or a HPET (i.e. ignores
the "variety" structure member). If I tried to fix that, I would have
no way to test that I did things right, so all I can do to fix the
crash is make the setup fail if the IOMMU did not provide a handler
(which, considering the above, is the right thing anyway).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Wei Wang <wei.wang2@amd.com>
---


diff -r 3fa2ab30bb05 -r 478ba3f146df xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c	Thu Oct 18 09:35:11 2012 +0100
+++ b/xen/drivers/passthrough/iommu.c	Fri Oct 19 16:51:24 2012 +0200
@@ -498,7 +498,7 @@ unsigned int iommu_read_apic_from_ire(un
 int __init iommu_setup_hpet_msi(struct msi_desc *msi)
 {
     const struct iommu_ops *ops = iommu_get_ops();
-    return ops->setup_hpet_msi ? ops->setup_hpet_msi(msi) : 0;
+    return ops->setup_hpet_msi ? ops->setup_hpet_msi(msi) : -ENODEV;
 }
 
 void iommu_resume()

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

From xen-changelog-bounces@lists.xen.org Mon Oct 22 20:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Oct 2012 20:33:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TQOgS-0003gs-C4; Mon, 22 Oct 2012 20:33:12 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQOgR-0003gi-7s
	for xen-changelog@lists.xensource.com; Mon, 22 Oct 2012 20:33:11 +0000
Received: from [193.109.254.147:7295] by server-9.bemta-14.messagelabs.com id
	46/8D-09620-68DA5805; Mon, 22 Oct 2012 20:33:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-27.messagelabs.com!1350937989!12293209!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11191 invoked from network); 22 Oct 2012 20:33:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Oct 2012 20:33:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQOgO-0006Xr-Iv
	for xen-changelog@lists.xensource.com; Mon, 22 Oct 2012 20:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQOgO-0002dm-69
	for xen-changelog@lists.xensource.com; Mon, 22 Oct 2012 20:33:08 +0000
Message-Id: <E1TQOgO-0002dm-69@xenbits.xen.org>
Date: Mon, 22 Oct 2012 20:33:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hvm: handle PoD and grant pages in
	HVMOP_get_mem_type
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1350655745 -7200
# Node ID 4ae08ca5500f68d19a689c06489024157300d7b0
# Parent  478ba3f146df23d2cfa95fc603d0b4b9d21ba15d
hvm: handle PoD and grant pages in HVMOP_get_mem_type

During kexec in a ballooned PVonHVM guest the new kernel needs to check
each pfn if its backed by a mfn to find ballooned pages. Currently all
PoD and grant pages will appear as HVMMEM_mmio_dm, so the new kernel has
to assume they are ballooned. This is wrong: PoD pages may turn into
real RAM at runtime, grant pages are also RAM.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 478ba3f146df -r 4ae08ca5500f xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Fri Oct 19 16:51:24 2012 +0200
+++ b/xen/arch/x86/hvm/hvm.c	Fri Oct 19 16:09:05 2012 +0200
@@ -4086,6 +4086,10 @@ long do_hvm_op(unsigned long op, XEN_GUE
                 a.mem_type =  HVMMEM_ram_ro;
             else if ( p2m_is_ram(t) )
                 a.mem_type =  HVMMEM_ram_rw;
+            else if ( p2m_is_magic(t) )
+                a.mem_type =  HVMMEM_ram_rw;
+            else if ( p2m_is_grant(t) )
+                a.mem_type =  HVMMEM_ram_rw;
             else
                 a.mem_type =  HVMMEM_mmio_dm;
             rc = copy_to_guest(arg, &a, 1) ? -EFAULT : 0;

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

From xen-changelog-bounces@lists.xen.org Mon Oct 22 20:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Oct 2012 20:33:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TQOgS-0003gs-C4; Mon, 22 Oct 2012 20:33:12 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQOgR-0003gi-7s
	for xen-changelog@lists.xensource.com; Mon, 22 Oct 2012 20:33:11 +0000
Received: from [193.109.254.147:7295] by server-9.bemta-14.messagelabs.com id
	46/8D-09620-68DA5805; Mon, 22 Oct 2012 20:33:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-27.messagelabs.com!1350937989!12293209!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11191 invoked from network); 22 Oct 2012 20:33:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Oct 2012 20:33:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQOgO-0006Xr-Iv
	for xen-changelog@lists.xensource.com; Mon, 22 Oct 2012 20:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQOgO-0002dm-69
	for xen-changelog@lists.xensource.com; Mon, 22 Oct 2012 20:33:08 +0000
Message-Id: <E1TQOgO-0002dm-69@xenbits.xen.org>
Date: Mon, 22 Oct 2012 20:33:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hvm: handle PoD and grant pages in
	HVMOP_get_mem_type
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1350655745 -7200
# Node ID 4ae08ca5500f68d19a689c06489024157300d7b0
# Parent  478ba3f146df23d2cfa95fc603d0b4b9d21ba15d
hvm: handle PoD and grant pages in HVMOP_get_mem_type

During kexec in a ballooned PVonHVM guest the new kernel needs to check
each pfn if its backed by a mfn to find ballooned pages. Currently all
PoD and grant pages will appear as HVMMEM_mmio_dm, so the new kernel has
to assume they are ballooned. This is wrong: PoD pages may turn into
real RAM at runtime, grant pages are also RAM.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 478ba3f146df -r 4ae08ca5500f xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Fri Oct 19 16:51:24 2012 +0200
+++ b/xen/arch/x86/hvm/hvm.c	Fri Oct 19 16:09:05 2012 +0200
@@ -4086,6 +4086,10 @@ long do_hvm_op(unsigned long op, XEN_GUE
                 a.mem_type =  HVMMEM_ram_ro;
             else if ( p2m_is_ram(t) )
                 a.mem_type =  HVMMEM_ram_rw;
+            else if ( p2m_is_magic(t) )
+                a.mem_type =  HVMMEM_ram_rw;
+            else if ( p2m_is_grant(t) )
+                a.mem_type =  HVMMEM_ram_rw;
             else
                 a.mem_type =  HVMMEM_mmio_dm;
             rc = copy_to_guest(arg, &a, 1) ? -EFAULT : 0;

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

From xen-changelog-bounces@lists.xen.org Mon Oct 22 20:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Oct 2012 20:33:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TQOgT-0003gx-Ec; Mon, 22 Oct 2012 20:33:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQOgR-0003gj-NK
	for xen-changelog@lists.xensource.com; Mon, 22 Oct 2012 20:33:11 +0000
Received: from [85.158.138.51:7159] by server-7.bemta-3.messagelabs.com id
	95/22-06991-68DA5805; Mon, 22 Oct 2012 20:33:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-174.messagelabs.com!1350937989!27360795!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30286 invoked from network); 22 Oct 2012 20:33:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Oct 2012 20:33:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQOgO-0006Xu-VQ
	for xen-changelog@lists.xensource.com; Mon, 22 Oct 2012 20:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQOgO-0002e1-PE
	for xen-changelog@lists.xensource.com; Mon, 22 Oct 2012 20:33:08 +0000
Message-Id: <E1TQOgO-0002e1-PE@xenbits.xen.org>
Date: Mon, 22 Oct 2012 20:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] p2m: rename p2m_is_magic to
	p2m_is_pod
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1350918469 -7200
# Node ID c69bcb24812896dc6d5cf033babb7e79b8a50aec
# Parent  4ae08ca5500f68d19a689c06489024157300d7b0
p2m: rename p2m_is_magic to p2m_is_pod

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 4ae08ca5500f -r c69bcb248128 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Fri Oct 19 16:09:05 2012 +0200
+++ b/xen/arch/x86/hvm/hvm.c	Mon Oct 22 17:07:49 2012 +0200
@@ -4086,7 +4086,7 @@ long do_hvm_op(unsigned long op, XEN_GUE
                 a.mem_type =  HVMMEM_ram_ro;
             else if ( p2m_is_ram(t) )
                 a.mem_type =  HVMMEM_ram_rw;
-            else if ( p2m_is_magic(t) )
+            else if ( p2m_is_pod(t) )
                 a.mem_type =  HVMMEM_ram_rw;
             else if ( p2m_is_grant(t) )
                 a.mem_type =  HVMMEM_ram_rw;
diff -r 4ae08ca5500f -r c69bcb248128 xen/arch/x86/mm/p2m-pt.c
--- a/xen/arch/x86/mm/p2m-pt.c	Fri Oct 19 16:09:05 2012 +0200
+++ b/xen/arch/x86/mm/p2m-pt.c	Mon Oct 22 17:07:49 2012 +0200
@@ -405,7 +405,7 @@ p2m_set_entry(struct p2m_domain *p2m, un
         }
         
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
-        if ( mfn_valid(mfn) || p2m_is_magic(p2mt) )
+        if ( mfn_valid(mfn) || p2m_is_pod(p2mt) )
             l2e_content = l2e_from_pfn(mfn_x(mfn),
                                        p2m_type_to_flags(p2mt, mfn) |
                                        _PAGE_PSE);
diff -r 4ae08ca5500f -r c69bcb248128 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Fri Oct 19 16:09:05 2012 +0200
+++ b/xen/arch/x86/mm/p2m.c	Mon Oct 22 17:07:49 2012 +0200
@@ -238,7 +238,7 @@ struct page_info *get_page_from_gfn_p2m(
             return page;
 
         /* Error path: not a suitable GFN at all */
-        if ( !p2m_is_ram(*t) && !p2m_is_paging(*t) && !p2m_is_magic(*t) )
+        if ( !p2m_is_ram(*t) && !p2m_is_paging(*t) && !p2m_is_pod(*t) )
             return NULL;
     }
 
diff -r 4ae08ca5500f -r c69bcb248128 xen/include/asm-x86/p2m.h
--- a/xen/include/asm-x86/p2m.h	Fri Oct 19 16:09:05 2012 +0200
+++ b/xen/include/asm-x86/p2m.h	Mon Oct 22 17:07:49 2012 +0200
@@ -139,7 +139,7 @@ typedef unsigned int p2m_query_t;
                       | p2m_to_mask(p2m_grant_map_ro)   \
                       | p2m_to_mask(p2m_ram_shared) )
 
-#define P2M_MAGIC_TYPES (p2m_to_mask(p2m_populate_on_demand))
+#define P2M_POD_TYPES (p2m_to_mask(p2m_populate_on_demand))
 
 /* Pageable types */
 #define P2M_PAGEABLE_TYPES (p2m_to_mask(p2m_ram_rw) \
@@ -167,7 +167,7 @@ typedef unsigned int p2m_query_t;
 #define p2m_is_hole(_t) (p2m_to_mask(_t) & P2M_HOLE_TYPES)
 #define p2m_is_mmio(_t) (p2m_to_mask(_t) & P2M_MMIO_TYPES)
 #define p2m_is_readonly(_t) (p2m_to_mask(_t) & P2M_RO_TYPES)
-#define p2m_is_magic(_t) (p2m_to_mask(_t) & P2M_MAGIC_TYPES)
+#define p2m_is_pod(_t) (p2m_to_mask(_t) & P2M_POD_TYPES)
 #define p2m_is_grant(_t) (p2m_to_mask(_t) & P2M_GRANT_TYPES)
 /* Grant types are *not* considered valid, because they can be
    unmapped at any time and, unless you happen to be the shadow or p2m

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

From xen-changelog-bounces@lists.xen.org Mon Oct 22 20:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Oct 2012 20:33:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TQOgT-0003gx-Ec; Mon, 22 Oct 2012 20:33:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQOgR-0003gj-NK
	for xen-changelog@lists.xensource.com; Mon, 22 Oct 2012 20:33:11 +0000
Received: from [85.158.138.51:7159] by server-7.bemta-3.messagelabs.com id
	95/22-06991-68DA5805; Mon, 22 Oct 2012 20:33:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-174.messagelabs.com!1350937989!27360795!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30286 invoked from network); 22 Oct 2012 20:33:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Oct 2012 20:33:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQOgO-0006Xu-VQ
	for xen-changelog@lists.xensource.com; Mon, 22 Oct 2012 20:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQOgO-0002e1-PE
	for xen-changelog@lists.xensource.com; Mon, 22 Oct 2012 20:33:08 +0000
Message-Id: <E1TQOgO-0002e1-PE@xenbits.xen.org>
Date: Mon, 22 Oct 2012 20:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] p2m: rename p2m_is_magic to
	p2m_is_pod
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1350918469 -7200
# Node ID c69bcb24812896dc6d5cf033babb7e79b8a50aec
# Parent  4ae08ca5500f68d19a689c06489024157300d7b0
p2m: rename p2m_is_magic to p2m_is_pod

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 4ae08ca5500f -r c69bcb248128 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Fri Oct 19 16:09:05 2012 +0200
+++ b/xen/arch/x86/hvm/hvm.c	Mon Oct 22 17:07:49 2012 +0200
@@ -4086,7 +4086,7 @@ long do_hvm_op(unsigned long op, XEN_GUE
                 a.mem_type =  HVMMEM_ram_ro;
             else if ( p2m_is_ram(t) )
                 a.mem_type =  HVMMEM_ram_rw;
-            else if ( p2m_is_magic(t) )
+            else if ( p2m_is_pod(t) )
                 a.mem_type =  HVMMEM_ram_rw;
             else if ( p2m_is_grant(t) )
                 a.mem_type =  HVMMEM_ram_rw;
diff -r 4ae08ca5500f -r c69bcb248128 xen/arch/x86/mm/p2m-pt.c
--- a/xen/arch/x86/mm/p2m-pt.c	Fri Oct 19 16:09:05 2012 +0200
+++ b/xen/arch/x86/mm/p2m-pt.c	Mon Oct 22 17:07:49 2012 +0200
@@ -405,7 +405,7 @@ p2m_set_entry(struct p2m_domain *p2m, un
         }
         
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
-        if ( mfn_valid(mfn) || p2m_is_magic(p2mt) )
+        if ( mfn_valid(mfn) || p2m_is_pod(p2mt) )
             l2e_content = l2e_from_pfn(mfn_x(mfn),
                                        p2m_type_to_flags(p2mt, mfn) |
                                        _PAGE_PSE);
diff -r 4ae08ca5500f -r c69bcb248128 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Fri Oct 19 16:09:05 2012 +0200
+++ b/xen/arch/x86/mm/p2m.c	Mon Oct 22 17:07:49 2012 +0200
@@ -238,7 +238,7 @@ struct page_info *get_page_from_gfn_p2m(
             return page;
 
         /* Error path: not a suitable GFN at all */
-        if ( !p2m_is_ram(*t) && !p2m_is_paging(*t) && !p2m_is_magic(*t) )
+        if ( !p2m_is_ram(*t) && !p2m_is_paging(*t) && !p2m_is_pod(*t) )
             return NULL;
     }
 
diff -r 4ae08ca5500f -r c69bcb248128 xen/include/asm-x86/p2m.h
--- a/xen/include/asm-x86/p2m.h	Fri Oct 19 16:09:05 2012 +0200
+++ b/xen/include/asm-x86/p2m.h	Mon Oct 22 17:07:49 2012 +0200
@@ -139,7 +139,7 @@ typedef unsigned int p2m_query_t;
                       | p2m_to_mask(p2m_grant_map_ro)   \
                       | p2m_to_mask(p2m_ram_shared) )
 
-#define P2M_MAGIC_TYPES (p2m_to_mask(p2m_populate_on_demand))
+#define P2M_POD_TYPES (p2m_to_mask(p2m_populate_on_demand))
 
 /* Pageable types */
 #define P2M_PAGEABLE_TYPES (p2m_to_mask(p2m_ram_rw) \
@@ -167,7 +167,7 @@ typedef unsigned int p2m_query_t;
 #define p2m_is_hole(_t) (p2m_to_mask(_t) & P2M_HOLE_TYPES)
 #define p2m_is_mmio(_t) (p2m_to_mask(_t) & P2M_MMIO_TYPES)
 #define p2m_is_readonly(_t) (p2m_to_mask(_t) & P2M_RO_TYPES)
-#define p2m_is_magic(_t) (p2m_to_mask(_t) & P2M_MAGIC_TYPES)
+#define p2m_is_pod(_t) (p2m_to_mask(_t) & P2M_POD_TYPES)
 #define p2m_is_grant(_t) (p2m_to_mask(_t) & P2M_GRANT_TYPES)
 /* Grant types are *not* considered valid, because they can be
    unmapped at any time and, unless you happen to be the shadow or p2m

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

From xen-changelog-bounces@lists.xen.org Tue Oct 23 16:33:15 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 23 Oct 2012 16: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 1TQhPk-0004yp-Pd; Tue, 23 Oct 2012 16:33:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQhPj-0004yW-BO
	for xen-changelog@lists.xensource.com; Tue, 23 Oct 2012 16:33:11 +0000
Received: from [85.158.138.51:31741] by server-2.bemta-3.messagelabs.com id
	5D/CF-00604-6C6C6805; Tue, 23 Oct 2012 16:33:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1351009988!35398109!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32133 invoked from network); 23 Oct 2012 16:33:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2012 16:33:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQhPg-0004mR-E7
	for xen-changelog@lists.xensource.com; Tue, 23 Oct 2012 16:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQhPg-0000wS-6j
	for xen-changelog@lists.xensource.com; Tue, 23 Oct 2012 16:33:08 +0000
Message-Id: <E1TQhPg-0000wS-6j@xenbits.xen.org>
Date: Tue, 23 Oct 2012 16:33:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nestedsvm: fix VMEXIT emulation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1350976467 -7200
# Node ID d642720e1ea996ce85203fc9718f64cf2cab0468
# Parent  a7503ce27d462056421c6d74737cee08ab4ae31e
nestedsvm: fix VMEXIT emulation

Values in regs can be newer than those in the shadow vmcb (e.g. due to
an instruction emulation right before). So use the values from regs.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r a7503ce27d46 -r d642720e1ea9 xen/arch/x86/hvm/svm/nestedsvm.c
--- a/xen/arch/x86/hvm/svm/nestedsvm.c	Tue Oct 23 09:13:27 2012 +0200
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c	Tue Oct 23 09:14:27 2012 +0200
@@ -995,7 +995,7 @@ nsvm_vmcb_guest_intercepts_trap(struct v
 }
 
 static int
-nsvm_vmcb_prepare4vmexit(struct vcpu *v)
+nsvm_vmcb_prepare4vmexit(struct vcpu *v, struct cpu_user_regs *regs)
 {
     struct nestedvcpu *nv = &vcpu_nestedhvm(v);
     struct nestedsvm *svm = &vcpu_nestedsvm(v);
@@ -1119,17 +1119,22 @@ nsvm_vmcb_prepare4vmexit(struct vcpu *v)
     ns_vmcb->_dr7 = n2vmcb->_dr7;
     ns_vmcb->_dr6 = n2vmcb->_dr6;
 
+    /* Restore registers from regs as those values
+     * can be newer than in n2vmcb (e.g. due to an
+     * instruction emulation right before).
+     */
+
     /* RFLAGS */
-    ns_vmcb->rflags = n2vmcb->rflags;
+    ns_vmcb->rflags = n2vmcb->rflags = regs->rflags;
 
     /* RIP */
-    ns_vmcb->rip = n2vmcb->rip;
+    ns_vmcb->rip = n2vmcb->rip = regs->rip;
 
     /* RSP */
-    ns_vmcb->rsp = n2vmcb->rsp;
+    ns_vmcb->rsp = n2vmcb->rsp = regs->rsp;
 
     /* RAX */
-    ns_vmcb->rax = n2vmcb->rax;
+    ns_vmcb->rax = n2vmcb->rax = regs->rax;
 
     /* Keep the l2 guest values of the fs, gs, ldtr, tr, kerngsbase,
      * star, lstar, cstar, sfmask, sysenter_cs, sysenter_esp,
@@ -1363,7 +1368,7 @@ nestedsvm_vmexit_n2n1(struct vcpu *v, st
     ASSERT(vcpu_nestedhvm(v).nv_vmswitch_in_progress);
     ASSERT(nestedhvm_vcpu_in_guestmode(v));
 
-    rc = nsvm_vmcb_prepare4vmexit(v);
+    rc = nsvm_vmcb_prepare4vmexit(v, regs);
     if (rc)
         ret = NESTEDHVM_VMEXIT_ERROR;
 

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

From xen-changelog-bounces@lists.xen.org Tue Oct 23 16:33:15 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 23 Oct 2012 16: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 1TQhPk-0004yp-Pd; Tue, 23 Oct 2012 16:33:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQhPj-0004yW-BO
	for xen-changelog@lists.xensource.com; Tue, 23 Oct 2012 16:33:11 +0000
Received: from [85.158.138.51:31741] by server-2.bemta-3.messagelabs.com id
	5D/CF-00604-6C6C6805; Tue, 23 Oct 2012 16:33:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1351009988!35398109!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32133 invoked from network); 23 Oct 2012 16:33:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2012 16:33:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQhPg-0004mR-E7
	for xen-changelog@lists.xensource.com; Tue, 23 Oct 2012 16:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQhPg-0000wS-6j
	for xen-changelog@lists.xensource.com; Tue, 23 Oct 2012 16:33:08 +0000
Message-Id: <E1TQhPg-0000wS-6j@xenbits.xen.org>
Date: Tue, 23 Oct 2012 16:33:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nestedsvm: fix VMEXIT emulation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1350976467 -7200
# Node ID d642720e1ea996ce85203fc9718f64cf2cab0468
# Parent  a7503ce27d462056421c6d74737cee08ab4ae31e
nestedsvm: fix VMEXIT emulation

Values in regs can be newer than those in the shadow vmcb (e.g. due to
an instruction emulation right before). So use the values from regs.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r a7503ce27d46 -r d642720e1ea9 xen/arch/x86/hvm/svm/nestedsvm.c
--- a/xen/arch/x86/hvm/svm/nestedsvm.c	Tue Oct 23 09:13:27 2012 +0200
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c	Tue Oct 23 09:14:27 2012 +0200
@@ -995,7 +995,7 @@ nsvm_vmcb_guest_intercepts_trap(struct v
 }
 
 static int
-nsvm_vmcb_prepare4vmexit(struct vcpu *v)
+nsvm_vmcb_prepare4vmexit(struct vcpu *v, struct cpu_user_regs *regs)
 {
     struct nestedvcpu *nv = &vcpu_nestedhvm(v);
     struct nestedsvm *svm = &vcpu_nestedsvm(v);
@@ -1119,17 +1119,22 @@ nsvm_vmcb_prepare4vmexit(struct vcpu *v)
     ns_vmcb->_dr7 = n2vmcb->_dr7;
     ns_vmcb->_dr6 = n2vmcb->_dr6;
 
+    /* Restore registers from regs as those values
+     * can be newer than in n2vmcb (e.g. due to an
+     * instruction emulation right before).
+     */
+
     /* RFLAGS */
-    ns_vmcb->rflags = n2vmcb->rflags;
+    ns_vmcb->rflags = n2vmcb->rflags = regs->rflags;
 
     /* RIP */
-    ns_vmcb->rip = n2vmcb->rip;
+    ns_vmcb->rip = n2vmcb->rip = regs->rip;
 
     /* RSP */
-    ns_vmcb->rsp = n2vmcb->rsp;
+    ns_vmcb->rsp = n2vmcb->rsp = regs->rsp;
 
     /* RAX */
-    ns_vmcb->rax = n2vmcb->rax;
+    ns_vmcb->rax = n2vmcb->rax = regs->rax;
 
     /* Keep the l2 guest values of the fs, gs, ldtr, tr, kerngsbase,
      * star, lstar, cstar, sfmask, sysenter_cs, sysenter_esp,
@@ -1363,7 +1368,7 @@ nestedsvm_vmexit_n2n1(struct vcpu *v, st
     ASSERT(vcpu_nestedhvm(v).nv_vmswitch_in_progress);
     ASSERT(nestedhvm_vcpu_in_guestmode(v));
 
-    rc = nsvm_vmcb_prepare4vmexit(v);
+    rc = nsvm_vmcb_prepare4vmexit(v, regs);
     if (rc)
         ret = NESTEDHVM_VMEXIT_ERROR;
 

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

From xen-changelog-bounces@lists.xen.org Tue Oct 23 16:33:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 23 Oct 2012 16:33: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 1TQhPj-0004yb-Ms; Tue, 23 Oct 2012 16:33:11 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQhPi-0004yP-IF
	for xen-changelog@lists.xensource.com; Tue, 23 Oct 2012 16:33:10 +0000
Received: from [85.158.139.83:24242] by server-15.bemta-5.messagelabs.com id
	90/5E-28599-5C6C6805; Tue, 23 Oct 2012 16:33:09 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1351009988!35978410!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12517 invoked from network); 23 Oct 2012 16:33:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2012 16:33:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQhPg-0004mO-5X
	for xen-changelog@lists.xensource.com; Tue, 23 Oct 2012 16:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQhPf-0000wD-Kr
	for xen-changelog@lists.xensource.com; Tue, 23 Oct 2012 16:33:07 +0000
Message-Id: <E1TQhPf-0000wD-Kr@xenbits.xen.org>
Date: Tue, 23 Oct 2012 16:33:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nestedsvm: fix memory leak on
	shutdown/crash
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1350976407 -7200
# Node ID a7503ce27d462056421c6d74737cee08ab4ae31e
# Parent  c69bcb24812896dc6d5cf033babb7e79b8a50aec
nestedsvm: fix memory leak on shutdown/crash

Fix memory leak of l1 vmcb page when destroying a vcpu while l2 guest
is running.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r c69bcb248128 -r a7503ce27d46 xen/arch/x86/hvm/svm/nestedsvm.c
--- a/xen/arch/x86/hvm/svm/nestedsvm.c	Mon Oct 22 17:07:49 2012 +0200
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c	Tue Oct 23 09:13:27 2012 +0200
@@ -122,6 +122,15 @@ void nsvm_vcpu_destroy(struct vcpu *v)
     struct nestedvcpu *nv = &vcpu_nestedhvm(v);
     struct nestedsvm *svm = &vcpu_nestedsvm(v);
 
+    /*
+     * When destroying the vcpu, it may be running on behalf of l2 guest.
+     * Therefore we need to switch the VMCB pointer back to the l1 vmcb,
+     * in order to avoid double free of l2 vmcb and the possible memory leak
+     * of l1 vmcb page.
+     */
+    if (nv->nv_n1vmcx)
+        v->arch.hvm_svm.vmcb = nv->nv_n1vmcx;
+
     if (svm->ns_cached_msrpm) {
         free_xenheap_pages(svm->ns_cached_msrpm,
                            get_order_from_bytes(MSRPM_SIZE));

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

From xen-changelog-bounces@lists.xen.org Tue Oct 23 16:33:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 23 Oct 2012 16:33: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 1TQhPj-0004yb-Ms; Tue, 23 Oct 2012 16:33:11 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQhPi-0004yP-IF
	for xen-changelog@lists.xensource.com; Tue, 23 Oct 2012 16:33:10 +0000
Received: from [85.158.139.83:24242] by server-15.bemta-5.messagelabs.com id
	90/5E-28599-5C6C6805; Tue, 23 Oct 2012 16:33:09 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1351009988!35978410!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12517 invoked from network); 23 Oct 2012 16:33:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2012 16:33:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQhPg-0004mO-5X
	for xen-changelog@lists.xensource.com; Tue, 23 Oct 2012 16:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQhPf-0000wD-Kr
	for xen-changelog@lists.xensource.com; Tue, 23 Oct 2012 16:33:07 +0000
Message-Id: <E1TQhPf-0000wD-Kr@xenbits.xen.org>
Date: Tue, 23 Oct 2012 16:33:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nestedsvm: fix memory leak on
	shutdown/crash
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1350976407 -7200
# Node ID a7503ce27d462056421c6d74737cee08ab4ae31e
# Parent  c69bcb24812896dc6d5cf033babb7e79b8a50aec
nestedsvm: fix memory leak on shutdown/crash

Fix memory leak of l1 vmcb page when destroying a vcpu while l2 guest
is running.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r c69bcb248128 -r a7503ce27d46 xen/arch/x86/hvm/svm/nestedsvm.c
--- a/xen/arch/x86/hvm/svm/nestedsvm.c	Mon Oct 22 17:07:49 2012 +0200
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c	Tue Oct 23 09:13:27 2012 +0200
@@ -122,6 +122,15 @@ void nsvm_vcpu_destroy(struct vcpu *v)
     struct nestedvcpu *nv = &vcpu_nestedhvm(v);
     struct nestedsvm *svm = &vcpu_nestedsvm(v);
 
+    /*
+     * When destroying the vcpu, it may be running on behalf of l2 guest.
+     * Therefore we need to switch the VMCB pointer back to the l1 vmcb,
+     * in order to avoid double free of l2 vmcb and the possible memory leak
+     * of l1 vmcb page.
+     */
+    if (nv->nv_n1vmcx)
+        v->arch.hvm_svm.vmcb = nv->nv_n1vmcx;
+
     if (svm->ns_cached_msrpm) {
         free_xenheap_pages(svm->ns_cached_msrpm,
                            get_order_from_bytes(MSRPM_SIZE));

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

From xen-changelog-bounces@lists.xen.org Wed Oct 24 05:00:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 24 Oct 2012 05:00: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 1TQt4t-0001no-Lm; Wed, 24 Oct 2012 05:00:27 +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 1TQt4s-0001nd-Vn
	for xen-changelog@lists.xensource.com; Wed, 24 Oct 2012 05:00:27 +0000
Received: from [85.158.139.211:3257] by server-7.bemta-5.messagelabs.com id
	07/BF-23102-AE577805; Wed, 24 Oct 2012 05:00:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-206.messagelabs.com!1351054821!23458103!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22523 invoked from network); 24 Oct 2012 05:00:22 -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;
	24 Oct 2012 05:00:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQt4m-0005fK-P4
	for xen-changelog@lists.xensource.com; Wed, 24 Oct 2012 05:00:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQt4m-00041C-8g
	for xen-changelog@lists.xensource.com; Wed, 24 Oct 2012 05:00:20 +0000
Message-Id: <E1TQt4m-00041C-8g@xenbits.xen.org>
Date: Wed, 24 Oct 2012 05:00:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: sched: introduce a couple of
	counters in credit2 and SEDF
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dario Faggioli <dario.faggioli@citrix.com>
# Date 1350991102 25200
# Node ID 4ae12a96ec697f942600a78057bcb567f3312dca
# Parent  af87fb17adf38fcf8b2aec38356d9bc8cdcf3ebd
xen: sched: introduce a couple of counters in credit2 and SEDF

Mainly for consistency with credit, at least for the events that are
general enough, like vCPU initialization/destruction and calls
to the specific scheduling function.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r af87fb17adf3 -r 4ae12a96ec69 xen/common/sched_credit2.c
--- a/xen/common/sched_credit2.c	Tue Oct 23 04:17:16 2012 -0700
+++ b/xen/common/sched_credit2.c	Tue Oct 23 04:18:22 2012 -0700
@@ -753,6 +753,8 @@ csched_alloc_vdata(const struct schedule
         svc->weight = 0;
     }
 
+    SCHED_STAT_CRANK(vcpu_init);
+
     return svc;
 }
 
@@ -870,6 +872,8 @@ csched_vcpu_remove(const struct schedule
 
     if ( ! is_idle_vcpu(vc) )
     {
+        SCHED_STAT_CRANK(vcpu_destroy);
+
         /* Remove from runqueue */
         vcpu_schedule_lock_irq(vc);
 
@@ -1587,6 +1591,7 @@ csched_schedule(
     struct csched_vcpu *snext = NULL;
     struct task_slice ret;
 
+    SCHED_STAT_CRANK(schedule);
     CSCHED_VCPU_CHECK(current);
 
     d2printk("sc p%d c d%dv%d now %"PRI_stime"\n",
diff -r af87fb17adf3 -r 4ae12a96ec69 xen/common/sched_sedf.c
--- a/xen/common/sched_sedf.c	Tue Oct 23 04:17:16 2012 -0700
+++ b/xen/common/sched_sedf.c	Tue Oct 23 04:18:22 2012 -0700
@@ -332,6 +332,8 @@ static void *sedf_alloc_vdata(const stru
     INIT_LIST_HEAD(&(inf->extralist[EXTRA_PEN_Q]));
     INIT_LIST_HEAD(&(inf->extralist[EXTRA_UTIL_Q]));
 
+    SCHED_STAT_CRANK(vcpu_init);
+
     return inf;
 }
 
@@ -763,6 +765,8 @@ static struct task_slice sedf_do_schedul
     struct sedf_vcpu_info *runinf, *waitinf;
     struct task_slice      ret;
 
+    SCHED_STAT_CRANK(schedule);
+
     /* Idle tasks don't need any of the following stuf */
     if ( is_idle_vcpu(current) )
         goto check_waitq;

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

From xen-changelog-bounces@lists.xen.org Wed Oct 24 05:00:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 24 Oct 2012 05:00: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 1TQt4t-0001no-Lm; Wed, 24 Oct 2012 05:00:27 +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 1TQt4s-0001nd-Vn
	for xen-changelog@lists.xensource.com; Wed, 24 Oct 2012 05:00:27 +0000
Received: from [85.158.139.211:3257] by server-7.bemta-5.messagelabs.com id
	07/BF-23102-AE577805; Wed, 24 Oct 2012 05:00:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-206.messagelabs.com!1351054821!23458103!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22523 invoked from network); 24 Oct 2012 05:00:22 -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;
	24 Oct 2012 05:00:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQt4m-0005fK-P4
	for xen-changelog@lists.xensource.com; Wed, 24 Oct 2012 05:00:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQt4m-00041C-8g
	for xen-changelog@lists.xensource.com; Wed, 24 Oct 2012 05:00:20 +0000
Message-Id: <E1TQt4m-00041C-8g@xenbits.xen.org>
Date: Wed, 24 Oct 2012 05:00:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: sched: introduce a couple of
	counters in credit2 and SEDF
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dario Faggioli <dario.faggioli@citrix.com>
# Date 1350991102 25200
# Node ID 4ae12a96ec697f942600a78057bcb567f3312dca
# Parent  af87fb17adf38fcf8b2aec38356d9bc8cdcf3ebd
xen: sched: introduce a couple of counters in credit2 and SEDF

Mainly for consistency with credit, at least for the events that are
general enough, like vCPU initialization/destruction and calls
to the specific scheduling function.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r af87fb17adf3 -r 4ae12a96ec69 xen/common/sched_credit2.c
--- a/xen/common/sched_credit2.c	Tue Oct 23 04:17:16 2012 -0700
+++ b/xen/common/sched_credit2.c	Tue Oct 23 04:18:22 2012 -0700
@@ -753,6 +753,8 @@ csched_alloc_vdata(const struct schedule
         svc->weight = 0;
     }
 
+    SCHED_STAT_CRANK(vcpu_init);
+
     return svc;
 }
 
@@ -870,6 +872,8 @@ csched_vcpu_remove(const struct schedule
 
     if ( ! is_idle_vcpu(vc) )
     {
+        SCHED_STAT_CRANK(vcpu_destroy);
+
         /* Remove from runqueue */
         vcpu_schedule_lock_irq(vc);
 
@@ -1587,6 +1591,7 @@ csched_schedule(
     struct csched_vcpu *snext = NULL;
     struct task_slice ret;
 
+    SCHED_STAT_CRANK(schedule);
     CSCHED_VCPU_CHECK(current);
 
     d2printk("sc p%d c d%dv%d now %"PRI_stime"\n",
diff -r af87fb17adf3 -r 4ae12a96ec69 xen/common/sched_sedf.c
--- a/xen/common/sched_sedf.c	Tue Oct 23 04:17:16 2012 -0700
+++ b/xen/common/sched_sedf.c	Tue Oct 23 04:18:22 2012 -0700
@@ -332,6 +332,8 @@ static void *sedf_alloc_vdata(const stru
     INIT_LIST_HEAD(&(inf->extralist[EXTRA_PEN_Q]));
     INIT_LIST_HEAD(&(inf->extralist[EXTRA_UTIL_Q]));
 
+    SCHED_STAT_CRANK(vcpu_init);
+
     return inf;
 }
 
@@ -763,6 +765,8 @@ static struct task_slice sedf_do_schedul
     struct sedf_vcpu_info *runinf, *waitinf;
     struct task_slice      ret;
 
+    SCHED_STAT_CRANK(schedule);
+
     /* Idle tasks don't need any of the following stuf */
     if ( is_idle_vcpu(current) )
         goto check_waitq;

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

From xen-changelog-bounces@lists.xen.org Wed Oct 24 05:00:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 24 Oct 2012 05:00: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 1TQt4r-0001nX-J7; Wed, 24 Oct 2012 05:00:25 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQt4p-0001nO-Hs
	for xen-changelog@lists.xensource.com; Wed, 24 Oct 2012 05:00:23 +0000
Received: from [85.158.143.35:46725] by server-2.bemta-4.messagelabs.com id
	FB/39-22268-6E577805; Wed, 24 Oct 2012 05:00:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-21.messagelabs.com!1351054819!20046542!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19495 invoked from network); 24 Oct 2012 05:00:20 -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;
	24 Oct 2012 05:00:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQt4k-0005fB-UF
	for xen-changelog@lists.xensource.com; Wed, 24 Oct 2012 05:00:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQt4h-000400-CM
	for xen-changelog@lists.xensource.com; Wed, 24 Oct 2012 05:00:17 +0000
Message-Id: <E1TQt4h-000400-CM@xenbits.xen.org>
Date: Wed, 24 Oct 2012 05:00:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] vMCE: Implement AMD 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

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1350990654 25200
# Node ID 67c27013e191598543ccc1b8f8f1d533c7a5164b
# Parent  d642720e1ea996ce85203fc9718f64cf2cab0468
vMCE: Implement AMD MSRs

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


diff -r d642720e1ea9 -r 67c27013e191 xen/arch/x86/cpu/mcheck/amd_f10.c
--- a/xen/arch/x86/cpu/mcheck/amd_f10.c	Tue Oct 23 09:14:27 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/amd_f10.c	Tue Oct 23 04:10:54 2012 -0700
@@ -106,24 +106,43 @@ enum mcheck_type amd_f10_mcheck_init(str
 /* amd specific MCA MSR */
 int vmce_amd_wrmsr(struct vcpu *v, uint32_t msr, uint64_t val)
 {
-        switch (msr) {
-        case MSR_F10_MC4_MISC1:
-        case MSR_F10_MC4_MISC2:
-        case MSR_F10_MC4_MISC3:
-                break;
-        }
+	switch (msr) {
+	case MSR_F10_MC4_MISC1: /* DRAM error type */
+		v->arch.vmce.bank[1].mci_misc = val; 
+		mce_printk(MCE_VERBOSE, "MCE: wr msr %#"PRIx64"\n", val);
+		break;
+	case MSR_F10_MC4_MISC2: /* Link error type */
+	case MSR_F10_MC4_MISC3: /* L3 cache error type */
+		/* ignore write: we do not emulate link and l3 cache errors
+		 * to the guest.
+		 */
+		mce_printk(MCE_VERBOSE, "MCE: wr msr %#"PRIx64"\n", val);
+		break;
+	default:
+		return 0;
+	}
 
-        return 1;
+	return 1;
 }
 
 int vmce_amd_rdmsr(const struct vcpu *v, uint32_t msr, uint64_t *val)
 {
-        switch (msr) {
-        case MSR_F10_MC4_MISC1:
-        case MSR_F10_MC4_MISC2:
-        case MSR_F10_MC4_MISC3:
-                break;
-        }
+	switch (msr) {
+	case MSR_F10_MC4_MISC1: /* DRAM error type */
+		*val = v->arch.vmce.bank[1].mci_misc;
+		mce_printk(MCE_VERBOSE, "MCE: rd msr %#"PRIx64"\n", *val);
+		break;
+	case MSR_F10_MC4_MISC2: /* Link error type */
+	case MSR_F10_MC4_MISC3: /* L3 cache error type */
+		/* we do not emulate link and l3 cache
+		 * errors to the guest.
+		 */
+		*val = 0;
+		mce_printk(MCE_VERBOSE, "MCE: rd msr %#"PRIx64"\n", *val);
+		break;
+	default:
+		return 0;
+	}
 
-        return 1;
+	return 1;
 }

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

From xen-changelog-bounces@lists.xen.org Wed Oct 24 05:00:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 24 Oct 2012 05:00: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 1TQt4r-0001nX-J7; Wed, 24 Oct 2012 05:00:25 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQt4p-0001nO-Hs
	for xen-changelog@lists.xensource.com; Wed, 24 Oct 2012 05:00:23 +0000
Received: from [85.158.143.35:46725] by server-2.bemta-4.messagelabs.com id
	FB/39-22268-6E577805; Wed, 24 Oct 2012 05:00:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-21.messagelabs.com!1351054819!20046542!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19495 invoked from network); 24 Oct 2012 05:00:20 -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;
	24 Oct 2012 05:00:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQt4k-0005fB-UF
	for xen-changelog@lists.xensource.com; Wed, 24 Oct 2012 05:00:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQt4h-000400-CM
	for xen-changelog@lists.xensource.com; Wed, 24 Oct 2012 05:00:17 +0000
Message-Id: <E1TQt4h-000400-CM@xenbits.xen.org>
Date: Wed, 24 Oct 2012 05:00:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] vMCE: Implement AMD 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

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1350990654 25200
# Node ID 67c27013e191598543ccc1b8f8f1d533c7a5164b
# Parent  d642720e1ea996ce85203fc9718f64cf2cab0468
vMCE: Implement AMD MSRs

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


diff -r d642720e1ea9 -r 67c27013e191 xen/arch/x86/cpu/mcheck/amd_f10.c
--- a/xen/arch/x86/cpu/mcheck/amd_f10.c	Tue Oct 23 09:14:27 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/amd_f10.c	Tue Oct 23 04:10:54 2012 -0700
@@ -106,24 +106,43 @@ enum mcheck_type amd_f10_mcheck_init(str
 /* amd specific MCA MSR */
 int vmce_amd_wrmsr(struct vcpu *v, uint32_t msr, uint64_t val)
 {
-        switch (msr) {
-        case MSR_F10_MC4_MISC1:
-        case MSR_F10_MC4_MISC2:
-        case MSR_F10_MC4_MISC3:
-                break;
-        }
+	switch (msr) {
+	case MSR_F10_MC4_MISC1: /* DRAM error type */
+		v->arch.vmce.bank[1].mci_misc = val; 
+		mce_printk(MCE_VERBOSE, "MCE: wr msr %#"PRIx64"\n", val);
+		break;
+	case MSR_F10_MC4_MISC2: /* Link error type */
+	case MSR_F10_MC4_MISC3: /* L3 cache error type */
+		/* ignore write: we do not emulate link and l3 cache errors
+		 * to the guest.
+		 */
+		mce_printk(MCE_VERBOSE, "MCE: wr msr %#"PRIx64"\n", val);
+		break;
+	default:
+		return 0;
+	}
 
-        return 1;
+	return 1;
 }
 
 int vmce_amd_rdmsr(const struct vcpu *v, uint32_t msr, uint64_t *val)
 {
-        switch (msr) {
-        case MSR_F10_MC4_MISC1:
-        case MSR_F10_MC4_MISC2:
-        case MSR_F10_MC4_MISC3:
-                break;
-        }
+	switch (msr) {
+	case MSR_F10_MC4_MISC1: /* DRAM error type */
+		*val = v->arch.vmce.bank[1].mci_misc;
+		mce_printk(MCE_VERBOSE, "MCE: rd msr %#"PRIx64"\n", *val);
+		break;
+	case MSR_F10_MC4_MISC2: /* Link error type */
+	case MSR_F10_MC4_MISC3: /* L3 cache error type */
+		/* we do not emulate link and l3 cache
+		 * errors to the guest.
+		 */
+		*val = 0;
+		mce_printk(MCE_VERBOSE, "MCE: rd msr %#"PRIx64"\n", *val);
+		break;
+	default:
+		return 0;
+	}
 
-        return 1;
+	return 1;
 }

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

From xen-changelog-bounces@lists.xen.org Wed Oct 24 05:00:37 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 24 Oct 2012 05:00:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TQt4x-0001oF-OZ; Wed, 24 Oct 2012 05:00:31 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQt4w-0001o5-TV
	for xen-changelog@lists.xensource.com; Wed, 24 Oct 2012 05:00:31 +0000
Received: from [193.109.254.147:62842] by server-4.bemta-14.messagelabs.com id
	2A/11-04248-EE577805; Wed, 24 Oct 2012 05:00:30 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-27.messagelabs.com!1351054819!8571803!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26968 invoked from network); 24 Oct 2012 05:00:20 -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;
	24 Oct 2012 05:00:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQt4l-0005fE-EF
	for xen-changelog@lists.xensource.com; Wed, 24 Oct 2012 05:00:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQt4l-00040a-0q
	for xen-changelog@lists.xensource.com; Wed, 24 Oct 2012 05:00:19 +0000
Message-Id: <E1TQt4l-00040a-0q@xenbits.xen.org>
Date: Wed, 24 Oct 2012 05:00:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: fix build when 'perfc=y'
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dario Faggioli <dario.faggioli@citrix.com>
# Date 1350990742 25200
# Node ID 6d54c3338c52ec3a8e671c13284a59a535a3273f
# Parent  67c27013e191598543ccc1b8f8f1d533c7a5164b
xen: fix build when 'perfc=y'

Which was failing with this:

 viridian.c: In function ?wrmsr_viridian_regs?:
 viridian.c:254:1: error: ?PERFC_mshv_wrmsr_apic_msr? undeclared
 (first use in this function)
 viridian.c:254:1: note: each undeclared identifier is reported only
 once for each function it appears in
 viridian.c: In function ?rdmsr_viridian_regs?:
 viridian.c:305:1: error: ?PERFC_mshv_rdmsr_apic_msr? undeclared
 (first use in this function)

as a consequence of 17b754cab7b0 using but not defining
the counters.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 67c27013e191 -r 6d54c3338c52 xen/include/asm-x86/perfc_defn.h
--- a/xen/include/asm-x86/perfc_defn.h	Tue Oct 23 04:10:54 2012 -0700
+++ b/xen/include/asm-x86/perfc_defn.h	Tue Oct 23 04:12:22 2012 -0700
@@ -121,6 +121,7 @@ PERFCOUNTER(mshv_rdmsr_vp_index,        
 PERFCOUNTER(mshv_rdmsr_icr,             "MS Hv rdmsr icr")
 PERFCOUNTER(mshv_rdmsr_tpr,             "MS Hv rdmsr tpr")
 PERFCOUNTER(mshv_rdmsr_apic_assist,     "MS Hv rdmsr APIC assist")
+PERFCOUNTER(mshv_rdmsr_apic_msr,        "MS Hv rdmsr APIC msr")
 PERFCOUNTER(mshv_wrmsr_osid,            "MS Hv wrmsr Guest OS ID")
 PERFCOUNTER(mshv_wrmsr_hc_page,         "MS Hv wrmsr hypercall page")
 PERFCOUNTER(mshv_wrmsr_vp_index,        "MS Hv wrmsr vp index")
@@ -128,6 +129,7 @@ PERFCOUNTER(mshv_wrmsr_icr,             
 PERFCOUNTER(mshv_wrmsr_tpr,             "MS Hv wrmsr tpr")
 PERFCOUNTER(mshv_wrmsr_eoi,             "MS Hv wrmsr eoi")
 PERFCOUNTER(mshv_wrmsr_apic_assist,     "MS Hv wrmsr APIC assist")
+PERFCOUNTER(mshv_wrmsr_apic_msr,        "MS Hv wrmsr APIC msr")
 
 PERFCOUNTER(realmode_emulations, "realmode instructions emulated")
 PERFCOUNTER(realmode_exits,      "vmexits from realmode")

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

From xen-changelog-bounces@lists.xen.org Wed Oct 24 05:00:37 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 24 Oct 2012 05:00:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TQt4x-0001oF-OZ; Wed, 24 Oct 2012 05:00:31 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQt4w-0001o5-TV
	for xen-changelog@lists.xensource.com; Wed, 24 Oct 2012 05:00:31 +0000
Received: from [193.109.254.147:62842] by server-4.bemta-14.messagelabs.com id
	2A/11-04248-EE577805; Wed, 24 Oct 2012 05:00:30 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-27.messagelabs.com!1351054819!8571803!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26968 invoked from network); 24 Oct 2012 05:00:20 -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;
	24 Oct 2012 05:00:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQt4l-0005fE-EF
	for xen-changelog@lists.xensource.com; Wed, 24 Oct 2012 05:00:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQt4l-00040a-0q
	for xen-changelog@lists.xensource.com; Wed, 24 Oct 2012 05:00:19 +0000
Message-Id: <E1TQt4l-00040a-0q@xenbits.xen.org>
Date: Wed, 24 Oct 2012 05:00:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: fix build when 'perfc=y'
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dario Faggioli <dario.faggioli@citrix.com>
# Date 1350990742 25200
# Node ID 6d54c3338c52ec3a8e671c13284a59a535a3273f
# Parent  67c27013e191598543ccc1b8f8f1d533c7a5164b
xen: fix build when 'perfc=y'

Which was failing with this:

 viridian.c: In function ?wrmsr_viridian_regs?:
 viridian.c:254:1: error: ?PERFC_mshv_wrmsr_apic_msr? undeclared
 (first use in this function)
 viridian.c:254:1: note: each undeclared identifier is reported only
 once for each function it appears in
 viridian.c: In function ?rdmsr_viridian_regs?:
 viridian.c:305:1: error: ?PERFC_mshv_rdmsr_apic_msr? undeclared
 (first use in this function)

as a consequence of 17b754cab7b0 using but not defining
the counters.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 67c27013e191 -r 6d54c3338c52 xen/include/asm-x86/perfc_defn.h
--- a/xen/include/asm-x86/perfc_defn.h	Tue Oct 23 04:10:54 2012 -0700
+++ b/xen/include/asm-x86/perfc_defn.h	Tue Oct 23 04:12:22 2012 -0700
@@ -121,6 +121,7 @@ PERFCOUNTER(mshv_rdmsr_vp_index,        
 PERFCOUNTER(mshv_rdmsr_icr,             "MS Hv rdmsr icr")
 PERFCOUNTER(mshv_rdmsr_tpr,             "MS Hv rdmsr tpr")
 PERFCOUNTER(mshv_rdmsr_apic_assist,     "MS Hv rdmsr APIC assist")
+PERFCOUNTER(mshv_rdmsr_apic_msr,        "MS Hv rdmsr APIC msr")
 PERFCOUNTER(mshv_wrmsr_osid,            "MS Hv wrmsr Guest OS ID")
 PERFCOUNTER(mshv_wrmsr_hc_page,         "MS Hv wrmsr hypercall page")
 PERFCOUNTER(mshv_wrmsr_vp_index,        "MS Hv wrmsr vp index")
@@ -128,6 +129,7 @@ PERFCOUNTER(mshv_wrmsr_icr,             
 PERFCOUNTER(mshv_wrmsr_tpr,             "MS Hv wrmsr tpr")
 PERFCOUNTER(mshv_wrmsr_eoi,             "MS Hv wrmsr eoi")
 PERFCOUNTER(mshv_wrmsr_apic_assist,     "MS Hv wrmsr APIC assist")
+PERFCOUNTER(mshv_wrmsr_apic_msr,        "MS Hv wrmsr APIC msr")
 
 PERFCOUNTER(realmode_emulations, "realmode instructions emulated")
 PERFCOUNTER(realmode_exits,      "vmexits from realmode")

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

From xen-changelog-bounces@lists.xen.org Wed Oct 24 05:00:46 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 24 Oct 2012 05:00: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 1TQt5A-0001qf-UN; Wed, 24 Oct 2012 05:00:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQt59-0001qJ-S6
	for xen-changelog@lists.xensource.com; Wed, 24 Oct 2012 05:00:44 +0000
Received: from [85.158.139.83:53166] by server-4.bemta-5.messagelabs.com id
	4B/79-01455-BF577805; Wed, 24 Oct 2012 05:00:43 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1351054820!24469023!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG, UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8745 invoked from network); 24 Oct 2012 05:00:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	24 Oct 2012 05:00:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQt4l-0005fH-Tn
	for xen-changelog@lists.xensource.com; Wed, 24 Oct 2012 05:00:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQt4l-00040t-M6
	for xen-changelog@lists.xensource.com; Wed, 24 Oct 2012 05:00:19 +0000
Message-Id: <E1TQt4l-00040t-M6@xenbits.xen.org>
Date: Wed, 24 Oct 2012 05:00:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: sched: generalize scheduling
	related perfcounter macros
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dario Faggioli <dario.faggioli@citrix.com>
# Date 1350991036 25200
# Node ID af87fb17adf38fcf8b2aec38356d9bc8cdcf3ebd
# Parent  6d54c3338c52ec3a8e671c13284a59a535a3273f
xen: sched: generalize scheduling related perfcounter macros

Moving some of them from sched_credit.c to generic scheduler code.
This also allows the other schedulers to use perf counters equally
easy.

This change is mainly preparatory work for what stated above. In fact,
it mostly does s/CSCHED_STAT/SCHED_STAT/, and, in general, it implies
no functional changes.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 6d54c3338c52 -r af87fb17adf3 xen/common/sched_credit.c
--- a/xen/common/sched_credit.c	Tue Oct 23 04:12:22 2012 -0700
+++ b/xen/common/sched_credit.c	Tue Oct 23 04:17:16 2012 -0700
@@ -16,25 +16,12 @@
 #include <xen/delay.h>
 #include <xen/event.h>
 #include <xen/time.h>
-#include <xen/perfc.h>
 #include <xen/sched-if.h>
 #include <xen/softirq.h>
 #include <asm/atomic.h>
 #include <xen/errno.h>
 #include <xen/keyhandler.h>
 
-/*
- * CSCHED_STATS
- *
- * Manage very basic per-vCPU counters and stats.
- *
- * Useful for debugging live systems. The stats are displayed
- * with runq dumps ('r' on the Xen console).
- */
-#ifdef PERF_COUNTERS
-#define CSCHED_STATS
-#endif
-
 
 /*
  * Basic constants
@@ -75,29 +62,36 @@
 
 
 /*
- * Stats
+ * CSCHED_STATS
+ *
+ * Manage very basic per-vCPU counters and stats.
+ *
+ * Useful for debugging live systems. The stats are displayed
+ * with runq dumps ('r' on the Xen console).
  */
-#define CSCHED_STAT_CRANK(_X)               (perfc_incr(_X))
+#ifdef SCHED_STATS
 
-#ifdef CSCHED_STATS
+#define CSCHED_STATS
 
-#define CSCHED_VCPU_STATS_RESET(_V)                     \
+#define SCHED_VCPU_STATS_RESET(_V)                      \
     do                                                  \
     {                                                   \
         memset(&(_V)->stats, 0, sizeof((_V)->stats));   \
     } while ( 0 )
 
-#define CSCHED_VCPU_STAT_CRANK(_V, _X)      (((_V)->stats._X)++)
+#define SCHED_VCPU_STAT_CRANK(_V, _X)       (((_V)->stats._X)++)
 
-#define CSCHED_VCPU_STAT_SET(_V, _X, _Y)    (((_V)->stats._X) = (_Y))
+#define SCHED_VCPU_STAT_SET(_V, _X, _Y)     (((_V)->stats._X) = (_Y))
 
-#else /* CSCHED_STATS */
+#else /* !SCHED_STATS */
 
-#define CSCHED_VCPU_STATS_RESET(_V)         do {} while ( 0 )
-#define CSCHED_VCPU_STAT_CRANK(_V, _X)      do {} while ( 0 )
-#define CSCHED_VCPU_STAT_SET(_V, _X, _Y)    do {} while ( 0 )
+#undef CSCHED_STATS
 
-#endif /* CSCHED_STATS */
+#define SCHED_VCPU_STATS_RESET(_V)         do {} while ( 0 )
+#define SCHED_VCPU_STAT_CRANK(_V, _X)      do {} while ( 0 )
+#define SCHED_VCPU_STAT_SET(_V, _X, _Y)    do {} while ( 0 )
+
+#endif /* SCHED_STATS */
 
 
 /*
@@ -264,13 +258,13 @@ __runq_tickle(unsigned int cpu, struct c
     if ( new->pri > cur->pri )
     {
         if ( cur->pri == CSCHED_PRI_IDLE )
-            CSCHED_STAT_CRANK(tickle_local_idler);
+            SCHED_STAT_CRANK(tickle_local_idler);
         else if ( cur->pri == CSCHED_PRI_TS_OVER )
-            CSCHED_STAT_CRANK(tickle_local_over);
+            SCHED_STAT_CRANK(tickle_local_over);
         else if ( cur->pri == CSCHED_PRI_TS_UNDER )
-            CSCHED_STAT_CRANK(tickle_local_under);
+            SCHED_STAT_CRANK(tickle_local_under);
         else
-            CSCHED_STAT_CRANK(tickle_local_other);
+            SCHED_STAT_CRANK(tickle_local_other);
 
         cpumask_set_cpu(cpu, &mask);
     }
@@ -283,7 +277,7 @@ __runq_tickle(unsigned int cpu, struct c
     {
         if ( cpumask_empty(prv->idlers) )
         {
-            CSCHED_STAT_CRANK(tickle_idlers_none);
+            SCHED_STAT_CRANK(tickle_idlers_none);
         }
         else
         {
@@ -292,7 +286,7 @@ __runq_tickle(unsigned int cpu, struct c
             cpumask_and(&idle_mask, prv->idlers, new->vcpu->cpu_affinity);
             if ( !cpumask_empty(&idle_mask) )
             {
-                CSCHED_STAT_CRANK(tickle_idlers_some);
+                SCHED_STAT_CRANK(tickle_idlers_some);
                 if ( opt_tickle_one_idle )
                 {
                     this_cpu(last_tickle_cpu) = 
@@ -404,7 +398,7 @@ __csched_vcpu_check(struct vcpu *vc)
         BUG_ON( !is_idle_vcpu(vc) );
     }
 
-    CSCHED_STAT_CRANK(vcpu_check);
+    SCHED_STAT_CRANK(vcpu_check);
 }
 #define CSCHED_VCPU_CHECK(_vc)  (__csched_vcpu_check(_vc))
 #else
@@ -437,7 +431,7 @@ __csched_vcpu_is_cache_hot(struct vcpu *
                ((uint64_t)vcpu_migration_delay * 1000u));
 
     if ( hot )
-        CSCHED_STAT_CRANK(vcpu_hot);
+        SCHED_STAT_CRANK(vcpu_hot);
 
     return hot;
 }
@@ -559,8 +553,8 @@ __csched_vcpu_acct_start(struct csched_p
 
     if ( list_empty(&svc->active_vcpu_elem) )
     {
-        CSCHED_VCPU_STAT_CRANK(svc, state_active);
-        CSCHED_STAT_CRANK(acct_vcpu_active);
+        SCHED_VCPU_STAT_CRANK(svc, state_active);
+        SCHED_STAT_CRANK(acct_vcpu_active);
 
         sdom->active_vcpu_count++;
         list_add(&svc->active_vcpu_elem, &sdom->active_vcpu);
@@ -583,8 +577,8 @@ __csched_vcpu_acct_stop_locked(struct cs
 
     BUG_ON( list_empty(&svc->active_vcpu_elem) );
 
-    CSCHED_VCPU_STAT_CRANK(svc, state_idle);
-    CSCHED_STAT_CRANK(acct_vcpu_idle);
+    SCHED_VCPU_STAT_CRANK(svc, state_idle);
+    SCHED_STAT_CRANK(acct_vcpu_idle);
 
     BUG_ON( prv->weight < sdom->weight );
     sdom->active_vcpu_count--;
@@ -633,8 +627,8 @@ csched_vcpu_acct(struct csched_private *
     }
     else if ( _csched_cpu_pick(ops, current, 0) != cpu )
     {
-        CSCHED_VCPU_STAT_CRANK(svc, migrate_r);
-        CSCHED_STAT_CRANK(migrate_running);
+        SCHED_VCPU_STAT_CRANK(svc, migrate_r);
+        SCHED_STAT_CRANK(migrate_running);
         set_bit(_VPF_migrating, &current->pause_flags);
         cpu_raise_softirq(cpu, SCHEDULE_SOFTIRQ);
     }
@@ -658,8 +652,8 @@ csched_alloc_vdata(const struct schedule
     svc->flags = 0U;
     svc->pri = is_idle_domain(vc->domain) ?
         CSCHED_PRI_IDLE : CSCHED_PRI_TS_UNDER;
-    CSCHED_VCPU_STATS_RESET(svc);
-    CSCHED_STAT_CRANK(vcpu_init);
+    SCHED_VCPU_STATS_RESET(svc);
+    SCHED_STAT_CRANK(vcpu_init);
     return svc;
 }
 
@@ -690,7 +684,7 @@ csched_vcpu_remove(const struct schedule
     struct csched_dom * const sdom = svc->sdom;
     unsigned long flags;
 
-    CSCHED_STAT_CRANK(vcpu_destroy);
+    SCHED_STAT_CRANK(vcpu_destroy);
 
     if ( __vcpu_on_runq(svc) )
         __runq_remove(svc);
@@ -711,7 +705,7 @@ csched_vcpu_sleep(const struct scheduler
 {
     struct csched_vcpu * const svc = CSCHED_VCPU(vc);
 
-    CSCHED_STAT_CRANK(vcpu_sleep);
+    SCHED_STAT_CRANK(vcpu_sleep);
 
     BUG_ON( is_idle_vcpu(vc) );
 
@@ -731,19 +725,19 @@ csched_vcpu_wake(const struct scheduler 
 
     if ( unlikely(per_cpu(schedule_data, cpu).curr == vc) )
     {
-        CSCHED_STAT_CRANK(vcpu_wake_running);
+        SCHED_STAT_CRANK(vcpu_wake_running);
         return;
     }
     if ( unlikely(__vcpu_on_runq(svc)) )
     {
-        CSCHED_STAT_CRANK(vcpu_wake_onrunq);
+        SCHED_STAT_CRANK(vcpu_wake_onrunq);
         return;
     }
 
     if ( likely(vcpu_runnable(vc)) )
-        CSCHED_STAT_CRANK(vcpu_wake_runnable);
+        SCHED_STAT_CRANK(vcpu_wake_runnable);
     else
-        CSCHED_STAT_CRANK(vcpu_wake_not_runnable);
+        SCHED_STAT_CRANK(vcpu_wake_not_runnable);
 
     /*
      * We temporarly boost the priority of awaking VCPUs!
@@ -883,8 +877,6 @@ csched_dom_init(const struct scheduler *
 {
     struct csched_dom *sdom;
 
-    CSCHED_STAT_CRANK(dom_init);
-
     if ( is_idle_domain(dom) )
         return 0;
 
@@ -906,7 +898,6 @@ csched_free_domdata(const struct schedul
 static void
 csched_dom_destroy(const struct scheduler *ops, struct domain *dom)
 {
-    CSCHED_STAT_CRANK(dom_destroy);
     csched_free_domdata(ops, CSCHED_DOM(dom));
 }
 
@@ -989,18 +980,18 @@ csched_acct(void* dummy)
     if ( prv->credit_balance < 0 )
     {
         credit_total -= prv->credit_balance;
-        CSCHED_STAT_CRANK(acct_balance);
+        SCHED_STAT_CRANK(acct_balance);
     }
 
     if ( unlikely(weight_total == 0) )
     {
         prv->credit_balance = 0;
         spin_unlock_irqrestore(&prv->lock, flags);
-        CSCHED_STAT_CRANK(acct_no_work);
+        SCHED_STAT_CRANK(acct_no_work);
         goto out;
     }
 
-    CSCHED_STAT_CRANK(acct_run);
+    SCHED_STAT_CRANK(acct_run);
 
     weight_left = weight_total;
     credit_balance = 0;
@@ -1075,7 +1066,7 @@ csched_acct(void* dummy)
                  * the queue to give others a chance at them in future
                  * accounting periods.
                  */
-                CSCHED_STAT_CRANK(acct_reorder);
+                SCHED_STAT_CRANK(acct_reorder);
                 list_del(&sdom->active_sdom_elem);
                 list_add(&sdom->active_sdom_elem, &prv->active_sdom);
             }
@@ -1110,7 +1101,7 @@ csched_acct(void* dummy)
                      credit < -credit_cap &&
                      !(svc->flags & CSCHED_FLAG_VCPU_PARKED) )
                 {
-                    CSCHED_STAT_CRANK(vcpu_park);
+                    SCHED_STAT_CRANK(vcpu_park);
                     vcpu_pause_nosync(svc->vcpu);
                     svc->flags |= CSCHED_FLAG_VCPU_PARKED;
                 }
@@ -1118,7 +1109,7 @@ csched_acct(void* dummy)
                 /* Lower bound on credits */
                 if ( credit < -prv->credits_per_tslice )
                 {
-                    CSCHED_STAT_CRANK(acct_min_credit);
+                    SCHED_STAT_CRANK(acct_min_credit);
                     credit = -prv->credits_per_tslice;
                     atomic_set(&svc->credit, credit);
                 }
@@ -1135,7 +1126,7 @@ csched_acct(void* dummy)
                      * call to make sure the VCPU's priority is not boosted
                      * if it is woken up here.
                      */
-                    CSCHED_STAT_CRANK(vcpu_unpark);
+                    SCHED_STAT_CRANK(vcpu_unpark);
                     vcpu_unpause(svc->vcpu);
                     svc->flags &= ~CSCHED_FLAG_VCPU_PARKED;
                 }
@@ -1151,8 +1142,8 @@ csched_acct(void* dummy)
                 }
             }
 
-            CSCHED_VCPU_STAT_SET(svc, credit_last, credit);
-            CSCHED_VCPU_STAT_SET(svc, credit_incr, credit_fair);
+            SCHED_VCPU_STAT_SET(svc, credit_last, credit);
+            SCHED_VCPU_STAT_SET(svc, credit_incr, credit_fair);
             credit_balance += credit;
         }
     }
@@ -1229,8 +1220,8 @@ csched_runq_steal(int peer_cpu, int cpu,
             if (__csched_vcpu_is_migrateable(vc, cpu))
             {
                 /* We got a candidate. Grab it! */
-                CSCHED_VCPU_STAT_CRANK(speer, migrate_q);
-                CSCHED_STAT_CRANK(migrate_queued);
+                SCHED_VCPU_STAT_CRANK(speer, migrate_q);
+                SCHED_STAT_CRANK(migrate_queued);
                 WARN_ON(vc->is_urgent);
                 __runq_remove(speer);
                 vc->processor = cpu;
@@ -1239,7 +1230,7 @@ csched_runq_steal(int peer_cpu, int cpu,
         }
     }
 
-    CSCHED_STAT_CRANK(steal_peer_idle);
+    SCHED_STAT_CRANK(steal_peer_idle);
     return NULL;
 }
 
@@ -1260,11 +1251,11 @@ csched_load_balance(struct csched_privat
         goto out;
 
     if ( snext->pri == CSCHED_PRI_IDLE )
-        CSCHED_STAT_CRANK(load_balance_idle);
+        SCHED_STAT_CRANK(load_balance_idle);
     else if ( snext->pri == CSCHED_PRI_TS_OVER )
-        CSCHED_STAT_CRANK(load_balance_over);
+        SCHED_STAT_CRANK(load_balance_over);
     else
-        CSCHED_STAT_CRANK(load_balance_other);
+        SCHED_STAT_CRANK(load_balance_other);
 
     /*
      * Peek at non-idling CPUs in the system, starting with our
@@ -1288,7 +1279,7 @@ csched_load_balance(struct csched_privat
          */
         if ( !pcpu_schedule_trylock(peer_cpu) )
         {
-            CSCHED_STAT_CRANK(steal_trylock_failed);
+            SCHED_STAT_CRANK(steal_trylock_failed);
             continue;
         }
 
@@ -1327,7 +1318,7 @@ csched_schedule(
     struct task_slice ret;
     s_time_t runtime, tslice;
 
-    CSCHED_STAT_CRANK(schedule);
+    SCHED_STAT_CRANK(schedule);
     CSCHED_VCPU_CHECK(current);
 
     runtime = now - current->runstate.state_entry_time;
diff -r 6d54c3338c52 -r af87fb17adf3 xen/common/schedule.c
--- a/xen/common/schedule.c	Tue Oct 23 04:12:22 2012 -0700
+++ b/xen/common/schedule.c	Tue Oct 23 04:17:16 2012 -0700
@@ -312,11 +312,13 @@ void sched_destroy_vcpu(struct vcpu *v)
 
 int sched_init_domain(struct domain *d)
 {
+    SCHED_STAT_CRANK(dom_init);
     return SCHED_OP(DOM2OP(d), init_domain, d);
 }
 
 void sched_destroy_domain(struct domain *d)
 {
+    SCHED_STAT_CRANK(dom_destroy);
     SCHED_OP(DOM2OP(d), destroy_domain, d);
 }
 
@@ -1084,7 +1086,7 @@ static void schedule(void)
 
     ASSERT(!in_atomic());
 
-    perfc_incr(sched_run);
+    SCHED_STAT_CRANK(sched_run);
 
     sd = &this_cpu(schedule_data);
 
@@ -1162,7 +1164,7 @@ static void schedule(void)
 
     pcpu_schedule_unlock_irq(cpu);
 
-    perfc_incr(sched_ctx);
+    SCHED_STAT_CRANK(sched_ctx);
 
     stop_timer(&prev->periodic_timer);
 
@@ -1196,7 +1198,7 @@ void context_saved(struct vcpu *prev)
 static void s_timer_fn(void *unused)
 {
     raise_softirq(SCHEDULE_SOFTIRQ);
-    perfc_incr(sched_irq);
+    SCHED_STAT_CRANK(sched_irq);
 }
 
 /* Per-VCPU periodic timer function: sends a virtual timer interrupt. */
diff -r 6d54c3338c52 -r af87fb17adf3 xen/include/xen/perfc_defn.h
--- a/xen/include/xen/perfc_defn.h	Tue Oct 23 04:12:22 2012 -0700
+++ b/xen/include/xen/perfc_defn.h	Tue Oct 23 04:17:16 2012 -0700
@@ -12,13 +12,19 @@ PERFCOUNTER(calls_from_multicall,       
 PERFCOUNTER(irqs,                   "#interrupts")
 PERFCOUNTER(ipis,                   "#IPIs")
 
+/* Generic scheduler counters (applicable to all schedulers) */
 PERFCOUNTER(sched_irq,              "sched: timer")
 PERFCOUNTER(sched_run,              "sched: runs through scheduler")
 PERFCOUNTER(sched_ctx,              "sched: context switches")
+PERFCOUNTER(schedule,               "sched: specific scheduler")
+PERFCOUNTER(dom_init,               "sched: dom_init")
+PERFCOUNTER(dom_destroy,            "sched: dom_destroy")
+PERFCOUNTER(vcpu_init,              "sched: vcpu_init")
+PERFCOUNTER(vcpu_destroy,           "sched: vcpu_destroy")
 
+/* credit specific counters */
 PERFCOUNTER(delay_ms,               "csched: delay")
 PERFCOUNTER(vcpu_check,             "csched: vcpu_check")
-PERFCOUNTER(schedule,               "csched: schedule")
 PERFCOUNTER(acct_run,               "csched: acct_run")
 PERFCOUNTER(acct_no_work,           "csched: acct_no_work")
 PERFCOUNTER(acct_balance,           "csched: acct_balance")
@@ -46,10 +52,6 @@ PERFCOUNTER(steal_trylock_failed,   "csc
 PERFCOUNTER(steal_peer_idle,        "csched: steal_peer_idle")
 PERFCOUNTER(migrate_queued,         "csched: migrate_queued")
 PERFCOUNTER(migrate_running,        "csched: migrate_running")
-PERFCOUNTER(dom_init,               "csched: dom_init")
-PERFCOUNTER(dom_destroy,            "csched: dom_destroy")
-PERFCOUNTER(vcpu_init,              "csched: vcpu_init")
-PERFCOUNTER(vcpu_destroy,           "csched: vcpu_destroy")
 PERFCOUNTER(vcpu_hot,               "csched: vcpu_hot")
 
 PERFCOUNTER(need_flush_tlb_flush,   "PG_need_flush tlb flushes")
diff -r 6d54c3338c52 -r af87fb17adf3 xen/include/xen/sched.h
--- a/xen/include/xen/sched.h	Tue Oct 23 04:12:22 2012 -0700
+++ b/xen/include/xen/sched.h	Tue Oct 23 04:17:16 2012 -0700
@@ -16,6 +16,7 @@
 #include <xen/tasklet.h>
 #include <xen/mm.h>
 #include <xen/smp.h>
+#include <xen/perfc.h>
 #include <asm/atomic.h>
 #include <xen/wait.h>
 #include <public/xen.h>
@@ -29,6 +30,18 @@
 DEFINE_XEN_GUEST_HANDLE(vcpu_runstate_info_compat_t);
 #endif
 
+/*
+ * Stats
+ *
+ * Enable and ease the use of scheduling related performance counters.
+ *
+ */
+#ifdef PERF_COUNTERS
+#define SCHED_STATS
+#endif
+
+#define SCHED_STAT_CRANK(_X)                (perfc_incr(_X))
+
 /* A global pointer to the initial domain (DOM0). */
 extern struct domain *dom0;
 

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

From xen-changelog-bounces@lists.xen.org Wed Oct 24 05:00:46 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 24 Oct 2012 05:00: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 1TQt5A-0001qf-UN; Wed, 24 Oct 2012 05:00:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQt59-0001qJ-S6
	for xen-changelog@lists.xensource.com; Wed, 24 Oct 2012 05:00:44 +0000
Received: from [85.158.139.83:53166] by server-4.bemta-5.messagelabs.com id
	4B/79-01455-BF577805; Wed, 24 Oct 2012 05:00:43 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1351054820!24469023!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG, UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8745 invoked from network); 24 Oct 2012 05:00:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	24 Oct 2012 05:00:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQt4l-0005fH-Tn
	for xen-changelog@lists.xensource.com; Wed, 24 Oct 2012 05:00:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQt4l-00040t-M6
	for xen-changelog@lists.xensource.com; Wed, 24 Oct 2012 05:00:19 +0000
Message-Id: <E1TQt4l-00040t-M6@xenbits.xen.org>
Date: Wed, 24 Oct 2012 05:00:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: sched: generalize scheduling
	related perfcounter macros
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dario Faggioli <dario.faggioli@citrix.com>
# Date 1350991036 25200
# Node ID af87fb17adf38fcf8b2aec38356d9bc8cdcf3ebd
# Parent  6d54c3338c52ec3a8e671c13284a59a535a3273f
xen: sched: generalize scheduling related perfcounter macros

Moving some of them from sched_credit.c to generic scheduler code.
This also allows the other schedulers to use perf counters equally
easy.

This change is mainly preparatory work for what stated above. In fact,
it mostly does s/CSCHED_STAT/SCHED_STAT/, and, in general, it implies
no functional changes.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 6d54c3338c52 -r af87fb17adf3 xen/common/sched_credit.c
--- a/xen/common/sched_credit.c	Tue Oct 23 04:12:22 2012 -0700
+++ b/xen/common/sched_credit.c	Tue Oct 23 04:17:16 2012 -0700
@@ -16,25 +16,12 @@
 #include <xen/delay.h>
 #include <xen/event.h>
 #include <xen/time.h>
-#include <xen/perfc.h>
 #include <xen/sched-if.h>
 #include <xen/softirq.h>
 #include <asm/atomic.h>
 #include <xen/errno.h>
 #include <xen/keyhandler.h>
 
-/*
- * CSCHED_STATS
- *
- * Manage very basic per-vCPU counters and stats.
- *
- * Useful for debugging live systems. The stats are displayed
- * with runq dumps ('r' on the Xen console).
- */
-#ifdef PERF_COUNTERS
-#define CSCHED_STATS
-#endif
-
 
 /*
  * Basic constants
@@ -75,29 +62,36 @@
 
 
 /*
- * Stats
+ * CSCHED_STATS
+ *
+ * Manage very basic per-vCPU counters and stats.
+ *
+ * Useful for debugging live systems. The stats are displayed
+ * with runq dumps ('r' on the Xen console).
  */
-#define CSCHED_STAT_CRANK(_X)               (perfc_incr(_X))
+#ifdef SCHED_STATS
 
-#ifdef CSCHED_STATS
+#define CSCHED_STATS
 
-#define CSCHED_VCPU_STATS_RESET(_V)                     \
+#define SCHED_VCPU_STATS_RESET(_V)                      \
     do                                                  \
     {                                                   \
         memset(&(_V)->stats, 0, sizeof((_V)->stats));   \
     } while ( 0 )
 
-#define CSCHED_VCPU_STAT_CRANK(_V, _X)      (((_V)->stats._X)++)
+#define SCHED_VCPU_STAT_CRANK(_V, _X)       (((_V)->stats._X)++)
 
-#define CSCHED_VCPU_STAT_SET(_V, _X, _Y)    (((_V)->stats._X) = (_Y))
+#define SCHED_VCPU_STAT_SET(_V, _X, _Y)     (((_V)->stats._X) = (_Y))
 
-#else /* CSCHED_STATS */
+#else /* !SCHED_STATS */
 
-#define CSCHED_VCPU_STATS_RESET(_V)         do {} while ( 0 )
-#define CSCHED_VCPU_STAT_CRANK(_V, _X)      do {} while ( 0 )
-#define CSCHED_VCPU_STAT_SET(_V, _X, _Y)    do {} while ( 0 )
+#undef CSCHED_STATS
 
-#endif /* CSCHED_STATS */
+#define SCHED_VCPU_STATS_RESET(_V)         do {} while ( 0 )
+#define SCHED_VCPU_STAT_CRANK(_V, _X)      do {} while ( 0 )
+#define SCHED_VCPU_STAT_SET(_V, _X, _Y)    do {} while ( 0 )
+
+#endif /* SCHED_STATS */
 
 
 /*
@@ -264,13 +258,13 @@ __runq_tickle(unsigned int cpu, struct c
     if ( new->pri > cur->pri )
     {
         if ( cur->pri == CSCHED_PRI_IDLE )
-            CSCHED_STAT_CRANK(tickle_local_idler);
+            SCHED_STAT_CRANK(tickle_local_idler);
         else if ( cur->pri == CSCHED_PRI_TS_OVER )
-            CSCHED_STAT_CRANK(tickle_local_over);
+            SCHED_STAT_CRANK(tickle_local_over);
         else if ( cur->pri == CSCHED_PRI_TS_UNDER )
-            CSCHED_STAT_CRANK(tickle_local_under);
+            SCHED_STAT_CRANK(tickle_local_under);
         else
-            CSCHED_STAT_CRANK(tickle_local_other);
+            SCHED_STAT_CRANK(tickle_local_other);
 
         cpumask_set_cpu(cpu, &mask);
     }
@@ -283,7 +277,7 @@ __runq_tickle(unsigned int cpu, struct c
     {
         if ( cpumask_empty(prv->idlers) )
         {
-            CSCHED_STAT_CRANK(tickle_idlers_none);
+            SCHED_STAT_CRANK(tickle_idlers_none);
         }
         else
         {
@@ -292,7 +286,7 @@ __runq_tickle(unsigned int cpu, struct c
             cpumask_and(&idle_mask, prv->idlers, new->vcpu->cpu_affinity);
             if ( !cpumask_empty(&idle_mask) )
             {
-                CSCHED_STAT_CRANK(tickle_idlers_some);
+                SCHED_STAT_CRANK(tickle_idlers_some);
                 if ( opt_tickle_one_idle )
                 {
                     this_cpu(last_tickle_cpu) = 
@@ -404,7 +398,7 @@ __csched_vcpu_check(struct vcpu *vc)
         BUG_ON( !is_idle_vcpu(vc) );
     }
 
-    CSCHED_STAT_CRANK(vcpu_check);
+    SCHED_STAT_CRANK(vcpu_check);
 }
 #define CSCHED_VCPU_CHECK(_vc)  (__csched_vcpu_check(_vc))
 #else
@@ -437,7 +431,7 @@ __csched_vcpu_is_cache_hot(struct vcpu *
                ((uint64_t)vcpu_migration_delay * 1000u));
 
     if ( hot )
-        CSCHED_STAT_CRANK(vcpu_hot);
+        SCHED_STAT_CRANK(vcpu_hot);
 
     return hot;
 }
@@ -559,8 +553,8 @@ __csched_vcpu_acct_start(struct csched_p
 
     if ( list_empty(&svc->active_vcpu_elem) )
     {
-        CSCHED_VCPU_STAT_CRANK(svc, state_active);
-        CSCHED_STAT_CRANK(acct_vcpu_active);
+        SCHED_VCPU_STAT_CRANK(svc, state_active);
+        SCHED_STAT_CRANK(acct_vcpu_active);
 
         sdom->active_vcpu_count++;
         list_add(&svc->active_vcpu_elem, &sdom->active_vcpu);
@@ -583,8 +577,8 @@ __csched_vcpu_acct_stop_locked(struct cs
 
     BUG_ON( list_empty(&svc->active_vcpu_elem) );
 
-    CSCHED_VCPU_STAT_CRANK(svc, state_idle);
-    CSCHED_STAT_CRANK(acct_vcpu_idle);
+    SCHED_VCPU_STAT_CRANK(svc, state_idle);
+    SCHED_STAT_CRANK(acct_vcpu_idle);
 
     BUG_ON( prv->weight < sdom->weight );
     sdom->active_vcpu_count--;
@@ -633,8 +627,8 @@ csched_vcpu_acct(struct csched_private *
     }
     else if ( _csched_cpu_pick(ops, current, 0) != cpu )
     {
-        CSCHED_VCPU_STAT_CRANK(svc, migrate_r);
-        CSCHED_STAT_CRANK(migrate_running);
+        SCHED_VCPU_STAT_CRANK(svc, migrate_r);
+        SCHED_STAT_CRANK(migrate_running);
         set_bit(_VPF_migrating, &current->pause_flags);
         cpu_raise_softirq(cpu, SCHEDULE_SOFTIRQ);
     }
@@ -658,8 +652,8 @@ csched_alloc_vdata(const struct schedule
     svc->flags = 0U;
     svc->pri = is_idle_domain(vc->domain) ?
         CSCHED_PRI_IDLE : CSCHED_PRI_TS_UNDER;
-    CSCHED_VCPU_STATS_RESET(svc);
-    CSCHED_STAT_CRANK(vcpu_init);
+    SCHED_VCPU_STATS_RESET(svc);
+    SCHED_STAT_CRANK(vcpu_init);
     return svc;
 }
 
@@ -690,7 +684,7 @@ csched_vcpu_remove(const struct schedule
     struct csched_dom * const sdom = svc->sdom;
     unsigned long flags;
 
-    CSCHED_STAT_CRANK(vcpu_destroy);
+    SCHED_STAT_CRANK(vcpu_destroy);
 
     if ( __vcpu_on_runq(svc) )
         __runq_remove(svc);
@@ -711,7 +705,7 @@ csched_vcpu_sleep(const struct scheduler
 {
     struct csched_vcpu * const svc = CSCHED_VCPU(vc);
 
-    CSCHED_STAT_CRANK(vcpu_sleep);
+    SCHED_STAT_CRANK(vcpu_sleep);
 
     BUG_ON( is_idle_vcpu(vc) );
 
@@ -731,19 +725,19 @@ csched_vcpu_wake(const struct scheduler 
 
     if ( unlikely(per_cpu(schedule_data, cpu).curr == vc) )
     {
-        CSCHED_STAT_CRANK(vcpu_wake_running);
+        SCHED_STAT_CRANK(vcpu_wake_running);
         return;
     }
     if ( unlikely(__vcpu_on_runq(svc)) )
     {
-        CSCHED_STAT_CRANK(vcpu_wake_onrunq);
+        SCHED_STAT_CRANK(vcpu_wake_onrunq);
         return;
     }
 
     if ( likely(vcpu_runnable(vc)) )
-        CSCHED_STAT_CRANK(vcpu_wake_runnable);
+        SCHED_STAT_CRANK(vcpu_wake_runnable);
     else
-        CSCHED_STAT_CRANK(vcpu_wake_not_runnable);
+        SCHED_STAT_CRANK(vcpu_wake_not_runnable);
 
     /*
      * We temporarly boost the priority of awaking VCPUs!
@@ -883,8 +877,6 @@ csched_dom_init(const struct scheduler *
 {
     struct csched_dom *sdom;
 
-    CSCHED_STAT_CRANK(dom_init);
-
     if ( is_idle_domain(dom) )
         return 0;
 
@@ -906,7 +898,6 @@ csched_free_domdata(const struct schedul
 static void
 csched_dom_destroy(const struct scheduler *ops, struct domain *dom)
 {
-    CSCHED_STAT_CRANK(dom_destroy);
     csched_free_domdata(ops, CSCHED_DOM(dom));
 }
 
@@ -989,18 +980,18 @@ csched_acct(void* dummy)
     if ( prv->credit_balance < 0 )
     {
         credit_total -= prv->credit_balance;
-        CSCHED_STAT_CRANK(acct_balance);
+        SCHED_STAT_CRANK(acct_balance);
     }
 
     if ( unlikely(weight_total == 0) )
     {
         prv->credit_balance = 0;
         spin_unlock_irqrestore(&prv->lock, flags);
-        CSCHED_STAT_CRANK(acct_no_work);
+        SCHED_STAT_CRANK(acct_no_work);
         goto out;
     }
 
-    CSCHED_STAT_CRANK(acct_run);
+    SCHED_STAT_CRANK(acct_run);
 
     weight_left = weight_total;
     credit_balance = 0;
@@ -1075,7 +1066,7 @@ csched_acct(void* dummy)
                  * the queue to give others a chance at them in future
                  * accounting periods.
                  */
-                CSCHED_STAT_CRANK(acct_reorder);
+                SCHED_STAT_CRANK(acct_reorder);
                 list_del(&sdom->active_sdom_elem);
                 list_add(&sdom->active_sdom_elem, &prv->active_sdom);
             }
@@ -1110,7 +1101,7 @@ csched_acct(void* dummy)
                      credit < -credit_cap &&
                      !(svc->flags & CSCHED_FLAG_VCPU_PARKED) )
                 {
-                    CSCHED_STAT_CRANK(vcpu_park);
+                    SCHED_STAT_CRANK(vcpu_park);
                     vcpu_pause_nosync(svc->vcpu);
                     svc->flags |= CSCHED_FLAG_VCPU_PARKED;
                 }
@@ -1118,7 +1109,7 @@ csched_acct(void* dummy)
                 /* Lower bound on credits */
                 if ( credit < -prv->credits_per_tslice )
                 {
-                    CSCHED_STAT_CRANK(acct_min_credit);
+                    SCHED_STAT_CRANK(acct_min_credit);
                     credit = -prv->credits_per_tslice;
                     atomic_set(&svc->credit, credit);
                 }
@@ -1135,7 +1126,7 @@ csched_acct(void* dummy)
                      * call to make sure the VCPU's priority is not boosted
                      * if it is woken up here.
                      */
-                    CSCHED_STAT_CRANK(vcpu_unpark);
+                    SCHED_STAT_CRANK(vcpu_unpark);
                     vcpu_unpause(svc->vcpu);
                     svc->flags &= ~CSCHED_FLAG_VCPU_PARKED;
                 }
@@ -1151,8 +1142,8 @@ csched_acct(void* dummy)
                 }
             }
 
-            CSCHED_VCPU_STAT_SET(svc, credit_last, credit);
-            CSCHED_VCPU_STAT_SET(svc, credit_incr, credit_fair);
+            SCHED_VCPU_STAT_SET(svc, credit_last, credit);
+            SCHED_VCPU_STAT_SET(svc, credit_incr, credit_fair);
             credit_balance += credit;
         }
     }
@@ -1229,8 +1220,8 @@ csched_runq_steal(int peer_cpu, int cpu,
             if (__csched_vcpu_is_migrateable(vc, cpu))
             {
                 /* We got a candidate. Grab it! */
-                CSCHED_VCPU_STAT_CRANK(speer, migrate_q);
-                CSCHED_STAT_CRANK(migrate_queued);
+                SCHED_VCPU_STAT_CRANK(speer, migrate_q);
+                SCHED_STAT_CRANK(migrate_queued);
                 WARN_ON(vc->is_urgent);
                 __runq_remove(speer);
                 vc->processor = cpu;
@@ -1239,7 +1230,7 @@ csched_runq_steal(int peer_cpu, int cpu,
         }
     }
 
-    CSCHED_STAT_CRANK(steal_peer_idle);
+    SCHED_STAT_CRANK(steal_peer_idle);
     return NULL;
 }
 
@@ -1260,11 +1251,11 @@ csched_load_balance(struct csched_privat
         goto out;
 
     if ( snext->pri == CSCHED_PRI_IDLE )
-        CSCHED_STAT_CRANK(load_balance_idle);
+        SCHED_STAT_CRANK(load_balance_idle);
     else if ( snext->pri == CSCHED_PRI_TS_OVER )
-        CSCHED_STAT_CRANK(load_balance_over);
+        SCHED_STAT_CRANK(load_balance_over);
     else
-        CSCHED_STAT_CRANK(load_balance_other);
+        SCHED_STAT_CRANK(load_balance_other);
 
     /*
      * Peek at non-idling CPUs in the system, starting with our
@@ -1288,7 +1279,7 @@ csched_load_balance(struct csched_privat
          */
         if ( !pcpu_schedule_trylock(peer_cpu) )
         {
-            CSCHED_STAT_CRANK(steal_trylock_failed);
+            SCHED_STAT_CRANK(steal_trylock_failed);
             continue;
         }
 
@@ -1327,7 +1318,7 @@ csched_schedule(
     struct task_slice ret;
     s_time_t runtime, tslice;
 
-    CSCHED_STAT_CRANK(schedule);
+    SCHED_STAT_CRANK(schedule);
     CSCHED_VCPU_CHECK(current);
 
     runtime = now - current->runstate.state_entry_time;
diff -r 6d54c3338c52 -r af87fb17adf3 xen/common/schedule.c
--- a/xen/common/schedule.c	Tue Oct 23 04:12:22 2012 -0700
+++ b/xen/common/schedule.c	Tue Oct 23 04:17:16 2012 -0700
@@ -312,11 +312,13 @@ void sched_destroy_vcpu(struct vcpu *v)
 
 int sched_init_domain(struct domain *d)
 {
+    SCHED_STAT_CRANK(dom_init);
     return SCHED_OP(DOM2OP(d), init_domain, d);
 }
 
 void sched_destroy_domain(struct domain *d)
 {
+    SCHED_STAT_CRANK(dom_destroy);
     SCHED_OP(DOM2OP(d), destroy_domain, d);
 }
 
@@ -1084,7 +1086,7 @@ static void schedule(void)
 
     ASSERT(!in_atomic());
 
-    perfc_incr(sched_run);
+    SCHED_STAT_CRANK(sched_run);
 
     sd = &this_cpu(schedule_data);
 
@@ -1162,7 +1164,7 @@ static void schedule(void)
 
     pcpu_schedule_unlock_irq(cpu);
 
-    perfc_incr(sched_ctx);
+    SCHED_STAT_CRANK(sched_ctx);
 
     stop_timer(&prev->periodic_timer);
 
@@ -1196,7 +1198,7 @@ void context_saved(struct vcpu *prev)
 static void s_timer_fn(void *unused)
 {
     raise_softirq(SCHEDULE_SOFTIRQ);
-    perfc_incr(sched_irq);
+    SCHED_STAT_CRANK(sched_irq);
 }
 
 /* Per-VCPU periodic timer function: sends a virtual timer interrupt. */
diff -r 6d54c3338c52 -r af87fb17adf3 xen/include/xen/perfc_defn.h
--- a/xen/include/xen/perfc_defn.h	Tue Oct 23 04:12:22 2012 -0700
+++ b/xen/include/xen/perfc_defn.h	Tue Oct 23 04:17:16 2012 -0700
@@ -12,13 +12,19 @@ PERFCOUNTER(calls_from_multicall,       
 PERFCOUNTER(irqs,                   "#interrupts")
 PERFCOUNTER(ipis,                   "#IPIs")
 
+/* Generic scheduler counters (applicable to all schedulers) */
 PERFCOUNTER(sched_irq,              "sched: timer")
 PERFCOUNTER(sched_run,              "sched: runs through scheduler")
 PERFCOUNTER(sched_ctx,              "sched: context switches")
+PERFCOUNTER(schedule,               "sched: specific scheduler")
+PERFCOUNTER(dom_init,               "sched: dom_init")
+PERFCOUNTER(dom_destroy,            "sched: dom_destroy")
+PERFCOUNTER(vcpu_init,              "sched: vcpu_init")
+PERFCOUNTER(vcpu_destroy,           "sched: vcpu_destroy")
 
+/* credit specific counters */
 PERFCOUNTER(delay_ms,               "csched: delay")
 PERFCOUNTER(vcpu_check,             "csched: vcpu_check")
-PERFCOUNTER(schedule,               "csched: schedule")
 PERFCOUNTER(acct_run,               "csched: acct_run")
 PERFCOUNTER(acct_no_work,           "csched: acct_no_work")
 PERFCOUNTER(acct_balance,           "csched: acct_balance")
@@ -46,10 +52,6 @@ PERFCOUNTER(steal_trylock_failed,   "csc
 PERFCOUNTER(steal_peer_idle,        "csched: steal_peer_idle")
 PERFCOUNTER(migrate_queued,         "csched: migrate_queued")
 PERFCOUNTER(migrate_running,        "csched: migrate_running")
-PERFCOUNTER(dom_init,               "csched: dom_init")
-PERFCOUNTER(dom_destroy,            "csched: dom_destroy")
-PERFCOUNTER(vcpu_init,              "csched: vcpu_init")
-PERFCOUNTER(vcpu_destroy,           "csched: vcpu_destroy")
 PERFCOUNTER(vcpu_hot,               "csched: vcpu_hot")
 
 PERFCOUNTER(need_flush_tlb_flush,   "PG_need_flush tlb flushes")
diff -r 6d54c3338c52 -r af87fb17adf3 xen/include/xen/sched.h
--- a/xen/include/xen/sched.h	Tue Oct 23 04:12:22 2012 -0700
+++ b/xen/include/xen/sched.h	Tue Oct 23 04:17:16 2012 -0700
@@ -16,6 +16,7 @@
 #include <xen/tasklet.h>
 #include <xen/mm.h>
 #include <xen/smp.h>
+#include <xen/perfc.h>
 #include <asm/atomic.h>
 #include <xen/wait.h>
 #include <public/xen.h>
@@ -29,6 +30,18 @@
 DEFINE_XEN_GUEST_HANDLE(vcpu_runstate_info_compat_t);
 #endif
 
+/*
+ * Stats
+ *
+ * Enable and ease the use of scheduling related performance counters.
+ *
+ */
+#ifdef PERF_COUNTERS
+#define SCHED_STATS
+#endif
+
+#define SCHED_STAT_CRANK(_X)                (perfc_incr(_X))
+
 /* A global pointer to the initial domain (DOM0). */
 extern struct domain *dom0;
 

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

From xen-changelog-bounces@lists.xen.org Wed Oct 24 05:00:47 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 24 Oct 2012 05:00:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TQt5A-0001qa-RX; Wed, 24 Oct 2012 05:00:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQt59-0001qK-Qc
	for xen-changelog@lists.xensource.com; Wed, 24 Oct 2012 05:00:44 +0000
Received: from [85.158.139.83:53171] by server-7.bemta-5.messagelabs.com id
	88/00-23102-BF577805; Wed, 24 Oct 2012 05:00:43 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-182.messagelabs.com!1351054821!28996810!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3119 invoked from network); 24 Oct 2012 05:00:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	24 Oct 2012 05:00:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQt4m-0005fM-Sk
	for xen-changelog@lists.xensource.com; Wed, 24 Oct 2012 05:00:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQt4m-00041T-RM
	for xen-changelog@lists.xensource.com; Wed, 24 Oct 2012 05:00:20 +0000
Message-Id: <E1TQt4m-00041T-RM@xenbits.xen.org>
Date: Wed, 24 Oct 2012 05:00:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: sched_sedf: remove an unused
	stat in SEDF
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dario Faggioli <dario.faggioli@citrix.com>
# Date 1350991310 25200
# Node ID 07cf00a917cd1d1849f3e40d5b8ecc2cd8964fe8
# Parent  4ae12a96ec697f942600a78057bcb567f3312dca
xen: sched_sedf: remove an unused stat in SEDF

Namely, `short_cont' which is not updated anywhere in the code.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 4ae12a96ec69 -r 07cf00a917cd xen/common/sched_sedf.c
--- a/xen/common/sched_sedf.c	Tue Oct 23 04:18:22 2012 -0700
+++ b/xen/common/sched_sedf.c	Tue Oct 23 04:21:50 2012 -0700
@@ -97,7 +97,6 @@ struct sedf_vcpu_info {
     int   block_tot;
     int   short_block_tot;
     int   long_block_tot;
-    int   short_cont;
     int   pen_extra_blocks;
     int   pen_extra_slices;
 #endif
@@ -1201,12 +1200,10 @@ static void sedf_dump_domain(struct vcpu
         printk(" pen=%"PRIu64"%%", (EDOM_INFO(d)->penalty_time_tot * 100) /
                EDOM_INFO(d)->block_time_tot);
     if ( EDOM_INFO(d)->block_tot != 0 )
-        printk("\n   blks=%u sh=%u (%u%%) (shc=%u (%u%%) shex=%i "\
+        printk("\n   blks=%u sh=%u (%u%%) (shex=%i "\
                "shexsl=%i) l=%u (%u%%) avg: b=%"PRIu64" p=%"PRIu64"",
                EDOM_INFO(d)->block_tot, EDOM_INFO(d)->short_block_tot,
-               (EDOM_INFO(d)->short_block_tot * 100) 
-               / EDOM_INFO(d)->block_tot, EDOM_INFO(d)->short_cont,
-               (EDOM_INFO(d)->short_cont * 100) / EDOM_INFO(d)->block_tot,
+               (EDOM_INFO(d)->short_block_tot * 100) / EDOM_INFO(d)->block_tot,
                EDOM_INFO(d)->pen_extra_blocks,
                EDOM_INFO(d)->pen_extra_slices,
                EDOM_INFO(d)->long_block_tot,

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

From xen-changelog-bounces@lists.xen.org Wed Oct 24 05:00:47 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 24 Oct 2012 05:00:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TQt5A-0001qa-RX; Wed, 24 Oct 2012 05:00:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQt59-0001qK-Qc
	for xen-changelog@lists.xensource.com; Wed, 24 Oct 2012 05:00:44 +0000
Received: from [85.158.139.83:53171] by server-7.bemta-5.messagelabs.com id
	88/00-23102-BF577805; Wed, 24 Oct 2012 05:00:43 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-182.messagelabs.com!1351054821!28996810!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3119 invoked from network); 24 Oct 2012 05:00:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	24 Oct 2012 05:00:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQt4m-0005fM-Sk
	for xen-changelog@lists.xensource.com; Wed, 24 Oct 2012 05:00:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TQt4m-00041T-RM
	for xen-changelog@lists.xensource.com; Wed, 24 Oct 2012 05:00:20 +0000
Message-Id: <E1TQt4m-00041T-RM@xenbits.xen.org>
Date: Wed, 24 Oct 2012 05:00:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: sched_sedf: remove an unused
	stat in SEDF
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dario Faggioli <dario.faggioli@citrix.com>
# Date 1350991310 25200
# Node ID 07cf00a917cd1d1849f3e40d5b8ecc2cd8964fe8
# Parent  4ae12a96ec697f942600a78057bcb567f3312dca
xen: sched_sedf: remove an unused stat in SEDF

Namely, `short_cont' which is not updated anywhere in the code.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 4ae12a96ec69 -r 07cf00a917cd xen/common/sched_sedf.c
--- a/xen/common/sched_sedf.c	Tue Oct 23 04:18:22 2012 -0700
+++ b/xen/common/sched_sedf.c	Tue Oct 23 04:21:50 2012 -0700
@@ -97,7 +97,6 @@ struct sedf_vcpu_info {
     int   block_tot;
     int   short_block_tot;
     int   long_block_tot;
-    int   short_cont;
     int   pen_extra_blocks;
     int   pen_extra_slices;
 #endif
@@ -1201,12 +1200,10 @@ static void sedf_dump_domain(struct vcpu
         printk(" pen=%"PRIu64"%%", (EDOM_INFO(d)->penalty_time_tot * 100) /
                EDOM_INFO(d)->block_time_tot);
     if ( EDOM_INFO(d)->block_tot != 0 )
-        printk("\n   blks=%u sh=%u (%u%%) (shc=%u (%u%%) shex=%i "\
+        printk("\n   blks=%u sh=%u (%u%%) (shex=%i "\
                "shexsl=%i) l=%u (%u%%) avg: b=%"PRIu64" p=%"PRIu64"",
                EDOM_INFO(d)->block_tot, EDOM_INFO(d)->short_block_tot,
-               (EDOM_INFO(d)->short_block_tot * 100) 
-               / EDOM_INFO(d)->block_tot, EDOM_INFO(d)->short_cont,
-               (EDOM_INFO(d)->short_cont * 100) / EDOM_INFO(d)->block_tot,
+               (EDOM_INFO(d)->short_block_tot * 100) / EDOM_INFO(d)->block_tot,
                EDOM_INFO(d)->pen_extra_blocks,
                EDOM_INFO(d)->pen_extra_slices,
                EDOM_INFO(d)->long_block_tot,

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

From xen-changelog-bounces@lists.xen.org Wed Oct 24 21:22:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 24 Oct 2012 21:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TR8Oz-00020D-TL; Wed, 24 Oct 2012 21:22:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TR8Oy-000208-6Z
	for xen-changelog@lists.xensource.com; Wed, 24 Oct 2012 21:22:12 +0000
Received: from [85.158.137.99:42313] by server-4.bemta-3.messagelabs.com id
	D5/67-01405-30C58805; Wed, 24 Oct 2012 21:22:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-217.messagelabs.com!1351113729!17559925!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26621 invoked from network); 24 Oct 2012 21:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	24 Oct 2012 21:22:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TR8Ov-0000wr-2D
	for xen-changelog@lists.xensource.com; Wed, 24 Oct 2012 21:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TR8Ou-0004Kt-KW
	for xen-changelog@lists.xensource.com; Wed, 24 Oct 2012 21:22:08 +0000
Message-Id: <E1TR8Ou-0004Kt-KW@xenbits.xen.org>
Date: Wed, 24 Oct 2012 21:22:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: don't special case first IO-APIC
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1351093908 -7200
# Node ID 22e08c9ac770db07c3c3e7c844aa7153050939f3
# Parent  07cf00a917cd1d1849f3e40d5b8ecc2cd8964fe8
x86: don't special case first IO-APIC

It has always been puzzling me why the first IO-APIC gets special cased
in two places, and finally Xen got run on a system where this breaks:

(XEN) ACPI: IOAPIC (id[0x10] address[0xfecff000] gsi_base[0])
(XEN) IOAPIC[0]: apic_id 16, version 17, address 0xfecff000, GSI 0-2
(XEN) ACPI: IOAPIC (id[0x0f] address[0xfec00000] gsi_base[3])
(XEN) IOAPIC[1]: apic_id 15, version 17, address 0xfec00000, GSI 3-38
(XEN) ACPI: IOAPIC (id[0x0e] address[0xfec01000] gsi_base[39])
(XEN) IOAPIC[2]: apic_id 14, version 17, address 0xfec01000, GSI 39-74
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 1 global_irq 4 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 5 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 3 global_irq 6 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 4 global_irq 7 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 6 global_irq 9 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 7 global_irq 10 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 8 global_irq 11 low edge)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 12 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 12 global_irq 15 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 13 global_irq 16 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 14 global_irq 17 low edge)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 15 global_irq 18 dfl dfl)

i.e. all legacy IRQs (apart from the timer one, but the firmware passed
data doesn't look right for that case anyway, as both Xen and native
Linux are falling back to use the virtual wire setup for IRQ0,
apparently rather using pin 2 of the first IO-APIC) are being handled
by the second IO-APIC.

This at once eliminates the possibility of an unmasked RTE getting
written without having got a vector put in place (in
setup_IO_APIC_irqs()).

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


diff -r 07cf00a917cd -r 22e08c9ac770 xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c	Tue Oct 23 04:21:50 2012 -0700
+++ b/xen/arch/x86/io_apic.c	Wed Oct 24 17:51:48 2012 +0200
@@ -990,18 +990,17 @@ static void __init setup_IO_APIC_irqs(vo
             else
                 add_pin_to_irq(irq, apic, pin);
 
-            if (!apic && !IO_APIC_IRQ(irq))
+            if (!IO_APIC_IRQ(irq))
                 continue;
 
-            if (IO_APIC_IRQ(irq)) {
-                vector = assign_irq_vector(irq, NULL);
-                BUG_ON(vector < 0);
-                entry.vector = vector;
-                ioapic_register_intr(irq, IOAPIC_AUTO);
+            vector = assign_irq_vector(irq, NULL);
+            BUG_ON(vector < 0);
+            entry.vector = vector;
+            ioapic_register_intr(irq, IOAPIC_AUTO);
 
-                if (!apic && platform_legacy_irq(irq))
-                    disable_8259A_irq(irq_to_desc(irq));
-            }
+            if (platform_legacy_irq(irq))
+                disable_8259A_irq(irq_to_desc(irq));
+
             desc = irq_to_desc(irq);
             SET_DEST(entry.dest.dest32, entry.dest.logical.logical_dest,
                      cpu_mask_to_apicid(desc->arch.cpu_mask));
@@ -2245,18 +2244,15 @@ unsigned apic_gsi_base(int apic);
 
 static int apic_pin_2_gsi_irq(int apic, int pin)
 {
-    int idx, irq;
+    int idx;
 
     if (apic < 0)
        return -EINVAL;
 
-    irq = apic_gsi_base(apic) + pin;
-    if (apic == 0) {
-        idx = find_irq_entry(apic, pin, mp_INT);
-        if (idx >= 0)
-            irq = pin_2_irq(idx, apic, pin);
-    }
-    return irq;
+    idx = find_irq_entry(apic, pin, mp_INT);
+
+    return idx >= 0 ? pin_2_irq(idx, apic, pin)
+                    : apic_gsi_base(apic) + pin;
 }
 
 int ioapic_guest_read(unsigned long physbase, unsigned int reg, u32 *pval)

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

From xen-changelog-bounces@lists.xen.org Wed Oct 24 21:22:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 24 Oct 2012 21:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TR8Oz-00020D-TL; Wed, 24 Oct 2012 21:22:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TR8Oy-000208-6Z
	for xen-changelog@lists.xensource.com; Wed, 24 Oct 2012 21:22:12 +0000
Received: from [85.158.137.99:42313] by server-4.bemta-3.messagelabs.com id
	D5/67-01405-30C58805; Wed, 24 Oct 2012 21:22:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-217.messagelabs.com!1351113729!17559925!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26621 invoked from network); 24 Oct 2012 21:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	24 Oct 2012 21:22:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TR8Ov-0000wr-2D
	for xen-changelog@lists.xensource.com; Wed, 24 Oct 2012 21:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TR8Ou-0004Kt-KW
	for xen-changelog@lists.xensource.com; Wed, 24 Oct 2012 21:22:08 +0000
Message-Id: <E1TR8Ou-0004Kt-KW@xenbits.xen.org>
Date: Wed, 24 Oct 2012 21:22:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: don't special case first IO-APIC
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1351093908 -7200
# Node ID 22e08c9ac770db07c3c3e7c844aa7153050939f3
# Parent  07cf00a917cd1d1849f3e40d5b8ecc2cd8964fe8
x86: don't special case first IO-APIC

It has always been puzzling me why the first IO-APIC gets special cased
in two places, and finally Xen got run on a system where this breaks:

(XEN) ACPI: IOAPIC (id[0x10] address[0xfecff000] gsi_base[0])
(XEN) IOAPIC[0]: apic_id 16, version 17, address 0xfecff000, GSI 0-2
(XEN) ACPI: IOAPIC (id[0x0f] address[0xfec00000] gsi_base[3])
(XEN) IOAPIC[1]: apic_id 15, version 17, address 0xfec00000, GSI 3-38
(XEN) ACPI: IOAPIC (id[0x0e] address[0xfec01000] gsi_base[39])
(XEN) IOAPIC[2]: apic_id 14, version 17, address 0xfec01000, GSI 39-74
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 1 global_irq 4 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 5 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 3 global_irq 6 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 4 global_irq 7 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 6 global_irq 9 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 7 global_irq 10 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 8 global_irq 11 low edge)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 12 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 12 global_irq 15 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 13 global_irq 16 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 14 global_irq 17 low edge)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 15 global_irq 18 dfl dfl)

i.e. all legacy IRQs (apart from the timer one, but the firmware passed
data doesn't look right for that case anyway, as both Xen and native
Linux are falling back to use the virtual wire setup for IRQ0,
apparently rather using pin 2 of the first IO-APIC) are being handled
by the second IO-APIC.

This at once eliminates the possibility of an unmasked RTE getting
written without having got a vector put in place (in
setup_IO_APIC_irqs()).

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


diff -r 07cf00a917cd -r 22e08c9ac770 xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c	Tue Oct 23 04:21:50 2012 -0700
+++ b/xen/arch/x86/io_apic.c	Wed Oct 24 17:51:48 2012 +0200
@@ -990,18 +990,17 @@ static void __init setup_IO_APIC_irqs(vo
             else
                 add_pin_to_irq(irq, apic, pin);
 
-            if (!apic && !IO_APIC_IRQ(irq))
+            if (!IO_APIC_IRQ(irq))
                 continue;
 
-            if (IO_APIC_IRQ(irq)) {
-                vector = assign_irq_vector(irq, NULL);
-                BUG_ON(vector < 0);
-                entry.vector = vector;
-                ioapic_register_intr(irq, IOAPIC_AUTO);
+            vector = assign_irq_vector(irq, NULL);
+            BUG_ON(vector < 0);
+            entry.vector = vector;
+            ioapic_register_intr(irq, IOAPIC_AUTO);
 
-                if (!apic && platform_legacy_irq(irq))
-                    disable_8259A_irq(irq_to_desc(irq));
-            }
+            if (platform_legacy_irq(irq))
+                disable_8259A_irq(irq_to_desc(irq));
+
             desc = irq_to_desc(irq);
             SET_DEST(entry.dest.dest32, entry.dest.logical.logical_dest,
                      cpu_mask_to_apicid(desc->arch.cpu_mask));
@@ -2245,18 +2244,15 @@ unsigned apic_gsi_base(int apic);
 
 static int apic_pin_2_gsi_irq(int apic, int pin)
 {
-    int idx, irq;
+    int idx;
 
     if (apic < 0)
        return -EINVAL;
 
-    irq = apic_gsi_base(apic) + pin;
-    if (apic == 0) {
-        idx = find_irq_entry(apic, pin, mp_INT);
-        if (idx >= 0)
-            irq = pin_2_irq(idx, apic, pin);
-    }
-    return irq;
+    idx = find_irq_entry(apic, pin, mp_INT);
+
+    return idx >= 0 ? pin_2_irq(idx, apic, pin)
+                    : apic_gsi_base(apic) + pin;
 }
 
 int ioapic_guest_read(unsigned long physbase, unsigned int reg, u32 *pval)

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

From xen-changelog-bounces@lists.xen.org Thu Oct 25 20:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 25 Oct 2012 20:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TRTwV-0005MH-OH; Thu, 25 Oct 2012 20:22:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwU-0005Lh-9G
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:14 +0000
Received: from [85.158.139.211:7044] by server-4.bemta-5.messagelabs.com id
	EC/91-01455-57F99805; Thu, 25 Oct 2012 20:22:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-206.messagelabs.com!1351196531!23790328!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6148 invoked from network); 25 Oct 2012 20:22:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2012 20:22:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwR-0001Au-9g
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwR-0006ej-8L
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:11 +0000
Message-Id: <E1TRTwR-0006ej-8L@xenbits.xen.org>
Date: Thu, 25 Oct 2012 20:22:10 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] nestedsvm: fix memory leak on
	shutdown/crash
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1351171926 -7200
# Node ID 67eb562ebe06e4fc00fe9f085e83a06099c5bc13
# Parent  d2e6d50b6cffd50048beb23e1712317fd5b26237
nestedsvm: fix memory leak on shutdown/crash

Fix memory leak of l1 vmcb page when destroying a vcpu while l2 guest
is running.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Tim Deegan <tim@xen.org>
xen-unstable changeset: 26095:a7503ce27d46
xen-unstable date: Tue Oct 23 07:13:27 UTC 2012
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r d2e6d50b6cff -r 67eb562ebe06 xen/arch/x86/hvm/svm/nestedsvm.c
--- a/xen/arch/x86/hvm/svm/nestedsvm.c	Thu Oct 25 15:31:08 2012 +0200
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c	Thu Oct 25 15:32:06 2012 +0200
@@ -122,6 +122,15 @@ void nsvm_vcpu_destroy(struct vcpu *v)
     struct nestedvcpu *nv = &vcpu_nestedhvm(v);
     struct nestedsvm *svm = &vcpu_nestedsvm(v);
 
+    /*
+     * When destroying the vcpu, it may be running on behalf of l2 guest.
+     * Therefore we need to switch the VMCB pointer back to the l1 vmcb,
+     * in order to avoid double free of l2 vmcb and the possible memory leak
+     * of l1 vmcb page.
+     */
+    if (nv->nv_n1vmcx)
+        v->arch.hvm_svm.vmcb = nv->nv_n1vmcx;
+
     if (svm->ns_cached_msrpm) {
         free_xenheap_pages(svm->ns_cached_msrpm,
                            get_order_from_bytes(MSRPM_SIZE));

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

From xen-changelog-bounces@lists.xen.org Thu Oct 25 20:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 25 Oct 2012 20:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TRTwV-0005MB-LS; Thu, 25 Oct 2012 20:22:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwU-0005La-1D
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:14 +0000
Received: from [85.158.137.99:19685] by server-3.bemta-3.messagelabs.com id
	08/89-09368-57F99805; Thu, 25 Oct 2012 20:22:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-217.messagelabs.com!1351196530!22958255!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2235 invoked from network); 25 Oct 2012 20:22:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2012 20:22:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwQ-0001Ao-9U
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwQ-0006eD-4r
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:10 +0000
Message-Id: <E1TRTwQ-0006eD-4r@xenbits.xen.org>
Date: Thu, 25 Oct 2012 20:22:09 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86/HPET: obtain proper lock for
	changing IRQ 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

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1351171463 -7200
# Node ID ccc3bd29d453664fa5831e4b223c5338147ea101
# Parent  0fbfdecc80452868c78e0c1c872d730ce5fb0f6f
x86/HPET: obtain proper lock for changing IRQ affinity

The IRQ descriptor lock should be held while adjusting the affinity of
any IRQ; the HPET channel lock isn't sufficient to protect namely
against races with moving the IRQ to a different CPU.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 26063:1f4be6ee4619
xen-unstable date: Wed Oct 17 12:13:20 UTC 2012
---


diff -r 0fbfdecc8045 -r ccc3bd29d453 xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c	Thu Oct 25 15:23:50 2012 +0200
+++ b/xen/arch/x86/hpet.c	Thu Oct 25 15:24:23 2012 +0200
@@ -433,6 +433,16 @@ static struct hpet_event_channel *hpet_g
     return ch;
 }
 
+static void set_channel_irq_affinity(const struct hpet_event_channel *ch)
+{
+    struct irq_desc *desc = irq_to_desc(ch->irq);
+
+    ASSERT(!local_irq_is_enabled());
+    spin_lock(&desc->lock);
+    hpet_msi_set_affinity(desc, cpumask_of(ch->cpu));
+    spin_unlock(&desc->lock);
+}
+
 static void hpet_attach_channel(unsigned int cpu,
                                 struct hpet_event_channel *ch)
 {
@@ -447,7 +457,7 @@ static void hpet_attach_channel(unsigned
     if ( ch->cpu != cpu )
         return;
 
-    hpet_msi_set_affinity(irq_to_desc(ch->irq), cpumask_of(ch->cpu));
+    set_channel_irq_affinity(ch);
 }
 
 static void hpet_detach_channel(unsigned int cpu,
@@ -469,7 +479,7 @@ static void hpet_detach_channel(unsigned
     }
 
     ch->cpu = cpumask_first(ch->cpumask);
-    hpet_msi_set_affinity(irq_to_desc(ch->irq), cpumask_of(ch->cpu));
+    set_channel_irq_affinity(ch);
 }
 
 #include <asm/mc146818rtc.h>

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

From xen-changelog-bounces@lists.xen.org Thu Oct 25 20:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 25 Oct 2012 20:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TRTwV-0005MH-OH; Thu, 25 Oct 2012 20:22:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwU-0005Lh-9G
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:14 +0000
Received: from [85.158.139.211:7044] by server-4.bemta-5.messagelabs.com id
	EC/91-01455-57F99805; Thu, 25 Oct 2012 20:22:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-206.messagelabs.com!1351196531!23790328!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6148 invoked from network); 25 Oct 2012 20:22:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2012 20:22:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwR-0001Au-9g
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwR-0006ej-8L
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:11 +0000
Message-Id: <E1TRTwR-0006ej-8L@xenbits.xen.org>
Date: Thu, 25 Oct 2012 20:22:10 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] nestedsvm: fix memory leak on
	shutdown/crash
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1351171926 -7200
# Node ID 67eb562ebe06e4fc00fe9f085e83a06099c5bc13
# Parent  d2e6d50b6cffd50048beb23e1712317fd5b26237
nestedsvm: fix memory leak on shutdown/crash

Fix memory leak of l1 vmcb page when destroying a vcpu while l2 guest
is running.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Tim Deegan <tim@xen.org>
xen-unstable changeset: 26095:a7503ce27d46
xen-unstable date: Tue Oct 23 07:13:27 UTC 2012
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r d2e6d50b6cff -r 67eb562ebe06 xen/arch/x86/hvm/svm/nestedsvm.c
--- a/xen/arch/x86/hvm/svm/nestedsvm.c	Thu Oct 25 15:31:08 2012 +0200
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c	Thu Oct 25 15:32:06 2012 +0200
@@ -122,6 +122,15 @@ void nsvm_vcpu_destroy(struct vcpu *v)
     struct nestedvcpu *nv = &vcpu_nestedhvm(v);
     struct nestedsvm *svm = &vcpu_nestedsvm(v);
 
+    /*
+     * When destroying the vcpu, it may be running on behalf of l2 guest.
+     * Therefore we need to switch the VMCB pointer back to the l1 vmcb,
+     * in order to avoid double free of l2 vmcb and the possible memory leak
+     * of l1 vmcb page.
+     */
+    if (nv->nv_n1vmcx)
+        v->arch.hvm_svm.vmcb = nv->nv_n1vmcx;
+
     if (svm->ns_cached_msrpm) {
         free_xenheap_pages(svm->ns_cached_msrpm,
                            get_order_from_bytes(MSRPM_SIZE));

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

From xen-changelog-bounces@lists.xen.org Thu Oct 25 20:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 25 Oct 2012 20:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TRTwU-0005Ly-JC; Thu, 25 Oct 2012 20:22:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwT-0005LE-1q
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:13 +0000
Received: from [85.158.143.35:4172] by server-2.bemta-4.messagelabs.com id
	55/F7-22268-47F99805; Thu, 25 Oct 2012 20:22:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-21.messagelabs.com!1351196531!13200823!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32327 invoked from network); 25 Oct 2012 20:22:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2012 20:22:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwQ-0001Ar-S7
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwQ-0006eS-NE
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:10 +0000
Message-Id: <E1TRTwQ-0006eS-NE@xenbits.xen.org>
Date: Thu, 25 Oct 2012 20:22:10 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] hvm: handle PoD and grant pages
	in HVMOP_get_mem_type
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1351171868 -7200
# Node ID d2e6d50b6cffd50048beb23e1712317fd5b26237
# Parent  ccc3bd29d453664fa5831e4b223c5338147ea101
hvm: handle PoD and grant pages in HVMOP_get_mem_type

During kexec in a ballooned PVonHVM guest the new kernel needs to check
each pfn if its backed by a mfn to find ballooned pages. Currently all
PoD and grant pages will appear as HVMMEM_mmio_dm, so the new kernel has
to assume they are ballooned. This is wrong: PoD pages may turn into
real RAM at runtime, grant pages are also RAM.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Tim Deegan <tim@xen.org>
xen-unstable changeset: 26093:4ae08ca5500f
xen-unstable date: Fri Oct 19 16:09:05 2012 +0200
---


diff -r ccc3bd29d453 -r d2e6d50b6cff xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Thu Oct 25 15:24:23 2012 +0200
+++ b/xen/arch/x86/hvm/hvm.c	Thu Oct 25 15:31:08 2012 +0200
@@ -4071,6 +4071,10 @@ long do_hvm_op(unsigned long op, XEN_GUE
                 a.mem_type =  HVMMEM_ram_ro;
             else if ( p2m_is_ram(t) )
                 a.mem_type =  HVMMEM_ram_rw;
+            else if ( p2m_is_magic(t) )
+                a.mem_type =  HVMMEM_ram_rw;
+            else if ( p2m_is_grant(t) )
+                a.mem_type =  HVMMEM_ram_rw;
             else
                 a.mem_type =  HVMMEM_mmio_dm;
             rc = copy_to_guest(arg, &a, 1) ? -EFAULT : 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 25 20:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 25 Oct 2012 20:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TRTwV-0005MB-LS; Thu, 25 Oct 2012 20:22:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwU-0005La-1D
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:14 +0000
Received: from [85.158.137.99:19685] by server-3.bemta-3.messagelabs.com id
	08/89-09368-57F99805; Thu, 25 Oct 2012 20:22:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-217.messagelabs.com!1351196530!22958255!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2235 invoked from network); 25 Oct 2012 20:22:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2012 20:22:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwQ-0001Ao-9U
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwQ-0006eD-4r
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:10 +0000
Message-Id: <E1TRTwQ-0006eD-4r@xenbits.xen.org>
Date: Thu, 25 Oct 2012 20:22:09 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86/HPET: obtain proper lock for
	changing IRQ 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

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1351171463 -7200
# Node ID ccc3bd29d453664fa5831e4b223c5338147ea101
# Parent  0fbfdecc80452868c78e0c1c872d730ce5fb0f6f
x86/HPET: obtain proper lock for changing IRQ affinity

The IRQ descriptor lock should be held while adjusting the affinity of
any IRQ; the HPET channel lock isn't sufficient to protect namely
against races with moving the IRQ to a different CPU.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 26063:1f4be6ee4619
xen-unstable date: Wed Oct 17 12:13:20 UTC 2012
---


diff -r 0fbfdecc8045 -r ccc3bd29d453 xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c	Thu Oct 25 15:23:50 2012 +0200
+++ b/xen/arch/x86/hpet.c	Thu Oct 25 15:24:23 2012 +0200
@@ -433,6 +433,16 @@ static struct hpet_event_channel *hpet_g
     return ch;
 }
 
+static void set_channel_irq_affinity(const struct hpet_event_channel *ch)
+{
+    struct irq_desc *desc = irq_to_desc(ch->irq);
+
+    ASSERT(!local_irq_is_enabled());
+    spin_lock(&desc->lock);
+    hpet_msi_set_affinity(desc, cpumask_of(ch->cpu));
+    spin_unlock(&desc->lock);
+}
+
 static void hpet_attach_channel(unsigned int cpu,
                                 struct hpet_event_channel *ch)
 {
@@ -447,7 +457,7 @@ static void hpet_attach_channel(unsigned
     if ( ch->cpu != cpu )
         return;
 
-    hpet_msi_set_affinity(irq_to_desc(ch->irq), cpumask_of(ch->cpu));
+    set_channel_irq_affinity(ch);
 }
 
 static void hpet_detach_channel(unsigned int cpu,
@@ -469,7 +479,7 @@ static void hpet_detach_channel(unsigned
     }
 
     ch->cpu = cpumask_first(ch->cpumask);
-    hpet_msi_set_affinity(irq_to_desc(ch->irq), cpumask_of(ch->cpu));
+    set_channel_irq_affinity(ch);
 }
 
 #include <asm/mc146818rtc.h>

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

From xen-changelog-bounces@lists.xen.org Thu Oct 25 20:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 25 Oct 2012 20:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TRTwU-0005Ly-JC; Thu, 25 Oct 2012 20:22:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwT-0005LE-1q
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:13 +0000
Received: from [85.158.143.35:4172] by server-2.bemta-4.messagelabs.com id
	55/F7-22268-47F99805; Thu, 25 Oct 2012 20:22:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-21.messagelabs.com!1351196531!13200823!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32327 invoked from network); 25 Oct 2012 20:22:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2012 20:22:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwQ-0001Ar-S7
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwQ-0006eS-NE
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:10 +0000
Message-Id: <E1TRTwQ-0006eS-NE@xenbits.xen.org>
Date: Thu, 25 Oct 2012 20:22:10 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] hvm: handle PoD and grant pages
	in HVMOP_get_mem_type
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1351171868 -7200
# Node ID d2e6d50b6cffd50048beb23e1712317fd5b26237
# Parent  ccc3bd29d453664fa5831e4b223c5338147ea101
hvm: handle PoD and grant pages in HVMOP_get_mem_type

During kexec in a ballooned PVonHVM guest the new kernel needs to check
each pfn if its backed by a mfn to find ballooned pages. Currently all
PoD and grant pages will appear as HVMMEM_mmio_dm, so the new kernel has
to assume they are ballooned. This is wrong: PoD pages may turn into
real RAM at runtime, grant pages are also RAM.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Tim Deegan <tim@xen.org>
xen-unstable changeset: 26093:4ae08ca5500f
xen-unstable date: Fri Oct 19 16:09:05 2012 +0200
---


diff -r ccc3bd29d453 -r d2e6d50b6cff xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Thu Oct 25 15:24:23 2012 +0200
+++ b/xen/arch/x86/hvm/hvm.c	Thu Oct 25 15:31:08 2012 +0200
@@ -4071,6 +4071,10 @@ long do_hvm_op(unsigned long op, XEN_GUE
                 a.mem_type =  HVMMEM_ram_ro;
             else if ( p2m_is_ram(t) )
                 a.mem_type =  HVMMEM_ram_rw;
+            else if ( p2m_is_magic(t) )
+                a.mem_type =  HVMMEM_ram_rw;
+            else if ( p2m_is_grant(t) )
+                a.mem_type =  HVMMEM_ram_rw;
             else
                 a.mem_type =  HVMMEM_mmio_dm;
             rc = copy_to_guest(arg, &a, 1) ? -EFAULT : 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 25 20:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 25 Oct 2012 20:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TRTwT-0005LX-Dq; Thu, 25 Oct 2012 20:22:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwS-0005L5-A8
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:12 +0000
Received: from [85.158.143.99:25372] by server-3.bemta-4.messagelabs.com id
	2A/EA-24279-37F99805; Thu, 25 Oct 2012 20:22:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1351196529!17776227!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10436 invoked from network); 25 Oct 2012 20:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2012 20:22:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwP-0001Ai-AS
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwP-0006di-32
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:09 +0000
Message-Id: <E1TRTwP-0006di-32@xenbits.xen.org>
Date: Thu, 25 Oct 2012 20:22:08 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] More efficient TLB-flush
	filtering in alloc_heap_pages().
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1351171397 -7200
# Node ID 2f8236a49dcce840a7b540a8796f6867292d656e
# Parent  cbb6326377bb99d10dc288a23a389273f3a7ffbc
More efficient TLB-flush filtering in alloc_heap_pages().

Rather than per-cpu filtering for every page in a super-page
allocation, simply remember the most recent TLB timestamp across all
allocated pages, and filter on that, just once, at the end of the
function.

For large-CPU systems, doing 2MB allocations during domain creation,
this cuts down the domain creation time *massively*.

TODO: It may make sense to move the filtering out into some callers,
such as memory.c:populate_physmap() and
memory.c:increase_reservation(), so that the filtering can be moved
outside their loops, too.

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 26056:177fdda0be56
xen-unstable date: Mon Oct 15 15:38:11 UTC 2012
---


diff -r cbb6326377bb -r 2f8236a49dcc xen/common/page_alloc.c
--- a/xen/common/page_alloc.c	Thu Oct 25 15:22:26 2012 +0200
+++ b/xen/common/page_alloc.c	Thu Oct 25 15:23:17 2012 +0200
@@ -414,9 +414,10 @@ static struct page_info *alloc_heap_page
     unsigned int first_node, i, j, zone = 0, nodemask_retry = 0;
     unsigned int node = (uint8_t)((memflags >> _MEMF_node) - 1);
     unsigned long request = 1UL << order;
-    cpumask_t mask;
     struct page_info *pg;
     nodemask_t nodemask = (d != NULL ) ? d->node_affinity : node_online_map;
+    bool_t need_tlbflush = 0;
+    uint32_t tlbflush_timestamp = 0;
 
     if ( node == NUMA_NO_NODE )
     {
@@ -530,22 +531,19 @@ static struct page_info *alloc_heap_page
     if ( d != NULL )
         d->last_alloc_node = node;
 
-    cpumask_clear(&mask);
-
     for ( i = 0; i < (1 << order); i++ )
     {
         /* Reference count must continuously be zero for free pages. */
         BUG_ON(pg[i].count_info != PGC_state_free);
         pg[i].count_info = PGC_state_inuse;
 
-        if ( pg[i].u.free.need_tlbflush )
+        if ( pg[i].u.free.need_tlbflush &&
+             (pg[i].tlbflush_timestamp <= tlbflush_current_time()) &&
+             (!need_tlbflush ||
+              (pg[i].tlbflush_timestamp > tlbflush_timestamp)) )
         {
-            /* Add in extra CPUs that need flushing because of this page. */
-            static cpumask_t extra_cpus_mask;
-
-            cpumask_andnot(&extra_cpus_mask, &cpu_online_map, &mask);
-            tlbflush_filter(extra_cpus_mask, pg[i].tlbflush_timestamp);
-            cpumask_or(&mask, &mask, &extra_cpus_mask);
+            need_tlbflush = 1;
+            tlbflush_timestamp = pg[i].tlbflush_timestamp;
         }
 
         /* Initialise fields which have other uses for free pages. */
@@ -555,10 +553,15 @@ static struct page_info *alloc_heap_page
 
     spin_unlock(&heap_lock);
 
-    if ( unlikely(!cpumask_empty(&mask)) )
+    if ( need_tlbflush )
     {
-        perfc_incr(need_flush_tlb_flush);
-        flush_tlb_mask(&mask);
+        cpumask_t mask = cpu_online_map;
+        tlbflush_filter(mask, tlbflush_timestamp);
+        if ( !cpumask_empty(&mask) )
+        {
+            perfc_incr(need_flush_tlb_flush);
+            flush_tlb_mask(&mask);
+        }
     }
 
     return pg;

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

From xen-changelog-bounces@lists.xen.org Thu Oct 25 20:22:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 25 Oct 2012 20:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TRTwT-0005LS-BW; Thu, 25 Oct 2012 20:22:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwS-0005L0-9I
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:12 +0000
Received: from [85.158.137.99:38114] by server-13.bemta-3.messagelabs.com id
	CB/7D-24887-37F99805; Thu, 25 Oct 2012 20:22:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-217.messagelabs.com!1351196529!23102283!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29296 invoked from network); 25 Oct 2012 20:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2012 20:22:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwP-0001Al-LE
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwP-0006dy-Jz
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:09 +0000
Message-Id: <E1TRTwP-0006dy-Jz@xenbits.xen.org>
Date: Thu, 25 Oct 2012 20:22:09 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86/oprof: adjust off-by-one
	counter range checks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1351171430 -7200
# Node ID 0fbfdecc80452868c78e0c1c872d730ce5fb0f6f
# Parent  2f8236a49dcce840a7b540a8796f6867292d656e
x86/oprof: adjust off-by-one counter range checks

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 26061:4b4c0c7a6031
xen-unstable date: Wed Oct 17 09:23:10 UTC 2012
---


diff -r 2f8236a49dcc -r 0fbfdecc8045 xen/arch/x86/oprofile/xenoprof.c
--- a/xen/arch/x86/oprofile/xenoprof.c	Thu Oct 25 15:23:17 2012 +0200
+++ b/xen/arch/x86/oprofile/xenoprof.c	Thu Oct 25 15:23:50 2012 +0200
@@ -26,7 +26,7 @@ int xenoprof_arch_counter(XEN_GUEST_HAND
     if ( copy_from_guest(&counter, arg, 1) )
         return -EFAULT;
 
-    if ( counter.ind > OP_MAX_COUNTER )
+    if ( counter.ind >= OP_MAX_COUNTER )
         return -E2BIG;
 
     counter_config[counter.ind].count     = counter.count;
@@ -64,7 +64,7 @@ int compat_oprof_arch_counter(XEN_GUEST_
     if ( copy_from_guest(&counter, arg, 1) )
         return -EFAULT;
 
-    if ( counter.ind > OP_MAX_COUNTER )
+    if ( counter.ind >= OP_MAX_COUNTER )
         return -E2BIG;
 
     counter_config[counter.ind].count     = counter.count;

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

From xen-changelog-bounces@lists.xen.org Thu Oct 25 20:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 25 Oct 2012 20:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TRTwT-0005LX-Dq; Thu, 25 Oct 2012 20:22:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwS-0005L5-A8
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:12 +0000
Received: from [85.158.143.99:25372] by server-3.bemta-4.messagelabs.com id
	2A/EA-24279-37F99805; Thu, 25 Oct 2012 20:22:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1351196529!17776227!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10436 invoked from network); 25 Oct 2012 20:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2012 20:22:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwP-0001Ai-AS
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwP-0006di-32
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:09 +0000
Message-Id: <E1TRTwP-0006di-32@xenbits.xen.org>
Date: Thu, 25 Oct 2012 20:22:08 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] More efficient TLB-flush
	filtering in alloc_heap_pages().
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1351171397 -7200
# Node ID 2f8236a49dcce840a7b540a8796f6867292d656e
# Parent  cbb6326377bb99d10dc288a23a389273f3a7ffbc
More efficient TLB-flush filtering in alloc_heap_pages().

Rather than per-cpu filtering for every page in a super-page
allocation, simply remember the most recent TLB timestamp across all
allocated pages, and filter on that, just once, at the end of the
function.

For large-CPU systems, doing 2MB allocations during domain creation,
this cuts down the domain creation time *massively*.

TODO: It may make sense to move the filtering out into some callers,
such as memory.c:populate_physmap() and
memory.c:increase_reservation(), so that the filtering can be moved
outside their loops, too.

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 26056:177fdda0be56
xen-unstable date: Mon Oct 15 15:38:11 UTC 2012
---


diff -r cbb6326377bb -r 2f8236a49dcc xen/common/page_alloc.c
--- a/xen/common/page_alloc.c	Thu Oct 25 15:22:26 2012 +0200
+++ b/xen/common/page_alloc.c	Thu Oct 25 15:23:17 2012 +0200
@@ -414,9 +414,10 @@ static struct page_info *alloc_heap_page
     unsigned int first_node, i, j, zone = 0, nodemask_retry = 0;
     unsigned int node = (uint8_t)((memflags >> _MEMF_node) - 1);
     unsigned long request = 1UL << order;
-    cpumask_t mask;
     struct page_info *pg;
     nodemask_t nodemask = (d != NULL ) ? d->node_affinity : node_online_map;
+    bool_t need_tlbflush = 0;
+    uint32_t tlbflush_timestamp = 0;
 
     if ( node == NUMA_NO_NODE )
     {
@@ -530,22 +531,19 @@ static struct page_info *alloc_heap_page
     if ( d != NULL )
         d->last_alloc_node = node;
 
-    cpumask_clear(&mask);
-
     for ( i = 0; i < (1 << order); i++ )
     {
         /* Reference count must continuously be zero for free pages. */
         BUG_ON(pg[i].count_info != PGC_state_free);
         pg[i].count_info = PGC_state_inuse;
 
-        if ( pg[i].u.free.need_tlbflush )
+        if ( pg[i].u.free.need_tlbflush &&
+             (pg[i].tlbflush_timestamp <= tlbflush_current_time()) &&
+             (!need_tlbflush ||
+              (pg[i].tlbflush_timestamp > tlbflush_timestamp)) )
         {
-            /* Add in extra CPUs that need flushing because of this page. */
-            static cpumask_t extra_cpus_mask;
-
-            cpumask_andnot(&extra_cpus_mask, &cpu_online_map, &mask);
-            tlbflush_filter(extra_cpus_mask, pg[i].tlbflush_timestamp);
-            cpumask_or(&mask, &mask, &extra_cpus_mask);
+            need_tlbflush = 1;
+            tlbflush_timestamp = pg[i].tlbflush_timestamp;
         }
 
         /* Initialise fields which have other uses for free pages. */
@@ -555,10 +553,15 @@ static struct page_info *alloc_heap_page
 
     spin_unlock(&heap_lock);
 
-    if ( unlikely(!cpumask_empty(&mask)) )
+    if ( need_tlbflush )
     {
-        perfc_incr(need_flush_tlb_flush);
-        flush_tlb_mask(&mask);
+        cpumask_t mask = cpu_online_map;
+        tlbflush_filter(mask, tlbflush_timestamp);
+        if ( !cpumask_empty(&mask) )
+        {
+            perfc_incr(need_flush_tlb_flush);
+            flush_tlb_mask(&mask);
+        }
     }
 
     return pg;

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

From xen-changelog-bounces@lists.xen.org Thu Oct 25 20:22:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 25 Oct 2012 20:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TRTwT-0005LS-BW; Thu, 25 Oct 2012 20:22:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwS-0005L0-9I
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:12 +0000
Received: from [85.158.137.99:38114] by server-13.bemta-3.messagelabs.com id
	CB/7D-24887-37F99805; Thu, 25 Oct 2012 20:22:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-217.messagelabs.com!1351196529!23102283!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29296 invoked from network); 25 Oct 2012 20:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2012 20:22:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwP-0001Al-LE
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwP-0006dy-Jz
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:09 +0000
Message-Id: <E1TRTwP-0006dy-Jz@xenbits.xen.org>
Date: Thu, 25 Oct 2012 20:22:09 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86/oprof: adjust off-by-one
	counter range checks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1351171430 -7200
# Node ID 0fbfdecc80452868c78e0c1c872d730ce5fb0f6f
# Parent  2f8236a49dcce840a7b540a8796f6867292d656e
x86/oprof: adjust off-by-one counter range checks

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 26061:4b4c0c7a6031
xen-unstable date: Wed Oct 17 09:23:10 UTC 2012
---


diff -r 2f8236a49dcc -r 0fbfdecc8045 xen/arch/x86/oprofile/xenoprof.c
--- a/xen/arch/x86/oprofile/xenoprof.c	Thu Oct 25 15:23:17 2012 +0200
+++ b/xen/arch/x86/oprofile/xenoprof.c	Thu Oct 25 15:23:50 2012 +0200
@@ -26,7 +26,7 @@ int xenoprof_arch_counter(XEN_GUEST_HAND
     if ( copy_from_guest(&counter, arg, 1) )
         return -EFAULT;
 
-    if ( counter.ind > OP_MAX_COUNTER )
+    if ( counter.ind >= OP_MAX_COUNTER )
         return -E2BIG;
 
     counter_config[counter.ind].count     = counter.count;
@@ -64,7 +64,7 @@ int compat_oprof_arch_counter(XEN_GUEST_
     if ( copy_from_guest(&counter, arg, 1) )
         return -EFAULT;
 
-    if ( counter.ind > OP_MAX_COUNTER )
+    if ( counter.ind >= OP_MAX_COUNTER )
         return -E2BIG;
 
     counter_config[counter.ind].count     = counter.count;

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

From xen-changelog-bounces@lists.xen.org Thu Oct 25 20:22:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 25 Oct 2012 20:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TRTwT-0005LN-91; Thu, 25 Oct 2012 20:22:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwR-0005Kz-H0
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:11 +0000
Received: from [85.158.137.99:19633] by server-4.bemta-3.messagelabs.com id
	9C/F9-01405-27F99805; Thu, 25 Oct 2012 20:22:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-217.messagelabs.com!1351196528!19911267!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14632 invoked from network); 25 Oct 2012 20:22:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2012 20:22:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwO-0001Ac-Hp
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwO-0006dE-1G
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:08 +0000
Message-Id: <E1TRTwO-0006dE-1G@xenbits.xen.org>
Date: Thu, 25 Oct 2012 20:22:07 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86/amd: Fix xen_apic_write
	warnings 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

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1351171261 -7200
# Node ID 36fce7db3b3120b42ec60efad348c89dce4c4dcd
# Parent  27db446078b50d576d8425d36daf52f886b710e6
x86/amd: Fix xen_apic_write warnings in Dom0

[    0.020294] ------------[ cut here ]------------
[    0.020311] WARNING: at arch/x86/xen/enlighten.c:730
xen_apic_write+0x15/0x17()
[    0.020318] Hardware name: empty
[    0.020323] Modules linked in:
[    0.020334] Pid: 1, comm: swapper/0 Not tainted 3.3.8 #7
[    0.020340] Call Trace:
[    0.020354]  [<ffffffff81050379>] warn_slowpath_common+0x80/0x98
[    0.020369]  [<ffffffff810503a6>] warn_slowpath_null+0x15/0x17
[    0.020378]  [<ffffffff810034df>] xen_apic_write+0x15/0x17
[    0.020392]  [<ffffffff8101cb2b>] perf_events_lapic_init+0x2e/0x30
[    0.020410]  [<ffffffff81ee4dd0>] init_hw_perf_events+0x250/0x407
[    0.020419]  [<ffffffff81ee4b80>] ? check_bugs+0x2d/0x2d
[    0.020430]  [<ffffffff81002181>] do_one_initcall+0x7a/0x131
[    0.020444]  [<ffffffff81edbbf9>] kernel_init+0x91/0x15d
[    0.020456]  [<ffffffff817caaa4>] kernel_thread_helper+0x4/0x10
[    0.020471]  [<ffffffff817c347c>] ? retint_restore_args+0x5/0x6
[    0.020481]  [<ffffffff817caaa0>] ? gs_change+0x13/0x13
[    0.020500] ---[ end trace a7919e7f17c0a725 ]---

Kernel function check_hw_exists() writes 0xabcd to msr 0xc0010201 (Performance Event
Counter 0) and read it again to check if it is running as dom0. Early amd cpus does
not reset perf counters during warm reboot. If the kernel is booted with bare metal
and then as a dom0, the content of msr 0xc0010201 will stay and the checking will
pass and PMU will be enabled unexpectedly.

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

Don't reset the counters when used for the NMI watchdog.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 26054:983108e1b56b
xen-unstable date: Mon Oct 15 13:03:36 UTC 2012
---


diff -r 27db446078b5 -r 36fce7db3b31 xen/arch/x86/cpu/amd.c
--- a/xen/arch/x86/cpu/amd.c	Fri Oct 05 12:55:27 2012 +0200
+++ b/xen/arch/x86/cpu/amd.c	Thu Oct 25 15:21:01 2012 +0200
@@ -11,6 +11,7 @@
 #include <asm/hvm/support.h>
 #include <asm/setup.h> /* amd_init_cpu */
 #include <asm/acpi.h>
+#include <asm/apic.h>
 
 #include "cpu.h"
 
@@ -532,6 +533,17 @@ static void __devinit init_amd(struct cp
 	if (c->x86 > 0x11)
 		set_bit(X86_FEATURE_ARAT, c->x86_capability);
 
+	/*
+	 * Prior to Family 0x14, perf counters are not reset during warm reboot.
+	 * We have to reset them manually.
+	 */
+	if (nmi_watchdog != NMI_LOCAL_APIC && c->x86 < 0x14) {
+		wrmsrl(MSR_K7_PERFCTR0, 0);
+		wrmsrl(MSR_K7_PERFCTR1, 0);
+		wrmsrl(MSR_K7_PERFCTR2, 0);
+		wrmsrl(MSR_K7_PERFCTR3, 0);
+	}
+
 	if (cpuid_edx(0x80000007) & (1 << 10)) {
 		rdmsr(MSR_K7_HWCR, l, h);
 		l |= (1 << 27); /* Enable read-only APERF/MPERF bit */

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

From xen-changelog-bounces@lists.xen.org Thu Oct 25 20:22:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 25 Oct 2012 20:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TRTwW-0005MV-Qz; Thu, 25 Oct 2012 20:22:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwV-0005Lv-12
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:15 +0000
Received: from [85.158.139.211:2785] by server-15.bemta-5.messagelabs.com id
	25/57-26920-67F99805; Thu, 25 Oct 2012 20:22:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-206.messagelabs.com!1351196532!23803091!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1400 invoked from network); 25 Oct 2012 20:22:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2012 20:22:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwS-0001B0-J5
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwS-0006fD-97
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:12 +0000
Message-Id: <E1TRTwS-0006fD-97@xenbits.xen.org>
Date: Thu, 25 Oct 2012 20:22:11 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] xen: fix build when 'perfc=y'
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dario Faggioli <dario.faggioli@citrix.com>
# Date 1351172058 -7200
# Node ID 341cfc397548dfe9e89b8f4ab8ceb2cd5d6d05e9
# Parent  8c1fb247f39456e3b0540c09fb97233547f628e6
xen: fix build when 'perfc=y'

Which was failing with this:

 viridian.c: In function ?wrmsr_viridian_regs?:
 viridian.c:254:1: error: ?PERFC_mshv_wrmsr_apic_msr? undeclared
 (first use in this function)
 viridian.c:254:1: note: each undeclared identifier is reported only
 once for each function it appears in
 viridian.c: In function ?rdmsr_viridian_regs?:
 viridian.c:305:1: error: ?PERFC_mshv_rdmsr_apic_msr? undeclared
 (first use in this function)

as a consequence of 17b754cab7b0 using but not defining
the counters.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 26098:6d54c3338c52
xen-unstable date: Tue Oct 23 11:12:22 UTC 2012
---


diff -r 8c1fb247f394 -r 341cfc397548 xen/include/asm-x86/perfc_defn.h
--- a/xen/include/asm-x86/perfc_defn.h	Thu Oct 25 15:33:39 2012 +0200
+++ b/xen/include/asm-x86/perfc_defn.h	Thu Oct 25 15:34:18 2012 +0200
@@ -121,6 +121,7 @@ PERFCOUNTER(mshv_rdmsr_vp_index,        
 PERFCOUNTER(mshv_rdmsr_icr,             "MS Hv rdmsr icr")
 PERFCOUNTER(mshv_rdmsr_tpr,             "MS Hv rdmsr tpr")
 PERFCOUNTER(mshv_rdmsr_apic_assist,     "MS Hv rdmsr APIC assist")
+PERFCOUNTER(mshv_rdmsr_apic_msr,        "MS Hv rdmsr APIC msr")
 PERFCOUNTER(mshv_wrmsr_osid,            "MS Hv wrmsr Guest OS ID")
 PERFCOUNTER(mshv_wrmsr_hc_page,         "MS Hv wrmsr hypercall page")
 PERFCOUNTER(mshv_wrmsr_vp_index,        "MS Hv wrmsr vp index")
@@ -128,6 +129,7 @@ PERFCOUNTER(mshv_wrmsr_icr,             
 PERFCOUNTER(mshv_wrmsr_tpr,             "MS Hv wrmsr tpr")
 PERFCOUNTER(mshv_wrmsr_eoi,             "MS Hv wrmsr eoi")
 PERFCOUNTER(mshv_wrmsr_apic_assist,     "MS Hv wrmsr APIC assist")
+PERFCOUNTER(mshv_wrmsr_apic_msr,        "MS Hv wrmsr APIC msr")
 
 PERFCOUNTER(realmode_emulations, "realmode instructions emulated")
 PERFCOUNTER(realmode_exits,      "vmexits from realmode")

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

From xen-changelog-bounces@lists.xen.org Thu Oct 25 20:22:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 25 Oct 2012 20:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TRTwU-0005Ls-GS; Thu, 25 Oct 2012 20:22:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwS-0005L5-Pp
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:12 +0000
Received: from [85.158.143.35:4130] by server-3.bemta-4.messagelabs.com id
	DA/EA-24279-37F99805; Thu, 25 Oct 2012 20:22:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1351196528!5313608!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13233 invoked from network); 25 Oct 2012 20:22:09 -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;
	25 Oct 2012 20:22:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwO-0001Af-Pl
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwO-0006dT-Hq
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:08 +0000
Message-Id: <E1TRTwO-0006dT-Hq@xenbits.xen.org>
Date: Thu, 25 Oct 2012 20:22:08 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86/xenoprof: fix kernel/user
	mode detection for HVM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jacob Shin <jacob.shin@amd.com>
# Date 1351171346 -7200
# Node ID cbb6326377bb99d10dc288a23a389273f3a7ffbc
# Parent  36fce7db3b3120b42ec60efad348c89dce4c4dcd
x86/xenoprof: fix kernel/user mode detection for HVM

While trying oprofile under Xen, I noticed that HVM passive domain's
kernel addresses were showing up as user application. It turns out
under HVM get_cpu_user_regs()->cs contains 0x0000beef.

Signed-off-by: Jacob Shin <jacob.shin@amd.com>

Don't cast away const-ness. Use SS instead of CS to determine ring.
Special-case real and protected mode.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 26055:14e32621dbaf
xen-unstable date: Mon Oct 15 13:04:51 UTC 2012
---


diff -r 36fce7db3b31 -r cbb6326377bb xen/arch/x86/oprofile/xenoprof.c
--- a/xen/arch/x86/oprofile/xenoprof.c	Thu Oct 25 15:21:01 2012 +0200
+++ b/xen/arch/x86/oprofile/xenoprof.c	Thu Oct 25 15:22:26 2012 +0200
@@ -78,16 +78,26 @@ int compat_oprof_arch_counter(XEN_GUEST_
 }
 #endif
 
-int xenoprofile_get_mode(const struct vcpu *v,
-                         const struct cpu_user_regs *regs)
+int xenoprofile_get_mode(struct vcpu *curr, const struct cpu_user_regs *regs)
 {
     if ( !guest_mode(regs) )
         return 2;
 
-    if ( is_hvm_vcpu(v) )
-        return ((regs->cs & 3) != 3);
+    if ( !is_hvm_vcpu(curr) )
+        return guest_kernel_mode(curr, regs);
 
-    return guest_kernel_mode(v, regs);  
+    switch ( hvm_guest_x86_mode(curr) )
+    {
+        struct segment_register ss;
+
+    case 0: /* real mode */
+        return 1;
+    case 1: /* vm86 mode */
+        return 0;
+    default:
+        hvm_get_segment_register(curr, x86_seg_ss, &ss);
+        return (ss.sel & 3) != 3;
+    }
 }
 
 /*
diff -r 36fce7db3b31 -r cbb6326377bb xen/include/asm-x86/xenoprof.h
--- a/xen/include/asm-x86/xenoprof.h	Thu Oct 25 15:21:01 2012 +0200
+++ b/xen/include/asm-x86/xenoprof.h	Thu Oct 25 15:22:26 2012 +0200
@@ -56,7 +56,7 @@ static inline void ibs_init(void) {}
 #define ibs_caps 0
 #endif
 
-int xenoprofile_get_mode(const struct vcpu *, const struct cpu_user_regs *);
+int xenoprofile_get_mode(struct vcpu *, const struct cpu_user_regs *);
 
 static inline int xenoprof_backtrace_supported(void)
 {

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

From xen-changelog-bounces@lists.xen.org Thu Oct 25 20:22:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 25 Oct 2012 20:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TRTwT-0005LN-91; Thu, 25 Oct 2012 20:22:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwR-0005Kz-H0
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:11 +0000
Received: from [85.158.137.99:19633] by server-4.bemta-3.messagelabs.com id
	9C/F9-01405-27F99805; Thu, 25 Oct 2012 20:22:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-217.messagelabs.com!1351196528!19911267!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14632 invoked from network); 25 Oct 2012 20:22:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2012 20:22:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwO-0001Ac-Hp
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwO-0006dE-1G
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:08 +0000
Message-Id: <E1TRTwO-0006dE-1G@xenbits.xen.org>
Date: Thu, 25 Oct 2012 20:22:07 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86/amd: Fix xen_apic_write
	warnings 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

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1351171261 -7200
# Node ID 36fce7db3b3120b42ec60efad348c89dce4c4dcd
# Parent  27db446078b50d576d8425d36daf52f886b710e6
x86/amd: Fix xen_apic_write warnings in Dom0

[    0.020294] ------------[ cut here ]------------
[    0.020311] WARNING: at arch/x86/xen/enlighten.c:730
xen_apic_write+0x15/0x17()
[    0.020318] Hardware name: empty
[    0.020323] Modules linked in:
[    0.020334] Pid: 1, comm: swapper/0 Not tainted 3.3.8 #7
[    0.020340] Call Trace:
[    0.020354]  [<ffffffff81050379>] warn_slowpath_common+0x80/0x98
[    0.020369]  [<ffffffff810503a6>] warn_slowpath_null+0x15/0x17
[    0.020378]  [<ffffffff810034df>] xen_apic_write+0x15/0x17
[    0.020392]  [<ffffffff8101cb2b>] perf_events_lapic_init+0x2e/0x30
[    0.020410]  [<ffffffff81ee4dd0>] init_hw_perf_events+0x250/0x407
[    0.020419]  [<ffffffff81ee4b80>] ? check_bugs+0x2d/0x2d
[    0.020430]  [<ffffffff81002181>] do_one_initcall+0x7a/0x131
[    0.020444]  [<ffffffff81edbbf9>] kernel_init+0x91/0x15d
[    0.020456]  [<ffffffff817caaa4>] kernel_thread_helper+0x4/0x10
[    0.020471]  [<ffffffff817c347c>] ? retint_restore_args+0x5/0x6
[    0.020481]  [<ffffffff817caaa0>] ? gs_change+0x13/0x13
[    0.020500] ---[ end trace a7919e7f17c0a725 ]---

Kernel function check_hw_exists() writes 0xabcd to msr 0xc0010201 (Performance Event
Counter 0) and read it again to check if it is running as dom0. Early amd cpus does
not reset perf counters during warm reboot. If the kernel is booted with bare metal
and then as a dom0, the content of msr 0xc0010201 will stay and the checking will
pass and PMU will be enabled unexpectedly.

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

Don't reset the counters when used for the NMI watchdog.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 26054:983108e1b56b
xen-unstable date: Mon Oct 15 13:03:36 UTC 2012
---


diff -r 27db446078b5 -r 36fce7db3b31 xen/arch/x86/cpu/amd.c
--- a/xen/arch/x86/cpu/amd.c	Fri Oct 05 12:55:27 2012 +0200
+++ b/xen/arch/x86/cpu/amd.c	Thu Oct 25 15:21:01 2012 +0200
@@ -11,6 +11,7 @@
 #include <asm/hvm/support.h>
 #include <asm/setup.h> /* amd_init_cpu */
 #include <asm/acpi.h>
+#include <asm/apic.h>
 
 #include "cpu.h"
 
@@ -532,6 +533,17 @@ static void __devinit init_amd(struct cp
 	if (c->x86 > 0x11)
 		set_bit(X86_FEATURE_ARAT, c->x86_capability);
 
+	/*
+	 * Prior to Family 0x14, perf counters are not reset during warm reboot.
+	 * We have to reset them manually.
+	 */
+	if (nmi_watchdog != NMI_LOCAL_APIC && c->x86 < 0x14) {
+		wrmsrl(MSR_K7_PERFCTR0, 0);
+		wrmsrl(MSR_K7_PERFCTR1, 0);
+		wrmsrl(MSR_K7_PERFCTR2, 0);
+		wrmsrl(MSR_K7_PERFCTR3, 0);
+	}
+
 	if (cpuid_edx(0x80000007) & (1 << 10)) {
 		rdmsr(MSR_K7_HWCR, l, h);
 		l |= (1 << 27); /* Enable read-only APERF/MPERF bit */

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

From xen-changelog-bounces@lists.xen.org Thu Oct 25 20:22:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 25 Oct 2012 20:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TRTwW-0005MV-Qz; Thu, 25 Oct 2012 20:22:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwV-0005Lv-12
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:15 +0000
Received: from [85.158.139.211:2785] by server-15.bemta-5.messagelabs.com id
	25/57-26920-67F99805; Thu, 25 Oct 2012 20:22:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-206.messagelabs.com!1351196532!23803091!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1400 invoked from network); 25 Oct 2012 20:22:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2012 20:22:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwS-0001B0-J5
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwS-0006fD-97
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:12 +0000
Message-Id: <E1TRTwS-0006fD-97@xenbits.xen.org>
Date: Thu, 25 Oct 2012 20:22:11 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] xen: fix build when 'perfc=y'
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dario Faggioli <dario.faggioli@citrix.com>
# Date 1351172058 -7200
# Node ID 341cfc397548dfe9e89b8f4ab8ceb2cd5d6d05e9
# Parent  8c1fb247f39456e3b0540c09fb97233547f628e6
xen: fix build when 'perfc=y'

Which was failing with this:

 viridian.c: In function ?wrmsr_viridian_regs?:
 viridian.c:254:1: error: ?PERFC_mshv_wrmsr_apic_msr? undeclared
 (first use in this function)
 viridian.c:254:1: note: each undeclared identifier is reported only
 once for each function it appears in
 viridian.c: In function ?rdmsr_viridian_regs?:
 viridian.c:305:1: error: ?PERFC_mshv_rdmsr_apic_msr? undeclared
 (first use in this function)

as a consequence of 17b754cab7b0 using but not defining
the counters.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 26098:6d54c3338c52
xen-unstable date: Tue Oct 23 11:12:22 UTC 2012
---


diff -r 8c1fb247f394 -r 341cfc397548 xen/include/asm-x86/perfc_defn.h
--- a/xen/include/asm-x86/perfc_defn.h	Thu Oct 25 15:33:39 2012 +0200
+++ b/xen/include/asm-x86/perfc_defn.h	Thu Oct 25 15:34:18 2012 +0200
@@ -121,6 +121,7 @@ PERFCOUNTER(mshv_rdmsr_vp_index,        
 PERFCOUNTER(mshv_rdmsr_icr,             "MS Hv rdmsr icr")
 PERFCOUNTER(mshv_rdmsr_tpr,             "MS Hv rdmsr tpr")
 PERFCOUNTER(mshv_rdmsr_apic_assist,     "MS Hv rdmsr APIC assist")
+PERFCOUNTER(mshv_rdmsr_apic_msr,        "MS Hv rdmsr APIC msr")
 PERFCOUNTER(mshv_wrmsr_osid,            "MS Hv wrmsr Guest OS ID")
 PERFCOUNTER(mshv_wrmsr_hc_page,         "MS Hv wrmsr hypercall page")
 PERFCOUNTER(mshv_wrmsr_vp_index,        "MS Hv wrmsr vp index")
@@ -128,6 +129,7 @@ PERFCOUNTER(mshv_wrmsr_icr,             
 PERFCOUNTER(mshv_wrmsr_tpr,             "MS Hv wrmsr tpr")
 PERFCOUNTER(mshv_wrmsr_eoi,             "MS Hv wrmsr eoi")
 PERFCOUNTER(mshv_wrmsr_apic_assist,     "MS Hv wrmsr APIC assist")
+PERFCOUNTER(mshv_wrmsr_apic_msr,        "MS Hv wrmsr APIC msr")
 
 PERFCOUNTER(realmode_emulations, "realmode instructions emulated")
 PERFCOUNTER(realmode_exits,      "vmexits from realmode")

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

From xen-changelog-bounces@lists.xen.org Thu Oct 25 20:22:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 25 Oct 2012 20:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TRTwU-0005Ls-GS; Thu, 25 Oct 2012 20:22:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwS-0005L5-Pp
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:12 +0000
Received: from [85.158.143.35:4130] by server-3.bemta-4.messagelabs.com id
	DA/EA-24279-37F99805; Thu, 25 Oct 2012 20:22:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1351196528!5313608!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13233 invoked from network); 25 Oct 2012 20:22:09 -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;
	25 Oct 2012 20:22:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwO-0001Af-Pl
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwO-0006dT-Hq
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:08 +0000
Message-Id: <E1TRTwO-0006dT-Hq@xenbits.xen.org>
Date: Thu, 25 Oct 2012 20:22:08 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86/xenoprof: fix kernel/user
	mode detection for HVM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jacob Shin <jacob.shin@amd.com>
# Date 1351171346 -7200
# Node ID cbb6326377bb99d10dc288a23a389273f3a7ffbc
# Parent  36fce7db3b3120b42ec60efad348c89dce4c4dcd
x86/xenoprof: fix kernel/user mode detection for HVM

While trying oprofile under Xen, I noticed that HVM passive domain's
kernel addresses were showing up as user application. It turns out
under HVM get_cpu_user_regs()->cs contains 0x0000beef.

Signed-off-by: Jacob Shin <jacob.shin@amd.com>

Don't cast away const-ness. Use SS instead of CS to determine ring.
Special-case real and protected mode.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 26055:14e32621dbaf
xen-unstable date: Mon Oct 15 13:04:51 UTC 2012
---


diff -r 36fce7db3b31 -r cbb6326377bb xen/arch/x86/oprofile/xenoprof.c
--- a/xen/arch/x86/oprofile/xenoprof.c	Thu Oct 25 15:21:01 2012 +0200
+++ b/xen/arch/x86/oprofile/xenoprof.c	Thu Oct 25 15:22:26 2012 +0200
@@ -78,16 +78,26 @@ int compat_oprof_arch_counter(XEN_GUEST_
 }
 #endif
 
-int xenoprofile_get_mode(const struct vcpu *v,
-                         const struct cpu_user_regs *regs)
+int xenoprofile_get_mode(struct vcpu *curr, const struct cpu_user_regs *regs)
 {
     if ( !guest_mode(regs) )
         return 2;
 
-    if ( is_hvm_vcpu(v) )
-        return ((regs->cs & 3) != 3);
+    if ( !is_hvm_vcpu(curr) )
+        return guest_kernel_mode(curr, regs);
 
-    return guest_kernel_mode(v, regs);  
+    switch ( hvm_guest_x86_mode(curr) )
+    {
+        struct segment_register ss;
+
+    case 0: /* real mode */
+        return 1;
+    case 1: /* vm86 mode */
+        return 0;
+    default:
+        hvm_get_segment_register(curr, x86_seg_ss, &ss);
+        return (ss.sel & 3) != 3;
+    }
 }
 
 /*
diff -r 36fce7db3b31 -r cbb6326377bb xen/include/asm-x86/xenoprof.h
--- a/xen/include/asm-x86/xenoprof.h	Thu Oct 25 15:21:01 2012 +0200
+++ b/xen/include/asm-x86/xenoprof.h	Thu Oct 25 15:22:26 2012 +0200
@@ -56,7 +56,7 @@ static inline void ibs_init(void) {}
 #define ibs_caps 0
 #endif
 
-int xenoprofile_get_mode(const struct vcpu *, const struct cpu_user_regs *);
+int xenoprofile_get_mode(struct vcpu *, const struct cpu_user_regs *);
 
 static inline int xenoprof_backtrace_supported(void)
 {

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

From xen-changelog-bounces@lists.xen.org Thu Oct 25 20:22:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 25 Oct 2012 20:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TRTwW-0005Mf-Vr; Thu, 25 Oct 2012 20:22:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwV-0005Lv-Gz
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:15 +0000
Received: from [85.158.139.211:39090] by server-15.bemta-5.messagelabs.com id
	56/57-26920-67F99805; Thu, 25 Oct 2012 20:22:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-206.messagelabs.com!1351196533!23770337!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19085 invoked from network); 25 Oct 2012 20:22:13 -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;
	25 Oct 2012 20:22:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwS-0001B3-R6
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwS-0006fS-Pn
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:12 +0000
Message-Id: <E1TRTwS-0006fS-Pn@xenbits.xen.org>
Date: Thu, 25 Oct 2012 20:22:12 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86: don't special case first
	IO-APIC
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1351172192 -7200
# Node ID 40ccbee890e1fc053de3046bbc3d13b8ff6f5d63
# Parent  341cfc397548dfe9e89b8f4ab8ceb2cd5d6d05e9
x86: don't special case first IO-APIC

It has always been puzzling me why the first IO-APIC gets special cased
in two places, and finally Xen got run on a system where this breaks:

(XEN) ACPI: IOAPIC (id[0x10] address[0xfecff000] gsi_base[0])
(XEN) IOAPIC[0]: apic_id 16, version 17, address 0xfecff000, GSI 0-2
(XEN) ACPI: IOAPIC (id[0x0f] address[0xfec00000] gsi_base[3])
(XEN) IOAPIC[1]: apic_id 15, version 17, address 0xfec00000, GSI 3-38
(XEN) ACPI: IOAPIC (id[0x0e] address[0xfec01000] gsi_base[39])
(XEN) IOAPIC[2]: apic_id 14, version 17, address 0xfec01000, GSI 39-74
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 1 global_irq 4 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 5 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 3 global_irq 6 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 4 global_irq 7 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 6 global_irq 9 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 7 global_irq 10 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 8 global_irq 11 low edge)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 12 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 12 global_irq 15 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 13 global_irq 16 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 14 global_irq 17 low edge)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 15 global_irq 18 dfl dfl)

i.e. all legacy IRQs (apart from the timer one, but the firmware passed
data doesn't look right for that case anyway, as both Xen and native
Linux are falling back to use the virtual wire setup for IRQ0,
apparently rather using pin 2 of the first IO-APIC) are being handled
by the second IO-APIC.

This at once eliminates the possibility of an unmasked RTE getting
written without having got a vector put in place (in
setup_IO_APIC_irqs()).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 26102:22e08c9ac770
xen-unstable date: Wed Oct 24 15:51:48 UTC 2012
---


diff -r 341cfc397548 -r 40ccbee890e1 xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c	Thu Oct 25 15:34:18 2012 +0200
+++ b/xen/arch/x86/io_apic.c	Thu Oct 25 15:36:32 2012 +0200
@@ -999,18 +999,17 @@ static void __init setup_IO_APIC_irqs(vo
             else
                 add_pin_to_irq(irq, apic, pin);
 
-            if (!apic && !IO_APIC_IRQ(irq))
+            if (!IO_APIC_IRQ(irq))
                 continue;
 
-            if (IO_APIC_IRQ(irq)) {
-                vector = assign_irq_vector(irq, NULL);
-                BUG_ON(vector < 0);
-                entry.vector = vector;
-                ioapic_register_intr(irq, IOAPIC_AUTO);
+            vector = assign_irq_vector(irq, NULL);
+            BUG_ON(vector < 0);
+            entry.vector = vector;
+            ioapic_register_intr(irq, IOAPIC_AUTO);
 
-                if (!apic && platform_legacy_irq(irq))
-                    disable_8259A_irq(irq_to_desc(irq));
-            }
+            if (platform_legacy_irq(irq))
+                disable_8259A_irq(irq_to_desc(irq));
+
             desc = irq_to_desc(irq);
             SET_DEST(entry.dest.dest32, entry.dest.logical.logical_dest,
                      cpu_mask_to_apicid(desc->arch.cpu_mask));
@@ -2257,18 +2256,15 @@ unsigned apic_gsi_base(int apic);
 
 static int apic_pin_2_gsi_irq(int apic, int pin)
 {
-    int idx, irq;
+    int idx;
 
     if (apic < 0)
        return -EINVAL;
 
-    irq = apic_gsi_base(apic) + pin;
-    if (apic == 0) {
-        idx = find_irq_entry(apic, pin, mp_INT);
-        if (idx >= 0)
-            irq = pin_2_irq(idx, apic, pin);
-    }
-    return irq;
+    idx = find_irq_entry(apic, pin, mp_INT);
+
+    return idx >= 0 ? pin_2_irq(idx, apic, pin)
+                    : apic_gsi_base(apic) + pin;
 }
 
 int ioapic_guest_read(unsigned long physbase, unsigned int reg, u32 *pval)

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

From xen-changelog-bounces@lists.xen.org Thu Oct 25 20:22:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 25 Oct 2012 20:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TRTwW-0005Mf-Vr; Thu, 25 Oct 2012 20:22:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwV-0005Lv-Gz
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:15 +0000
Received: from [85.158.139.211:39090] by server-15.bemta-5.messagelabs.com id
	56/57-26920-67F99805; Thu, 25 Oct 2012 20:22:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-206.messagelabs.com!1351196533!23770337!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19085 invoked from network); 25 Oct 2012 20:22:13 -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;
	25 Oct 2012 20:22:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwS-0001B3-R6
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwS-0006fS-Pn
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:12 +0000
Message-Id: <E1TRTwS-0006fS-Pn@xenbits.xen.org>
Date: Thu, 25 Oct 2012 20:22:12 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86: don't special case first
	IO-APIC
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1351172192 -7200
# Node ID 40ccbee890e1fc053de3046bbc3d13b8ff6f5d63
# Parent  341cfc397548dfe9e89b8f4ab8ceb2cd5d6d05e9
x86: don't special case first IO-APIC

It has always been puzzling me why the first IO-APIC gets special cased
in two places, and finally Xen got run on a system where this breaks:

(XEN) ACPI: IOAPIC (id[0x10] address[0xfecff000] gsi_base[0])
(XEN) IOAPIC[0]: apic_id 16, version 17, address 0xfecff000, GSI 0-2
(XEN) ACPI: IOAPIC (id[0x0f] address[0xfec00000] gsi_base[3])
(XEN) IOAPIC[1]: apic_id 15, version 17, address 0xfec00000, GSI 3-38
(XEN) ACPI: IOAPIC (id[0x0e] address[0xfec01000] gsi_base[39])
(XEN) IOAPIC[2]: apic_id 14, version 17, address 0xfec01000, GSI 39-74
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 1 global_irq 4 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 5 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 3 global_irq 6 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 4 global_irq 7 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 6 global_irq 9 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 7 global_irq 10 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 8 global_irq 11 low edge)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 12 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 12 global_irq 15 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 13 global_irq 16 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 14 global_irq 17 low edge)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 15 global_irq 18 dfl dfl)

i.e. all legacy IRQs (apart from the timer one, but the firmware passed
data doesn't look right for that case anyway, as both Xen and native
Linux are falling back to use the virtual wire setup for IRQ0,
apparently rather using pin 2 of the first IO-APIC) are being handled
by the second IO-APIC.

This at once eliminates the possibility of an unmasked RTE getting
written without having got a vector put in place (in
setup_IO_APIC_irqs()).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 26102:22e08c9ac770
xen-unstable date: Wed Oct 24 15:51:48 UTC 2012
---


diff -r 341cfc397548 -r 40ccbee890e1 xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c	Thu Oct 25 15:34:18 2012 +0200
+++ b/xen/arch/x86/io_apic.c	Thu Oct 25 15:36:32 2012 +0200
@@ -999,18 +999,17 @@ static void __init setup_IO_APIC_irqs(vo
             else
                 add_pin_to_irq(irq, apic, pin);
 
-            if (!apic && !IO_APIC_IRQ(irq))
+            if (!IO_APIC_IRQ(irq))
                 continue;
 
-            if (IO_APIC_IRQ(irq)) {
-                vector = assign_irq_vector(irq, NULL);
-                BUG_ON(vector < 0);
-                entry.vector = vector;
-                ioapic_register_intr(irq, IOAPIC_AUTO);
+            vector = assign_irq_vector(irq, NULL);
+            BUG_ON(vector < 0);
+            entry.vector = vector;
+            ioapic_register_intr(irq, IOAPIC_AUTO);
 
-                if (!apic && platform_legacy_irq(irq))
-                    disable_8259A_irq(irq_to_desc(irq));
-            }
+            if (platform_legacy_irq(irq))
+                disable_8259A_irq(irq_to_desc(irq));
+
             desc = irq_to_desc(irq);
             SET_DEST(entry.dest.dest32, entry.dest.logical.logical_dest,
                      cpu_mask_to_apicid(desc->arch.cpu_mask));
@@ -2257,18 +2256,15 @@ unsigned apic_gsi_base(int apic);
 
 static int apic_pin_2_gsi_irq(int apic, int pin)
 {
-    int idx, irq;
+    int idx;
 
     if (apic < 0)
        return -EINVAL;
 
-    irq = apic_gsi_base(apic) + pin;
-    if (apic == 0) {
-        idx = find_irq_entry(apic, pin, mp_INT);
-        if (idx >= 0)
-            irq = pin_2_irq(idx, apic, pin);
-    }
-    return irq;
+    idx = find_irq_entry(apic, pin, mp_INT);
+
+    return idx >= 0 ? pin_2_irq(idx, apic, pin)
+                    : apic_gsi_base(apic) + pin;
 }
 
 int ioapic_guest_read(unsigned long physbase, unsigned int reg, u32 *pval)

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

From xen-changelog-bounces@lists.xen.org Thu Oct 25 20:22:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 25 Oct 2012 20:22:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TRTwa-0005PU-2R; Thu, 25 Oct 2012 20:22:20 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwZ-0005N5-4E
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:19 +0000
Received: from [85.158.138.51:13869] by server-7.bemta-3.messagelabs.com id
	86/9D-06991-A7F99805; Thu, 25 Oct 2012 20:22:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1351196532!27480792!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12169 invoked from network); 25 Oct 2012 20:22:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2012 20:22:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwR-0001Ax-QC
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwR-0006ey-P0
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:11 +0000
Message-Id: <E1TRTwR-0006ey-P0@xenbits.xen.org>
Date: Thu, 25 Oct 2012 20:22:11 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] nestedsvm: fix VMEXIT emulation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1351172019 -7200
# Node ID 8c1fb247f39456e3b0540c09fb97233547f628e6
# Parent  67eb562ebe06e4fc00fe9f085e83a06099c5bc13
nestedsvm: fix VMEXIT emulation

Values in regs can be newer than those in the shadow vmcb (e.g. due to
an instruction emulation right before). So use the values from regs.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Tim Deegan <tim@xen.org>
xen-unstable changeset: 26096:d642720e1ea9
xen-unstable date: Tue Oct 23 07:14:27 UTC 2012
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 67eb562ebe06 -r 8c1fb247f394 xen/arch/x86/hvm/svm/nestedsvm.c
--- a/xen/arch/x86/hvm/svm/nestedsvm.c	Thu Oct 25 15:32:06 2012 +0200
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c	Thu Oct 25 15:33:39 2012 +0200
@@ -995,7 +995,7 @@ nsvm_vmcb_guest_intercepts_trap(struct v
 }
 
 static int
-nsvm_vmcb_prepare4vmexit(struct vcpu *v)
+nsvm_vmcb_prepare4vmexit(struct vcpu *v, struct cpu_user_regs *regs)
 {
     struct nestedvcpu *nv = &vcpu_nestedhvm(v);
     struct nestedsvm *svm = &vcpu_nestedsvm(v);
@@ -1119,17 +1119,22 @@ nsvm_vmcb_prepare4vmexit(struct vcpu *v)
     ns_vmcb->_dr7 = n2vmcb->_dr7;
     ns_vmcb->_dr6 = n2vmcb->_dr6;
 
+    /* Restore registers from regs as those values
+     * can be newer than in n2vmcb (e.g. due to an
+     * instruction emulation right before).
+     */
+
     /* RFLAGS */
-    ns_vmcb->rflags = n2vmcb->rflags;
+    ns_vmcb->rflags = n2vmcb->rflags = regs->eflags;
 
     /* RIP */
-    ns_vmcb->rip = n2vmcb->rip;
+    ns_vmcb->rip = n2vmcb->rip = regs->eip;
 
     /* RSP */
-    ns_vmcb->rsp = n2vmcb->rsp;
+    ns_vmcb->rsp = n2vmcb->rsp = regs->esp;
 
     /* RAX */
-    ns_vmcb->rax = n2vmcb->rax;
+    ns_vmcb->rax = n2vmcb->rax = regs->eax;
 
     /* Keep the l2 guest values of the fs, gs, ldtr, tr, kerngsbase,
      * star, lstar, cstar, sfmask, sysenter_cs, sysenter_esp,
@@ -1363,7 +1368,7 @@ nestedsvm_vmexit_n2n1(struct vcpu *v, st
     ASSERT(vcpu_nestedhvm(v).nv_vmswitch_in_progress);
     ASSERT(nestedhvm_vcpu_in_guestmode(v));
 
-    rc = nsvm_vmcb_prepare4vmexit(v);
+    rc = nsvm_vmcb_prepare4vmexit(v, regs);
     if (rc)
         ret = NESTEDHVM_VMEXIT_ERROR;
 

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

From xen-changelog-bounces@lists.xen.org Thu Oct 25 20:22:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 25 Oct 2012 20:22:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TRTwa-0005PU-2R; Thu, 25 Oct 2012 20:22:20 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwZ-0005N5-4E
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:19 +0000
Received: from [85.158.138.51:13869] by server-7.bemta-3.messagelabs.com id
	86/9D-06991-A7F99805; Thu, 25 Oct 2012 20:22:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1351196532!27480792!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12169 invoked from network); 25 Oct 2012 20:22:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2012 20:22:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwR-0001Ax-QC
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRTwR-0006ey-P0
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 20:22:11 +0000
Message-Id: <E1TRTwR-0006ey-P0@xenbits.xen.org>
Date: Thu, 25 Oct 2012 20:22:11 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] nestedsvm: fix VMEXIT emulation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1351172019 -7200
# Node ID 8c1fb247f39456e3b0540c09fb97233547f628e6
# Parent  67eb562ebe06e4fc00fe9f085e83a06099c5bc13
nestedsvm: fix VMEXIT emulation

Values in regs can be newer than those in the shadow vmcb (e.g. due to
an instruction emulation right before). So use the values from regs.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Tim Deegan <tim@xen.org>
xen-unstable changeset: 26096:d642720e1ea9
xen-unstable date: Tue Oct 23 07:14:27 UTC 2012
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 67eb562ebe06 -r 8c1fb247f394 xen/arch/x86/hvm/svm/nestedsvm.c
--- a/xen/arch/x86/hvm/svm/nestedsvm.c	Thu Oct 25 15:32:06 2012 +0200
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c	Thu Oct 25 15:33:39 2012 +0200
@@ -995,7 +995,7 @@ nsvm_vmcb_guest_intercepts_trap(struct v
 }
 
 static int
-nsvm_vmcb_prepare4vmexit(struct vcpu *v)
+nsvm_vmcb_prepare4vmexit(struct vcpu *v, struct cpu_user_regs *regs)
 {
     struct nestedvcpu *nv = &vcpu_nestedhvm(v);
     struct nestedsvm *svm = &vcpu_nestedsvm(v);
@@ -1119,17 +1119,22 @@ nsvm_vmcb_prepare4vmexit(struct vcpu *v)
     ns_vmcb->_dr7 = n2vmcb->_dr7;
     ns_vmcb->_dr6 = n2vmcb->_dr6;
 
+    /* Restore registers from regs as those values
+     * can be newer than in n2vmcb (e.g. due to an
+     * instruction emulation right before).
+     */
+
     /* RFLAGS */
-    ns_vmcb->rflags = n2vmcb->rflags;
+    ns_vmcb->rflags = n2vmcb->rflags = regs->eflags;
 
     /* RIP */
-    ns_vmcb->rip = n2vmcb->rip;
+    ns_vmcb->rip = n2vmcb->rip = regs->eip;
 
     /* RSP */
-    ns_vmcb->rsp = n2vmcb->rsp;
+    ns_vmcb->rsp = n2vmcb->rsp = regs->esp;
 
     /* RAX */
-    ns_vmcb->rax = n2vmcb->rax;
+    ns_vmcb->rax = n2vmcb->rax = regs->eax;
 
     /* Keep the l2 guest values of the fs, gs, ldtr, tr, kerngsbase,
      * star, lstar, cstar, sfmask, sysenter_cs, sysenter_esp,
@@ -1363,7 +1368,7 @@ nestedsvm_vmexit_n2n1(struct vcpu *v, st
     ASSERT(vcpu_nestedhvm(v).nv_vmswitch_in_progress);
     ASSERT(nestedhvm_vcpu_in_guestmode(v));
 
-    rc = nsvm_vmcb_prepare4vmexit(v);
+    rc = nsvm_vmcb_prepare4vmexit(v, regs);
     if (rc)
         ret = NESTEDHVM_VMEXIT_ERROR;
 

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

From xen-changelog-bounces@lists.xen.org Thu Oct 25 21:55:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 25 Oct 2012 21:55:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TRVOW-0006Dw-26; Thu, 25 Oct 2012 21:55:16 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRVOU-0006DT-OU
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 21:55:15 +0000
Received: from [193.109.254.147:16746] by server-14.bemta-14.messagelabs.com
	id 7D/4E-14517-245B9805; Thu, 25 Oct 2012 21:55:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-27.messagelabs.com!1351202112!8838188!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28238 invoked from network); 25 Oct 2012 21:55:13 -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;
	25 Oct 2012 21:55:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRVOR-0002Gr-R4
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 21:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRVOR-0000ew-MB
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 21:55:11 +0000
Message-Id: <E1TRVOR-0000ew-MB@xenbits.xen.org>
Date: Thu, 25 Oct 2012 21:55:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/MCE: Implement clearbank
	callback for AMD
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1351168089 -7200
# Node ID 1883c1d29de97454df8f3b6723f0a853a09f4af6
# Parent  5fb601e96d0fcabfd19605aa7a314cbb3d321e7d
x86/MCE: Implement clearbank callback for AMD

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>

Move initialization of mce_clear_banks into common code (would not get
initialized on AMD CPUs otherwise). Mark per-CPU struct mce_bank
pointers read-mostly.

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


diff -r 5fb601e96d0f -r 1883c1d29de9 xen/arch/x86/cpu/mcheck/amd_k8.c
--- a/xen/arch/x86/cpu/mcheck/amd_k8.c	Thu Oct 25 14:26:08 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/amd_k8.c	Thu Oct 25 14:28:09 2012 +0200
@@ -72,7 +72,23 @@
 /* Machine Check Handler for AMD K8 family series */
 static void k8_machine_check(struct cpu_user_regs *regs, long error_code)
 {
-	mcheck_cmn_handler(regs, error_code, mca_allbanks, NULL);
+	mcheck_cmn_handler(regs, error_code, mca_allbanks,
+			   __get_cpu_var(mce_clear_banks));
+}
+
+static int k8_need_clearbank_scan(enum mca_source who, uint64_t status)
+{
+	if (who != MCA_MCE_SCAN)
+		return 1;
+
+	/*
+	 * For fatal error, it shouldn't be cleared so that sticky bank
+	 * have a chance to be handled after reboot by polling.
+	 */
+	if ((status & MCi_STATUS_UC) && (status & MCi_STATUS_PCC))
+		return 0;
+
+	return 1;
 }
 
 /* AMD K8 machine check */
@@ -85,6 +101,7 @@ enum mcheck_type amd_k8_mcheck_init(stru
 
 	mce_handler_init();
 	x86_mce_vector_register(k8_machine_check);
+	mce_need_clearbank_register(k8_need_clearbank_scan);
 
 	for (i = 0; i < nr_mce_banks; i++) {
 		if (quirkflag == MCEQUIRK_K8_GART && i == 4) {
diff -r 5fb601e96d0f -r 1883c1d29de9 xen/arch/x86/cpu/mcheck/mce.c
--- a/xen/arch/x86/cpu/mcheck/mce.c	Thu Oct 25 14:26:08 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/mce.c	Thu Oct 25 14:28:09 2012 +0200
@@ -35,6 +35,10 @@ bool_t is_mc_panic;
 unsigned int __read_mostly nr_mce_banks;
 unsigned int __read_mostly firstbank;
 
+DEFINE_PER_CPU_READ_MOSTLY(struct mca_banks *, poll_bankmask);
+DEFINE_PER_CPU_READ_MOSTLY(struct mca_banks *, no_cmci_banks);
+DEFINE_PER_CPU_READ_MOSTLY(struct mca_banks *, mce_clear_banks);
+
 static void intpose_init(void);
 static void mcinfo_clear(struct mc_info *);
 struct mca_banks *mca_allbanks;
@@ -691,22 +695,29 @@ int mca_cap_init(void)
     return mca_allbanks ? 0:-ENOMEM;
 }
 
-static void cpu_poll_bankmask_free(unsigned int cpu)
+static void cpu_bank_free(unsigned int cpu)
 {
-    struct mca_banks *mb = per_cpu(poll_bankmask, cpu);
+    struct mca_banks *poll = per_cpu(poll_bankmask, cpu);
+    struct mca_banks *clr = per_cpu(mce_clear_banks, cpu);
 
-    mcabanks_free(mb);
+    mcabanks_free(poll);
+    mcabanks_free(clr);
 }
 
-static int cpu_poll_bankmask_alloc(unsigned int cpu)
+static int cpu_bank_alloc(unsigned int cpu)
 {
-    struct mca_banks *mb;
+    struct mca_banks *poll = mcabanks_alloc();
+    struct mca_banks *clr = mcabanks_alloc();
 
-    mb = mcabanks_alloc();
-    if ( !mb )
+    if ( !poll || !clr )
+    {
+        mcabanks_free(poll);
+        mcabanks_free(clr);
         return -ENOMEM;
+    }
 
-    per_cpu(poll_bankmask, cpu) = mb;
+    per_cpu(poll_bankmask, cpu) = poll;
+    per_cpu(mce_clear_banks, cpu) = clr;
     return 0;
 }
 
@@ -719,11 +730,11 @@ static int cpu_callback(
     switch ( action )
     {
     case CPU_UP_PREPARE:
-        rc = cpu_poll_bankmask_alloc(cpu);
+        rc = cpu_bank_alloc(cpu);
         break;
     case CPU_UP_CANCELED:
     case CPU_DEAD:
-        cpu_poll_bankmask_free(cpu);
+        cpu_bank_free(cpu);
         break;
     default:
         break;
@@ -757,6 +768,10 @@ void mcheck_init(struct cpuinfo_x86 *c, 
     if (mca_cap_init())
         return;
 
+    /* Early MCE initialisation for BSP. */
+    if ( bsp && cpu_bank_alloc(smp_processor_id()) )
+        BUG();
+
     switch (c->x86_vendor) {
     case X86_VENDOR_AMD:
         inited = amd_mcheck_init(c);
@@ -787,18 +802,14 @@ void mcheck_init(struct cpuinfo_x86 *c, 
     set_in_cr4(X86_CR4_MCE);
 
     if ( bsp )
-    {
-        /* Early MCE initialisation for BSP. */
-        if ( cpu_poll_bankmask_alloc(0) )
-            BUG();
         register_cpu_notifier(&cpu_nfb);
-    }
     set_poll_bankmask(c);
 
     return;
  out:
-    if (smp_processor_id() == 0)
+    if ( bsp )
     {
+        cpu_bank_free(smp_processor_id());
         mcabanks_free(mca_allbanks);
         mca_allbanks = NULL;
     }
diff -r 5fb601e96d0f -r 1883c1d29de9 xen/arch/x86/cpu/mcheck/mce.h
--- a/xen/arch/x86/cpu/mcheck/mce.h	Thu Oct 25 14:26:08 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/mce.h	Thu Oct 25 14:28:09 2012 +0200
@@ -122,6 +122,7 @@ struct mca_summary {
 
 DECLARE_PER_CPU(struct mca_banks *, poll_bankmask);
 DECLARE_PER_CPU(struct mca_banks *, no_cmci_banks);
+DECLARE_PER_CPU(struct mca_banks *, mce_clear_banks);
 
 extern bool_t cmci_support;
 extern bool_t is_mc_panic;
diff -r 5fb601e96d0f -r 1883c1d29de9 xen/arch/x86/cpu/mcheck/mce_intel.c
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c	Thu Oct 25 14:26:08 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c	Thu Oct 25 14:28:09 2012 +0200
@@ -21,9 +21,7 @@
 #include "vmce.h"
 #include "mcaction.h"
 
-DEFINE_PER_CPU(struct mca_banks *, mce_banks_owned);
-DEFINE_PER_CPU(struct mca_banks *, no_cmci_banks);
-DEFINE_PER_CPU(struct mca_banks *, mce_clear_banks);
+static DEFINE_PER_CPU_READ_MOSTLY(struct mca_banks *, mce_banks_owned);
 bool_t __read_mostly cmci_support = 0;
 static bool_t __read_mostly ser_support = 0;
 static bool_t __read_mostly mce_force_broadcast;
@@ -789,36 +787,28 @@ static void intel_init_mce(void)
 
 static void cpu_mcabank_free(unsigned int cpu)
 {
-    struct mca_banks *mb1, *mb2, *mb3;
+    struct mca_banks *cmci = per_cpu(no_cmci_banks, cpu);
+    struct mca_banks *owned = per_cpu(mce_banks_owned, cpu);
 
-    mb1 = per_cpu(mce_clear_banks, cpu);
-    mb2 = per_cpu(no_cmci_banks, cpu);
-    mb3 = per_cpu(mce_banks_owned, cpu);
-
-    mcabanks_free(mb1);
-    mcabanks_free(mb2);
-    mcabanks_free(mb3);
+    mcabanks_free(cmci);
+    mcabanks_free(owned);
 }
 
 static int cpu_mcabank_alloc(unsigned int cpu)
 {
-    struct mca_banks *mb1, *mb2, *mb3;
+    struct mca_banks *cmci = mcabanks_alloc();
+    struct mca_banks *owned = mcabanks_alloc();
 
-    mb1 = mcabanks_alloc();
-    mb2 = mcabanks_alloc();
-    mb3 = mcabanks_alloc();
-    if (!mb1 || !mb2 || !mb3)
+    if (!cmci || !owned)
         goto out;
 
-    per_cpu(mce_clear_banks, cpu) = mb1;
-    per_cpu(no_cmci_banks, cpu) = mb2;
-    per_cpu(mce_banks_owned, cpu) = mb3;
+    per_cpu(no_cmci_banks, cpu) = cmci;
+    per_cpu(mce_banks_owned, cpu) = owned;
 
     return 0;
 out:
-    mcabanks_free(mb1);
-    mcabanks_free(mb2);
-    mcabanks_free(mb3);
+    mcabanks_free(cmci);
+    mcabanks_free(owned);
     return -ENOMEM;
 }
 
diff -r 5fb601e96d0f -r 1883c1d29de9 xen/arch/x86/cpu/mcheck/mctelem.h
--- a/xen/arch/x86/cpu/mcheck/mctelem.h	Thu Oct 25 14:26:08 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/mctelem.h	Thu Oct 25 14:28:09 2012 +0200
@@ -23,7 +23,7 @@
  * urgent uses, intended for use from machine check exception handlers,
  * and non-urgent uses intended for use from error pollers.
  * Associated with each logout entry of whatever class is a data area
- * sized per the single argument to mctelem_init.  mcelem_init should be
+ * sized per the single argument to mctelem_init.  mctelem_init should be
  * called from MCA init code before anybody has the chance to change the
  * machine check vector with mcheck_mca_logout or to use mcheck_mca_logout.
  *
@@ -45,7 +45,7 @@
  * which will return a cookie referencing the oldest (first committed)
  * entry of the requested class.  Access the associated data using
  * mctelem_dataptr and when finished use mctelem_consume_oldest_end - in the
- * begin .. end bracket you are guaranteed that the entry canot be freed
+ * begin .. end bracket you are guaranteed that the entry can't be freed
  * even if it is ack'd elsewhere).  Once the ultimate consumer of the
  * telemetry has processed it to stable storage it should acknowledge
  * the telemetry quoting the cookie id, at which point we will free
diff -r 5fb601e96d0f -r 1883c1d29de9 xen/arch/x86/cpu/mcheck/non-fatal.c
--- a/xen/arch/x86/cpu/mcheck/non-fatal.c	Thu Oct 25 14:26:08 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/non-fatal.c	Thu Oct 25 14:28:09 2012 +0200
@@ -23,7 +23,6 @@
 #include "mce.h"
 #include "vmce.h"
 
-DEFINE_PER_CPU(struct mca_banks *, poll_bankmask);
 static struct timer mce_timer;
 
 #define MCE_PERIOD MILLISECS(8000)

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

From xen-changelog-bounces@lists.xen.org Thu Oct 25 21:55:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 25 Oct 2012 21:55:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TRVOW-0006Dw-26; Thu, 25 Oct 2012 21:55:16 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRVOU-0006DT-OU
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 21:55:15 +0000
Received: from [193.109.254.147:16746] by server-14.bemta-14.messagelabs.com
	id 7D/4E-14517-245B9805; Thu, 25 Oct 2012 21:55:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-27.messagelabs.com!1351202112!8838188!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28238 invoked from network); 25 Oct 2012 21:55:13 -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;
	25 Oct 2012 21:55:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRVOR-0002Gr-R4
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 21:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRVOR-0000ew-MB
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 21:55:11 +0000
Message-Id: <E1TRVOR-0000ew-MB@xenbits.xen.org>
Date: Thu, 25 Oct 2012 21:55:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/MCE: Implement clearbank
	callback for AMD
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1351168089 -7200
# Node ID 1883c1d29de97454df8f3b6723f0a853a09f4af6
# Parent  5fb601e96d0fcabfd19605aa7a314cbb3d321e7d
x86/MCE: Implement clearbank callback for AMD

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>

Move initialization of mce_clear_banks into common code (would not get
initialized on AMD CPUs otherwise). Mark per-CPU struct mce_bank
pointers read-mostly.

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


diff -r 5fb601e96d0f -r 1883c1d29de9 xen/arch/x86/cpu/mcheck/amd_k8.c
--- a/xen/arch/x86/cpu/mcheck/amd_k8.c	Thu Oct 25 14:26:08 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/amd_k8.c	Thu Oct 25 14:28:09 2012 +0200
@@ -72,7 +72,23 @@
 /* Machine Check Handler for AMD K8 family series */
 static void k8_machine_check(struct cpu_user_regs *regs, long error_code)
 {
-	mcheck_cmn_handler(regs, error_code, mca_allbanks, NULL);
+	mcheck_cmn_handler(regs, error_code, mca_allbanks,
+			   __get_cpu_var(mce_clear_banks));
+}
+
+static int k8_need_clearbank_scan(enum mca_source who, uint64_t status)
+{
+	if (who != MCA_MCE_SCAN)
+		return 1;
+
+	/*
+	 * For fatal error, it shouldn't be cleared so that sticky bank
+	 * have a chance to be handled after reboot by polling.
+	 */
+	if ((status & MCi_STATUS_UC) && (status & MCi_STATUS_PCC))
+		return 0;
+
+	return 1;
 }
 
 /* AMD K8 machine check */
@@ -85,6 +101,7 @@ enum mcheck_type amd_k8_mcheck_init(stru
 
 	mce_handler_init();
 	x86_mce_vector_register(k8_machine_check);
+	mce_need_clearbank_register(k8_need_clearbank_scan);
 
 	for (i = 0; i < nr_mce_banks; i++) {
 		if (quirkflag == MCEQUIRK_K8_GART && i == 4) {
diff -r 5fb601e96d0f -r 1883c1d29de9 xen/arch/x86/cpu/mcheck/mce.c
--- a/xen/arch/x86/cpu/mcheck/mce.c	Thu Oct 25 14:26:08 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/mce.c	Thu Oct 25 14:28:09 2012 +0200
@@ -35,6 +35,10 @@ bool_t is_mc_panic;
 unsigned int __read_mostly nr_mce_banks;
 unsigned int __read_mostly firstbank;
 
+DEFINE_PER_CPU_READ_MOSTLY(struct mca_banks *, poll_bankmask);
+DEFINE_PER_CPU_READ_MOSTLY(struct mca_banks *, no_cmci_banks);
+DEFINE_PER_CPU_READ_MOSTLY(struct mca_banks *, mce_clear_banks);
+
 static void intpose_init(void);
 static void mcinfo_clear(struct mc_info *);
 struct mca_banks *mca_allbanks;
@@ -691,22 +695,29 @@ int mca_cap_init(void)
     return mca_allbanks ? 0:-ENOMEM;
 }
 
-static void cpu_poll_bankmask_free(unsigned int cpu)
+static void cpu_bank_free(unsigned int cpu)
 {
-    struct mca_banks *mb = per_cpu(poll_bankmask, cpu);
+    struct mca_banks *poll = per_cpu(poll_bankmask, cpu);
+    struct mca_banks *clr = per_cpu(mce_clear_banks, cpu);
 
-    mcabanks_free(mb);
+    mcabanks_free(poll);
+    mcabanks_free(clr);
 }
 
-static int cpu_poll_bankmask_alloc(unsigned int cpu)
+static int cpu_bank_alloc(unsigned int cpu)
 {
-    struct mca_banks *mb;
+    struct mca_banks *poll = mcabanks_alloc();
+    struct mca_banks *clr = mcabanks_alloc();
 
-    mb = mcabanks_alloc();
-    if ( !mb )
+    if ( !poll || !clr )
+    {
+        mcabanks_free(poll);
+        mcabanks_free(clr);
         return -ENOMEM;
+    }
 
-    per_cpu(poll_bankmask, cpu) = mb;
+    per_cpu(poll_bankmask, cpu) = poll;
+    per_cpu(mce_clear_banks, cpu) = clr;
     return 0;
 }
 
@@ -719,11 +730,11 @@ static int cpu_callback(
     switch ( action )
     {
     case CPU_UP_PREPARE:
-        rc = cpu_poll_bankmask_alloc(cpu);
+        rc = cpu_bank_alloc(cpu);
         break;
     case CPU_UP_CANCELED:
     case CPU_DEAD:
-        cpu_poll_bankmask_free(cpu);
+        cpu_bank_free(cpu);
         break;
     default:
         break;
@@ -757,6 +768,10 @@ void mcheck_init(struct cpuinfo_x86 *c, 
     if (mca_cap_init())
         return;
 
+    /* Early MCE initialisation for BSP. */
+    if ( bsp && cpu_bank_alloc(smp_processor_id()) )
+        BUG();
+
     switch (c->x86_vendor) {
     case X86_VENDOR_AMD:
         inited = amd_mcheck_init(c);
@@ -787,18 +802,14 @@ void mcheck_init(struct cpuinfo_x86 *c, 
     set_in_cr4(X86_CR4_MCE);
 
     if ( bsp )
-    {
-        /* Early MCE initialisation for BSP. */
-        if ( cpu_poll_bankmask_alloc(0) )
-            BUG();
         register_cpu_notifier(&cpu_nfb);
-    }
     set_poll_bankmask(c);
 
     return;
  out:
-    if (smp_processor_id() == 0)
+    if ( bsp )
     {
+        cpu_bank_free(smp_processor_id());
         mcabanks_free(mca_allbanks);
         mca_allbanks = NULL;
     }
diff -r 5fb601e96d0f -r 1883c1d29de9 xen/arch/x86/cpu/mcheck/mce.h
--- a/xen/arch/x86/cpu/mcheck/mce.h	Thu Oct 25 14:26:08 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/mce.h	Thu Oct 25 14:28:09 2012 +0200
@@ -122,6 +122,7 @@ struct mca_summary {
 
 DECLARE_PER_CPU(struct mca_banks *, poll_bankmask);
 DECLARE_PER_CPU(struct mca_banks *, no_cmci_banks);
+DECLARE_PER_CPU(struct mca_banks *, mce_clear_banks);
 
 extern bool_t cmci_support;
 extern bool_t is_mc_panic;
diff -r 5fb601e96d0f -r 1883c1d29de9 xen/arch/x86/cpu/mcheck/mce_intel.c
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c	Thu Oct 25 14:26:08 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c	Thu Oct 25 14:28:09 2012 +0200
@@ -21,9 +21,7 @@
 #include "vmce.h"
 #include "mcaction.h"
 
-DEFINE_PER_CPU(struct mca_banks *, mce_banks_owned);
-DEFINE_PER_CPU(struct mca_banks *, no_cmci_banks);
-DEFINE_PER_CPU(struct mca_banks *, mce_clear_banks);
+static DEFINE_PER_CPU_READ_MOSTLY(struct mca_banks *, mce_banks_owned);
 bool_t __read_mostly cmci_support = 0;
 static bool_t __read_mostly ser_support = 0;
 static bool_t __read_mostly mce_force_broadcast;
@@ -789,36 +787,28 @@ static void intel_init_mce(void)
 
 static void cpu_mcabank_free(unsigned int cpu)
 {
-    struct mca_banks *mb1, *mb2, *mb3;
+    struct mca_banks *cmci = per_cpu(no_cmci_banks, cpu);
+    struct mca_banks *owned = per_cpu(mce_banks_owned, cpu);
 
-    mb1 = per_cpu(mce_clear_banks, cpu);
-    mb2 = per_cpu(no_cmci_banks, cpu);
-    mb3 = per_cpu(mce_banks_owned, cpu);
-
-    mcabanks_free(mb1);
-    mcabanks_free(mb2);
-    mcabanks_free(mb3);
+    mcabanks_free(cmci);
+    mcabanks_free(owned);
 }
 
 static int cpu_mcabank_alloc(unsigned int cpu)
 {
-    struct mca_banks *mb1, *mb2, *mb3;
+    struct mca_banks *cmci = mcabanks_alloc();
+    struct mca_banks *owned = mcabanks_alloc();
 
-    mb1 = mcabanks_alloc();
-    mb2 = mcabanks_alloc();
-    mb3 = mcabanks_alloc();
-    if (!mb1 || !mb2 || !mb3)
+    if (!cmci || !owned)
         goto out;
 
-    per_cpu(mce_clear_banks, cpu) = mb1;
-    per_cpu(no_cmci_banks, cpu) = mb2;
-    per_cpu(mce_banks_owned, cpu) = mb3;
+    per_cpu(no_cmci_banks, cpu) = cmci;
+    per_cpu(mce_banks_owned, cpu) = owned;
 
     return 0;
 out:
-    mcabanks_free(mb1);
-    mcabanks_free(mb2);
-    mcabanks_free(mb3);
+    mcabanks_free(cmci);
+    mcabanks_free(owned);
     return -ENOMEM;
 }
 
diff -r 5fb601e96d0f -r 1883c1d29de9 xen/arch/x86/cpu/mcheck/mctelem.h
--- a/xen/arch/x86/cpu/mcheck/mctelem.h	Thu Oct 25 14:26:08 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/mctelem.h	Thu Oct 25 14:28:09 2012 +0200
@@ -23,7 +23,7 @@
  * urgent uses, intended for use from machine check exception handlers,
  * and non-urgent uses intended for use from error pollers.
  * Associated with each logout entry of whatever class is a data area
- * sized per the single argument to mctelem_init.  mcelem_init should be
+ * sized per the single argument to mctelem_init.  mctelem_init should be
  * called from MCA init code before anybody has the chance to change the
  * machine check vector with mcheck_mca_logout or to use mcheck_mca_logout.
  *
@@ -45,7 +45,7 @@
  * which will return a cookie referencing the oldest (first committed)
  * entry of the requested class.  Access the associated data using
  * mctelem_dataptr and when finished use mctelem_consume_oldest_end - in the
- * begin .. end bracket you are guaranteed that the entry canot be freed
+ * begin .. end bracket you are guaranteed that the entry can't be freed
  * even if it is ack'd elsewhere).  Once the ultimate consumer of the
  * telemetry has processed it to stable storage it should acknowledge
  * the telemetry quoting the cookie id, at which point we will free
diff -r 5fb601e96d0f -r 1883c1d29de9 xen/arch/x86/cpu/mcheck/non-fatal.c
--- a/xen/arch/x86/cpu/mcheck/non-fatal.c	Thu Oct 25 14:26:08 2012 +0200
+++ b/xen/arch/x86/cpu/mcheck/non-fatal.c	Thu Oct 25 14:28:09 2012 +0200
@@ -23,7 +23,6 @@
 #include "mce.h"
 #include "vmce.h"
 
-DEFINE_PER_CPU(struct mca_banks *, poll_bankmask);
 static struct timer mce_timer;
 
 #define MCE_PERIOD MILLISECS(8000)

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

From xen-changelog-bounces@lists.xen.org Thu Oct 25 21:55:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 25 Oct 2012 21:55:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TRVOU-0006DU-QY; Thu, 25 Oct 2012 21:55:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRVOT-0006DG-W5
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 21:55:14 +0000
Received: from [85.158.137.99:65091] by server-8.bemta-3.messagelabs.com id
	7D/01-10525-145B9805; Thu, 25 Oct 2012 21:55:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-217.messagelabs.com!1351202110!22971341!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14848 invoked from network); 25 Oct 2012 21:55:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2012 21:55:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRVOQ-0002Gi-8D
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 21:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRVOP-0000e7-Na
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 21:55:09 +0000
Message-Id: <E1TRVOP-0000e7-Na@xenbits.xen.org>
Date: Thu, 25 Oct 2012 21:55:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: avoid shadowing reboot(2)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1351165885 -3600
# Node ID 580aa3946f87eb56690671bf1aa0022228f59c8c
# Parent  22e08c9ac770db07c3c3e7c844aa7153050939f3
xl: avoid shadowing reboot(2)

On NetBSD <unistd.h> mistakenly exposes reboot(2).  Work around this.

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


diff -r 22e08c9ac770 -r 580aa3946f87 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Wed Oct 24 17:51:48 2012 +0200
+++ b/tools/libxl/xl_cmdimpl.c	Thu Oct 25 12:51:25 2012 +0100
@@ -3721,11 +3721,11 @@ int main_destroy(int argc, char **argv)
     return 0;
 }
 
-static int main_shutdown_or_reboot(int reboot, int argc, char **argv)
+static int main_shutdown_or_reboot(int do_reboot, int argc, char **argv)
 {
     void (*fn)(uint32_t domid,
                libxl_evgen_domain_death **, libxl_ev_user, int) =
-        reboot ? &reboot_domain : &shutdown_domain;
+        do_reboot ? &reboot_domain : &shutdown_domain;
     int opt, i, nb_domain;
     int wait_for_it = 0, all =0;
     int fallback_trigger = 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 25 21:55:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 25 Oct 2012 21:55:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TRVOU-0006DU-QY; Thu, 25 Oct 2012 21:55:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRVOT-0006DG-W5
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 21:55:14 +0000
Received: from [85.158.137.99:65091] by server-8.bemta-3.messagelabs.com id
	7D/01-10525-145B9805; Thu, 25 Oct 2012 21:55:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-217.messagelabs.com!1351202110!22971341!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14848 invoked from network); 25 Oct 2012 21:55:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2012 21:55:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRVOQ-0002Gi-8D
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 21:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRVOP-0000e7-Na
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 21:55:09 +0000
Message-Id: <E1TRVOP-0000e7-Na@xenbits.xen.org>
Date: Thu, 25 Oct 2012 21:55:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: avoid shadowing reboot(2)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1351165885 -3600
# Node ID 580aa3946f87eb56690671bf1aa0022228f59c8c
# Parent  22e08c9ac770db07c3c3e7c844aa7153050939f3
xl: avoid shadowing reboot(2)

On NetBSD <unistd.h> mistakenly exposes reboot(2).  Work around this.

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


diff -r 22e08c9ac770 -r 580aa3946f87 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Wed Oct 24 17:51:48 2012 +0200
+++ b/tools/libxl/xl_cmdimpl.c	Thu Oct 25 12:51:25 2012 +0100
@@ -3721,11 +3721,11 @@ int main_destroy(int argc, char **argv)
     return 0;
 }
 
-static int main_shutdown_or_reboot(int reboot, int argc, char **argv)
+static int main_shutdown_or_reboot(int do_reboot, int argc, char **argv)
 {
     void (*fn)(uint32_t domid,
                libxl_evgen_domain_death **, libxl_ev_user, int) =
-        reboot ? &reboot_domain : &shutdown_domain;
+        do_reboot ? &reboot_domain : &shutdown_domain;
     int opt, i, nb_domain;
     int wait_for_it = 0, all =0;
     int fallback_trigger = 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 25 21:55:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 25 Oct 2012 21:55:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TRVOU-0006DZ-Sv; Thu, 25 Oct 2012 21:55:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRVOU-0006DH-0R
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 21:55:14 +0000
Received: from [85.158.139.83:11067] by server-14.bemta-5.messagelabs.com id
	A3/56-21768-145B9805; Thu, 25 Oct 2012 21:55:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1351202111!27402395!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2909 invoked from network); 25 Oct 2012 21:55:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2012 21:55:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRVOQ-0002Gl-OZ
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 21:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRVOQ-0000eN-GD
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 21:55:10 +0000
Message-Id: <E1TRVOQ-0000eN-GD@xenbits.xen.org>
Date: Thu, 25 Oct 2012 21:55:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] compiler.h adjustments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1351167895 -7200
# Node ID a89f1299b134bbcd969b6e7b193a6b2b17dd10cd
# Parent  580aa3946f87eb56690671bf1aa0022228f59c8c
compiler.h adjustments

- replace __attribute_used__ with just __used
- add __maybe_unused and explain the difference between the two
- remove gcc 3.x specifics (as we don't support building with it
  anymore; really for quite some time we didn't even support building
  with the checked for minor versions)
- remove left over __setup() from init.h (rather than adjusting it)

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


diff -r 580aa3946f87 -r a89f1299b134 xen/arch/arm/setup.c
--- a/xen/arch/arm/setup.c	Thu Oct 25 12:51:25 2012 +0100
+++ b/xen/arch/arm/setup.c	Thu Oct 25 14:24:55 2012 +0200
@@ -41,7 +41,7 @@
 #include <asm/early_printk.h>
 #include "gic.h"
 
-static __attribute_used__ void init_done(void)
+static __used void init_done(void)
 {
     free_init_memory();
     startup_cpu_idle_loop();
diff -r 580aa3946f87 -r a89f1299b134 xen/include/xen/compiler.h
--- a/xen/include/xen/compiler.h	Thu Oct 25 12:51:25 2012 +0100
+++ b/xen/include/xen/compiler.h	Thu Oct 25 14:24:55 2012 +0200
@@ -1,7 +1,7 @@
 #ifndef __LINUX_COMPILER_H
 #define __LINUX_COMPILER_H
 
-#if !defined(__GNUC__) || (__GNUC__ < 3)
+#if !defined(__GNUC__) || (__GNUC__ < 4)
 #error Sorry, your compiler is too old/not recognized.
 #endif
 
@@ -17,11 +17,11 @@
 #ifdef __clang__
 /* Clang can replace some vars with new automatic ones that go in .data;
  * mark all explicit-segment vars 'used' to prevent that. */
-#define __section(s)      __attribute_used__ __attribute__((__section__(s)))
+#define __section(s)      __used __attribute__((__section__(s)))
 #else
 #define __section(s)      __attribute__((__section__(s)))
 #endif
-#define __used_section(s) __attribute_used__ __attribute__((__section__(s)))
+#define __used_section(s) __used __attribute__((__section__(s)))
 #define __text_section(s) __attribute__((__section__(s)))
 
 #ifdef INIT_SECTIONS_ONLY
@@ -36,23 +36,23 @@
 #define __attribute_pure__  __attribute__((pure))
 #define __attribute_const__ __attribute__((__const__))
 
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
-#define __attribute_used__ __attribute__((__used__))
-#else
-#define __attribute_used__ __attribute__((__unused__))
-#endif
+/*
+ * The difference between the following two attributes is that __used is
+ * intended to be used in cases where a reference to an identifier may be
+ * invisible to the compiler (e.g. an inline assembly operand not listed
+ * in the asm()'s operands), preventing the compiler from eliminating the
+ * variable or function.
+ * __maybe_unused otoh is to be used to merely prevent warnings (e.g. when
+ * an identifier is used only inside a preprocessor conditional, yet putting
+ * its declaration/definition inside another conditional would harm code
+ * readability).
+ */
+#define __used         __attribute__((__used__))
+#define __maybe_unused __attribute__((__unused__))
 
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
 #define __must_check __attribute__((warn_unused_result))
-#else
-#define __must_check
-#endif
 
-#if __GNUC__ > 3
 #define offsetof(a,b) __builtin_offsetof(a,b)
-#else
-#define offsetof(a,b) ((unsigned long)&(((a *)0)->b))
-#endif
 
 /* &a[0] degrades to a pointer: a different type from an array */
 #define __must_be_array(a) \
diff -r 580aa3946f87 -r a89f1299b134 xen/include/xen/init.h
--- a/xen/include/xen/init.h	Thu Oct 25 12:51:25 2012 +0100
+++ b/xen/include/xen/init.h	Thu Oct 25 14:24:55 2012 +0200
@@ -114,9 +114,6 @@ extern struct kernel_param __setup_start
     __kparam __setup_##_var = \
         { __setup_str_##_var, OPT_STR, &_var, sizeof(_var) }
 
-/* Make sure obsolete cmdline params don't break the build. */
-#define __setup(_name, _fn) static void * __attribute_used__ _dummy_##_fn = _fn
-    
 #endif /* __ASSEMBLY__ */
 
 #ifdef CONFIG_HOTPLUG

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

From xen-changelog-bounces@lists.xen.org Thu Oct 25 21:55:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 25 Oct 2012 21:55:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TRVOU-0006DZ-Sv; Thu, 25 Oct 2012 21:55:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRVOU-0006DH-0R
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 21:55:14 +0000
Received: from [85.158.139.83:11067] by server-14.bemta-5.messagelabs.com id
	A3/56-21768-145B9805; Thu, 25 Oct 2012 21:55:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1351202111!27402395!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2909 invoked from network); 25 Oct 2012 21:55:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2012 21:55:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRVOQ-0002Gl-OZ
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 21:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRVOQ-0000eN-GD
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 21:55:10 +0000
Message-Id: <E1TRVOQ-0000eN-GD@xenbits.xen.org>
Date: Thu, 25 Oct 2012 21:55:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] compiler.h adjustments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1351167895 -7200
# Node ID a89f1299b134bbcd969b6e7b193a6b2b17dd10cd
# Parent  580aa3946f87eb56690671bf1aa0022228f59c8c
compiler.h adjustments

- replace __attribute_used__ with just __used
- add __maybe_unused and explain the difference between the two
- remove gcc 3.x specifics (as we don't support building with it
  anymore; really for quite some time we didn't even support building
  with the checked for minor versions)
- remove left over __setup() from init.h (rather than adjusting it)

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


diff -r 580aa3946f87 -r a89f1299b134 xen/arch/arm/setup.c
--- a/xen/arch/arm/setup.c	Thu Oct 25 12:51:25 2012 +0100
+++ b/xen/arch/arm/setup.c	Thu Oct 25 14:24:55 2012 +0200
@@ -41,7 +41,7 @@
 #include <asm/early_printk.h>
 #include "gic.h"
 
-static __attribute_used__ void init_done(void)
+static __used void init_done(void)
 {
     free_init_memory();
     startup_cpu_idle_loop();
diff -r 580aa3946f87 -r a89f1299b134 xen/include/xen/compiler.h
--- a/xen/include/xen/compiler.h	Thu Oct 25 12:51:25 2012 +0100
+++ b/xen/include/xen/compiler.h	Thu Oct 25 14:24:55 2012 +0200
@@ -1,7 +1,7 @@
 #ifndef __LINUX_COMPILER_H
 #define __LINUX_COMPILER_H
 
-#if !defined(__GNUC__) || (__GNUC__ < 3)
+#if !defined(__GNUC__) || (__GNUC__ < 4)
 #error Sorry, your compiler is too old/not recognized.
 #endif
 
@@ -17,11 +17,11 @@
 #ifdef __clang__
 /* Clang can replace some vars with new automatic ones that go in .data;
  * mark all explicit-segment vars 'used' to prevent that. */
-#define __section(s)      __attribute_used__ __attribute__((__section__(s)))
+#define __section(s)      __used __attribute__((__section__(s)))
 #else
 #define __section(s)      __attribute__((__section__(s)))
 #endif
-#define __used_section(s) __attribute_used__ __attribute__((__section__(s)))
+#define __used_section(s) __used __attribute__((__section__(s)))
 #define __text_section(s) __attribute__((__section__(s)))
 
 #ifdef INIT_SECTIONS_ONLY
@@ -36,23 +36,23 @@
 #define __attribute_pure__  __attribute__((pure))
 #define __attribute_const__ __attribute__((__const__))
 
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
-#define __attribute_used__ __attribute__((__used__))
-#else
-#define __attribute_used__ __attribute__((__unused__))
-#endif
+/*
+ * The difference between the following two attributes is that __used is
+ * intended to be used in cases where a reference to an identifier may be
+ * invisible to the compiler (e.g. an inline assembly operand not listed
+ * in the asm()'s operands), preventing the compiler from eliminating the
+ * variable or function.
+ * __maybe_unused otoh is to be used to merely prevent warnings (e.g. when
+ * an identifier is used only inside a preprocessor conditional, yet putting
+ * its declaration/definition inside another conditional would harm code
+ * readability).
+ */
+#define __used         __attribute__((__used__))
+#define __maybe_unused __attribute__((__unused__))
 
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
 #define __must_check __attribute__((warn_unused_result))
-#else
-#define __must_check
-#endif
 
-#if __GNUC__ > 3
 #define offsetof(a,b) __builtin_offsetof(a,b)
-#else
-#define offsetof(a,b) ((unsigned long)&(((a *)0)->b))
-#endif
 
 /* &a[0] degrades to a pointer: a different type from an array */
 #define __must_be_array(a) \
diff -r 580aa3946f87 -r a89f1299b134 xen/include/xen/init.h
--- a/xen/include/xen/init.h	Thu Oct 25 12:51:25 2012 +0100
+++ b/xen/include/xen/init.h	Thu Oct 25 14:24:55 2012 +0200
@@ -114,9 +114,6 @@ extern struct kernel_param __setup_start
     __kparam __setup_##_var = \
         { __setup_str_##_var, OPT_STR, &_var, sizeof(_var) }
 
-/* Make sure obsolete cmdline params don't break the build. */
-#define __setup(_name, _fn) static void * __attribute_used__ _dummy_##_fn = _fn
-    
 #endif /* __ASSEMBLY__ */
 
 #ifdef CONFIG_HOTPLUG

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

From xen-changelog-bounces@lists.xen.org Thu Oct 25 21:55:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 25 Oct 2012 21:55:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TRVOV-0006Dr-Vm; Thu, 25 Oct 2012 21:55:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRVOU-0006DS-Ro
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 21:55:15 +0000
Received: from [85.158.143.99:33695] by server-3.bemta-4.messagelabs.com id
	36/31-24279-145B9805; Thu, 25 Oct 2012 21:55:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1351202111!21021666!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18892 invoked from network); 25 Oct 2012 21:55:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2012 21:55:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRVOR-0002Go-DO
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 21:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRVOR-0000ec-2f
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 21:55:11 +0000
Message-Id: <E1TRVOR-0000ec-2f@xenbits.xen.org>
Date: Thu, 25 Oct 2012 21:55:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/HPET: cache MSI message last
	written
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1351167968 -7200
# Node ID 5fb601e96d0fcabfd19605aa7a314cbb3d321e7d
# Parent  a89f1299b134bbcd969b6e7b193a6b2b17dd10cd
x86/HPET: cache MSI message last written

Rather than spending measurable amounts of time reading back the most
recently written message, cache it in space previously unused, and thus
accelerate the CPU's entering of the intended C-state.

hpet_msi_read() ends up being unused after this change, but rather than
removing the function, it's being marked "unused" in order - that way
it can easily get used again should a new need for it arise.

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


diff -r a89f1299b134 -r 5fb601e96d0f xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c	Thu Oct 25 14:24:55 2012 +0200
+++ b/xen/arch/x86/hpet.c	Thu Oct 25 14:26:08 2012 +0200
@@ -253,17 +253,19 @@ static void hpet_msi_mask(struct irq_des
 
 static void hpet_msi_write(struct hpet_event_channel *ch, struct msi_msg *msg)
 {
+    ch->msi.msg = *msg;
     if ( iommu_intremap )
         iommu_update_ire_from_msi(&ch->msi, msg);
     hpet_write32(msg->data, HPET_Tn_ROUTE(ch->idx));
     hpet_write32(msg->address_lo, HPET_Tn_ROUTE(ch->idx) + 4);
 }
 
-static void hpet_msi_read(struct hpet_event_channel *ch, struct msi_msg *msg)
+static void __maybe_unused
+hpet_msi_read(struct hpet_event_channel *ch, struct msi_msg *msg)
 {
     msg->data = hpet_read32(HPET_Tn_ROUTE(ch->idx));
     msg->address_lo = hpet_read32(HPET_Tn_ROUTE(ch->idx) + 4);
-    msg->address_hi = 0;
+    msg->address_hi = MSI_ADDR_BASE_HI;
     if ( iommu_intremap )
         iommu_read_msi_from_ire(&ch->msi, msg);
 }
@@ -285,20 +287,19 @@ static void hpet_msi_ack(struct irq_desc
 
 static void hpet_msi_set_affinity(struct irq_desc *desc, const cpumask_t *mask)
 {
-    struct msi_msg msg;
-    unsigned int dest;
+    struct hpet_event_channel *ch = desc->action->dev_id;
+    struct msi_msg msg = ch->msi.msg;
 
-    dest = set_desc_affinity(desc, mask);
-    if (dest == BAD_APICID)
+    msg.dest32 = set_desc_affinity(desc, mask);
+    if ( msg.dest32 == BAD_APICID )
         return;
 
-    hpet_msi_read(desc->action->dev_id, &msg);
     msg.data &= ~MSI_DATA_VECTOR_MASK;
     msg.data |= MSI_DATA_VECTOR(desc->arch.vector);
     msg.address_lo &= ~MSI_ADDR_DEST_ID_MASK;
-    msg.address_lo |= MSI_ADDR_DEST_ID(dest);
-    msg.dest32 = dest;
-    hpet_msi_write(desc->action->dev_id, &msg);
+    msg.address_lo |= MSI_ADDR_DEST_ID(msg.dest32);
+    if ( msg.data != ch->msi.msg.data || msg.dest32 != ch->msi.msg.dest32 )
+        hpet_msi_write(ch, &msg);
 }
 
 /*

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

From xen-changelog-bounces@lists.xen.org Thu Oct 25 21:55:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 25 Oct 2012 21:55:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TRVOV-0006Dr-Vm; Thu, 25 Oct 2012 21:55:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRVOU-0006DS-Ro
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 21:55:15 +0000
Received: from [85.158.143.99:33695] by server-3.bemta-4.messagelabs.com id
	36/31-24279-145B9805; Thu, 25 Oct 2012 21:55:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1351202111!21021666!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18892 invoked from network); 25 Oct 2012 21:55:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2012 21:55:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRVOR-0002Go-DO
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 21:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRVOR-0000ec-2f
	for xen-changelog@lists.xensource.com; Thu, 25 Oct 2012 21:55:11 +0000
Message-Id: <E1TRVOR-0000ec-2f@xenbits.xen.org>
Date: Thu, 25 Oct 2012 21:55:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/HPET: cache MSI message last
	written
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1351167968 -7200
# Node ID 5fb601e96d0fcabfd19605aa7a314cbb3d321e7d
# Parent  a89f1299b134bbcd969b6e7b193a6b2b17dd10cd
x86/HPET: cache MSI message last written

Rather than spending measurable amounts of time reading back the most
recently written message, cache it in space previously unused, and thus
accelerate the CPU's entering of the intended C-state.

hpet_msi_read() ends up being unused after this change, but rather than
removing the function, it's being marked "unused" in order - that way
it can easily get used again should a new need for it arise.

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


diff -r a89f1299b134 -r 5fb601e96d0f xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c	Thu Oct 25 14:24:55 2012 +0200
+++ b/xen/arch/x86/hpet.c	Thu Oct 25 14:26:08 2012 +0200
@@ -253,17 +253,19 @@ static void hpet_msi_mask(struct irq_des
 
 static void hpet_msi_write(struct hpet_event_channel *ch, struct msi_msg *msg)
 {
+    ch->msi.msg = *msg;
     if ( iommu_intremap )
         iommu_update_ire_from_msi(&ch->msi, msg);
     hpet_write32(msg->data, HPET_Tn_ROUTE(ch->idx));
     hpet_write32(msg->address_lo, HPET_Tn_ROUTE(ch->idx) + 4);
 }
 
-static void hpet_msi_read(struct hpet_event_channel *ch, struct msi_msg *msg)
+static void __maybe_unused
+hpet_msi_read(struct hpet_event_channel *ch, struct msi_msg *msg)
 {
     msg->data = hpet_read32(HPET_Tn_ROUTE(ch->idx));
     msg->address_lo = hpet_read32(HPET_Tn_ROUTE(ch->idx) + 4);
-    msg->address_hi = 0;
+    msg->address_hi = MSI_ADDR_BASE_HI;
     if ( iommu_intremap )
         iommu_read_msi_from_ire(&ch->msi, msg);
 }
@@ -285,20 +287,19 @@ static void hpet_msi_ack(struct irq_desc
 
 static void hpet_msi_set_affinity(struct irq_desc *desc, const cpumask_t *mask)
 {
-    struct msi_msg msg;
-    unsigned int dest;
+    struct hpet_event_channel *ch = desc->action->dev_id;
+    struct msi_msg msg = ch->msi.msg;
 
-    dest = set_desc_affinity(desc, mask);
-    if (dest == BAD_APICID)
+    msg.dest32 = set_desc_affinity(desc, mask);
+    if ( msg.dest32 == BAD_APICID )
         return;
 
-    hpet_msi_read(desc->action->dev_id, &msg);
     msg.data &= ~MSI_DATA_VECTOR_MASK;
     msg.data |= MSI_DATA_VECTOR(desc->arch.vector);
     msg.address_lo &= ~MSI_ADDR_DEST_ID_MASK;
-    msg.address_lo |= MSI_ADDR_DEST_ID(dest);
-    msg.dest32 = dest;
-    hpet_msi_write(desc->action->dev_id, &msg);
+    msg.address_lo |= MSI_ADDR_DEST_ID(msg.dest32);
+    if ( msg.data != ch->msi.msg.data || msg.dest32 != ch->msi.msg.dest32 )
+        hpet_msi_write(ch, &msg);
 }
 
 /*

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

From xen-changelog-bounces@lists.xen.org Fri Oct 26 01:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 26 Oct 2012 01: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 1TRZ8o-0003lg-Ev; Fri, 26 Oct 2012 01:55:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRZ8n-0003lU-Jt
	for xen-changelog@lists.xensource.com; Fri, 26 Oct 2012 01:55:17 +0000
Received: from [85.158.139.83:60498] by server-15.bemta-5.messagelabs.com id
	6C/45-26920-48DE9805; Fri, 26 Oct 2012 01:55:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1351216514!33710999!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29573 invoked from network); 26 Oct 2012 01:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Oct 2012 01:55:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRZ8k-0005NZ-C3
	for xen-changelog@lists.xensource.com; Fri, 26 Oct 2012 01:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRZ8j-0007FV-PK
	for xen-changelog@lists.xensource.com; Fri, 26 Oct 2012 01:55:13 +0000
Message-Id: <E1TRZ8j-0007FV-PK@xenbits.xen.org>
Date: Fri, 26 Oct 2012 01:55:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: Fix accidently waiting for
	domains to shutdown without --wait option
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Sander Eikelenboom <linux@eikelenboom>
# Date 1351177494 -3600
# Node ID b6a870378ec2c31f4bdebb8170ccc9c39763e152
# Parent  1883c1d29de97454df8f3b6723f0a853a09f4af6
xl: Fix accidently waiting for domains to shutdown without --wait option

Introduced by changeset 26091: "xl: Add --wait and --all to xl reboot."

Signed-off-by: Sander Eikelenboom <linux@eikelenboom>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 1883c1d29de9 -r b6a870378ec2 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Oct 25 14:28:09 2012 +0200
+++ b/tools/libxl/xl_cmdimpl.c	Thu Oct 25 16:04:54 2012 +0100
@@ -3774,7 +3774,9 @@ static int main_shutdown_or_reboot(int d
                fallback_trigger);
         }
 
-        wait_for_domain_deaths(deathws, nb_domain - 1 /* not dom 0 */);
+        if (wait_for_it)
+            wait_for_domain_deaths(deathws, nb_domain - 1 /* not dom 0 */);
+
         libxl_dominfo_list_free(dominfo, nb_domain);
     } else {
         libxl_evgen_domain_death *deathw = NULL;

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

From xen-changelog-bounces@lists.xen.org Fri Oct 26 01:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 26 Oct 2012 01: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 1TRZ8o-0003lg-Ev; Fri, 26 Oct 2012 01:55:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRZ8n-0003lU-Jt
	for xen-changelog@lists.xensource.com; Fri, 26 Oct 2012 01:55:17 +0000
Received: from [85.158.139.83:60498] by server-15.bemta-5.messagelabs.com id
	6C/45-26920-48DE9805; Fri, 26 Oct 2012 01:55:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1351216514!33710999!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29573 invoked from network); 26 Oct 2012 01:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Oct 2012 01:55:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRZ8k-0005NZ-C3
	for xen-changelog@lists.xensource.com; Fri, 26 Oct 2012 01:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRZ8j-0007FV-PK
	for xen-changelog@lists.xensource.com; Fri, 26 Oct 2012 01:55:13 +0000
Message-Id: <E1TRZ8j-0007FV-PK@xenbits.xen.org>
Date: Fri, 26 Oct 2012 01:55:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: Fix accidently waiting for
	domains to shutdown without --wait option
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Sander Eikelenboom <linux@eikelenboom>
# Date 1351177494 -3600
# Node ID b6a870378ec2c31f4bdebb8170ccc9c39763e152
# Parent  1883c1d29de97454df8f3b6723f0a853a09f4af6
xl: Fix accidently waiting for domains to shutdown without --wait option

Introduced by changeset 26091: "xl: Add --wait and --all to xl reboot."

Signed-off-by: Sander Eikelenboom <linux@eikelenboom>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 1883c1d29de9 -r b6a870378ec2 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Oct 25 14:28:09 2012 +0200
+++ b/tools/libxl/xl_cmdimpl.c	Thu Oct 25 16:04:54 2012 +0100
@@ -3774,7 +3774,9 @@ static int main_shutdown_or_reboot(int d
                fallback_trigger);
         }
 
-        wait_for_domain_deaths(deathws, nb_domain - 1 /* not dom 0 */);
+        if (wait_for_it)
+            wait_for_domain_deaths(deathws, nb_domain - 1 /* not dom 0 */);
+
         libxl_dominfo_list_free(dominfo, nb_domain);
     } else {
         libxl_evgen_domain_death *deathw = NULL;

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

From xen-changelog-bounces@lists.xen.org Fri Oct 26 01:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 26 Oct 2012 01: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 1TRZ8o-0003ll-Ht; Fri, 26 Oct 2012 01:55:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRZ8n-0003lV-QN
	for xen-changelog@lists.xensource.com; Fri, 26 Oct 2012 01:55:17 +0000
Received: from [85.158.143.35:42994] by server-2.bemta-4.messagelabs.com id
	08/04-22268-58DE9805; Fri, 26 Oct 2012 01:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-21.messagelabs.com!1351216515!4832249!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10699 invoked from network); 26 Oct 2012 01:55:16 -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;
	26 Oct 2012 01:55:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRZ8l-0005Nc-4i
	for xen-changelog@lists.xensource.com; Fri, 26 Oct 2012 01:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRZ8k-0007Fk-Jh
	for xen-changelog@lists.xensource.com; Fri, 26 Oct 2012 01:55:14 +0000
Message-Id: <E1TRZ8k-0007Fk-Jh@xenbits.xen.org>
Date: Fri, 26 Oct 2012 01:55:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hvmloader: Reserve FE700000-FE800000
	in physical memory map for guest 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

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1351148836 25200
# Node ID 79185dcdf55806f4d559c9cc1ef6a7953a21c30a
# Parent  b6a870378ec2c31f4bdebb8170ccc9c39763e152
hvmloader: Reserve FE700000-FE800000 in physical memory map for guest use.

Xen platform promises never to use this physical address region, and
will always mark it as reserved in the physical memory map presented
to the OS (preventing its use by generic OS services such as BAR
remapping).

Linux will use this region for mapping the shared-info page.

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


diff -r b6a870378ec2 -r 79185dcdf558 tools/firmware/hvmloader/config.h
--- a/tools/firmware/hvmloader/config.h	Thu Oct 25 16:04:54 2012 +0100
+++ b/tools/firmware/hvmloader/config.h	Thu Oct 25 00:07:16 2012 -0700
@@ -67,7 +67,17 @@ extern unsigned long pci_mem_start, pci_
 #define RESERVED_MEMBASE              0xFC000000
 /* NB. ACPI_INFO_PHYSICAL_ADDRESS *MUST* match definition in acpi/dsdt.asl! */
 #define ACPI_INFO_PHYSICAL_ADDRESS    0xFC000000
-#define RESERVED_MEMORY_DYNAMIC       0xFC001000
+#define RESERVED_MEMORY_DYNAMIC_START 0xFC001000
+#define RESERVED_MEMORY_DYNAMIC_END   0xFE000000
+/*
+ * GUEST_RESERVED: Physical address space reserved for guest use.
+ * This is not dynamically advertised to guests, so this range must *never*
+ * be used for any purpose by us, in future. It must always be marked as
+ * reserved in the memory map (e.g., E820_RESERVED) so that mechanisms such
+ * as PCI BAR remapping do not allocate from this region.
+ */
+#define GUEST_RESERVED_START          0xFE700000
+#define GUEST_RESERVED_END            0xFE800000
 
 extern unsigned long scratch_start;
 
diff -r b6a870378ec2 -r 79185dcdf558 tools/firmware/hvmloader/util.c
--- a/tools/firmware/hvmloader/util.c	Thu Oct 25 16:04:54 2012 +0100
+++ b/tools/firmware/hvmloader/util.c	Thu Oct 25 00:07:16 2012 -0700
@@ -416,13 +416,14 @@ void mem_hole_populate_ram(xen_pfn_t mfn
     }
 }
 
-static uint32_t reserve = RESERVED_MEMORY_DYNAMIC - 1;
+static uint32_t alloc_up = RESERVED_MEMORY_DYNAMIC_START - 1;
+static uint32_t alloc_down = RESERVED_MEMORY_DYNAMIC_END;
 
 xen_pfn_t mem_hole_alloc(uint32_t nr_mfns)
 {
-    hvm_info->reserved_mem_pgstart -= nr_mfns;
-    BUG_ON(hvm_info->reserved_mem_pgstart <= (reserve >> PAGE_SHIFT));
-    return hvm_info->reserved_mem_pgstart;
+    alloc_down -= nr_mfns << PAGE_SHIFT;
+    BUG_ON(alloc_up >= alloc_down);
+    return alloc_down >> PAGE_SHIFT;
 }
 
 void *mem_alloc(uint32_t size, uint32_t align)
@@ -433,18 +434,18 @@ void *mem_alloc(uint32_t size, uint32_t 
     if ( align < 16 )
         align = 16;
 
-    s = (reserve + align) & ~(align - 1);
+    s = (alloc_up + align) & ~(align - 1);
     e = s + size - 1;
 
-    BUG_ON((e < s) || (e >> PAGE_SHIFT) >= hvm_info->reserved_mem_pgstart);
+    BUG_ON((e < s) || (e >= alloc_down));
 
-    while ( (reserve >> PAGE_SHIFT) != (e >> PAGE_SHIFT) )
+    while ( (alloc_up >> PAGE_SHIFT) != (e >> PAGE_SHIFT) )
     {
-        reserve += PAGE_SIZE;
-        mem_hole_populate_ram(reserve >> PAGE_SHIFT, 1);
+        alloc_up += PAGE_SIZE;
+        mem_hole_populate_ram(alloc_up >> PAGE_SHIFT, 1);
     }
 
-    reserve = e;
+    alloc_up = e;
 
     return (void *)(unsigned long)s;
 }

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

From xen-changelog-bounces@lists.xen.org Fri Oct 26 01:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 26 Oct 2012 01: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 1TRZ8o-0003ll-Ht; Fri, 26 Oct 2012 01:55:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRZ8n-0003lV-QN
	for xen-changelog@lists.xensource.com; Fri, 26 Oct 2012 01:55:17 +0000
Received: from [85.158.143.35:42994] by server-2.bemta-4.messagelabs.com id
	08/04-22268-58DE9805; Fri, 26 Oct 2012 01:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-21.messagelabs.com!1351216515!4832249!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10699 invoked from network); 26 Oct 2012 01:55:16 -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;
	26 Oct 2012 01:55:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRZ8l-0005Nc-4i
	for xen-changelog@lists.xensource.com; Fri, 26 Oct 2012 01:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRZ8k-0007Fk-Jh
	for xen-changelog@lists.xensource.com; Fri, 26 Oct 2012 01:55:14 +0000
Message-Id: <E1TRZ8k-0007Fk-Jh@xenbits.xen.org>
Date: Fri, 26 Oct 2012 01:55:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hvmloader: Reserve FE700000-FE800000
	in physical memory map for guest 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

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1351148836 25200
# Node ID 79185dcdf55806f4d559c9cc1ef6a7953a21c30a
# Parent  b6a870378ec2c31f4bdebb8170ccc9c39763e152
hvmloader: Reserve FE700000-FE800000 in physical memory map for guest use.

Xen platform promises never to use this physical address region, and
will always mark it as reserved in the physical memory map presented
to the OS (preventing its use by generic OS services such as BAR
remapping).

Linux will use this region for mapping the shared-info page.

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


diff -r b6a870378ec2 -r 79185dcdf558 tools/firmware/hvmloader/config.h
--- a/tools/firmware/hvmloader/config.h	Thu Oct 25 16:04:54 2012 +0100
+++ b/tools/firmware/hvmloader/config.h	Thu Oct 25 00:07:16 2012 -0700
@@ -67,7 +67,17 @@ extern unsigned long pci_mem_start, pci_
 #define RESERVED_MEMBASE              0xFC000000
 /* NB. ACPI_INFO_PHYSICAL_ADDRESS *MUST* match definition in acpi/dsdt.asl! */
 #define ACPI_INFO_PHYSICAL_ADDRESS    0xFC000000
-#define RESERVED_MEMORY_DYNAMIC       0xFC001000
+#define RESERVED_MEMORY_DYNAMIC_START 0xFC001000
+#define RESERVED_MEMORY_DYNAMIC_END   0xFE000000
+/*
+ * GUEST_RESERVED: Physical address space reserved for guest use.
+ * This is not dynamically advertised to guests, so this range must *never*
+ * be used for any purpose by us, in future. It must always be marked as
+ * reserved in the memory map (e.g., E820_RESERVED) so that mechanisms such
+ * as PCI BAR remapping do not allocate from this region.
+ */
+#define GUEST_RESERVED_START          0xFE700000
+#define GUEST_RESERVED_END            0xFE800000
 
 extern unsigned long scratch_start;
 
diff -r b6a870378ec2 -r 79185dcdf558 tools/firmware/hvmloader/util.c
--- a/tools/firmware/hvmloader/util.c	Thu Oct 25 16:04:54 2012 +0100
+++ b/tools/firmware/hvmloader/util.c	Thu Oct 25 00:07:16 2012 -0700
@@ -416,13 +416,14 @@ void mem_hole_populate_ram(xen_pfn_t mfn
     }
 }
 
-static uint32_t reserve = RESERVED_MEMORY_DYNAMIC - 1;
+static uint32_t alloc_up = RESERVED_MEMORY_DYNAMIC_START - 1;
+static uint32_t alloc_down = RESERVED_MEMORY_DYNAMIC_END;
 
 xen_pfn_t mem_hole_alloc(uint32_t nr_mfns)
 {
-    hvm_info->reserved_mem_pgstart -= nr_mfns;
-    BUG_ON(hvm_info->reserved_mem_pgstart <= (reserve >> PAGE_SHIFT));
-    return hvm_info->reserved_mem_pgstart;
+    alloc_down -= nr_mfns << PAGE_SHIFT;
+    BUG_ON(alloc_up >= alloc_down);
+    return alloc_down >> PAGE_SHIFT;
 }
 
 void *mem_alloc(uint32_t size, uint32_t align)
@@ -433,18 +434,18 @@ void *mem_alloc(uint32_t size, uint32_t 
     if ( align < 16 )
         align = 16;
 
-    s = (reserve + align) & ~(align - 1);
+    s = (alloc_up + align) & ~(align - 1);
     e = s + size - 1;
 
-    BUG_ON((e < s) || (e >> PAGE_SHIFT) >= hvm_info->reserved_mem_pgstart);
+    BUG_ON((e < s) || (e >= alloc_down));
 
-    while ( (reserve >> PAGE_SHIFT) != (e >> PAGE_SHIFT) )
+    while ( (alloc_up >> PAGE_SHIFT) != (e >> PAGE_SHIFT) )
     {
-        reserve += PAGE_SIZE;
-        mem_hole_populate_ram(reserve >> PAGE_SHIFT, 1);
+        alloc_up += PAGE_SIZE;
+        mem_hole_populate_ram(alloc_up >> PAGE_SHIFT, 1);
     }
 
-    reserve = e;
+    alloc_up = e;
 
     return (void *)(unsigned long)s;
 }

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

From xen-changelog-bounces@lists.xen.org Fri Oct 26 01:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 26 Oct 2012 01: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 1TRZ8p-0003lz-Kj; Fri, 26 Oct 2012 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 <xen@xenbits.xen.org>) id 1TRZ8o-0003lU-ST
	for xen-changelog@lists.xensource.com; Fri, 26 Oct 2012 01:55:19 +0000
Received: from [85.158.139.83:60585] by server-15.bemta-5.messagelabs.com id
	10/55-26920-68DE9805; Fri, 26 Oct 2012 01:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-182.messagelabs.com!1351216516!30932879!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13250 invoked from network); 26 Oct 2012 01:55:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Oct 2012 01:55:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRZ8m-0005Ni-6i
	for xen-changelog@lists.xensource.com; Fri, 26 Oct 2012 01:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRZ8m-0007GE-1a
	for xen-changelog@lists.xensource.com; Fri, 26 Oct 2012 01:55:16 +0000
Message-Id: <E1TRZ8m-0007GE-1a@xenbits.xen.org>
Date: Fri, 26 Oct 2012 01:55:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Use libxl__realloc in a
	couple of places in libxl_events.c
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1351181129 -3600
# Node ID e9b8bf4656b99de0b0650a6ed7736a9eb80a5ae3
# Parent  6ccfe4d29f95e3928e57662b1022700078c6967b
libxl: Use libxl__realloc in a couple of places in libxl_events.c

This avoids us having to think about the error handling on failure.

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


diff -r 6ccfe4d29f95 -r e9b8bf4656b9 tools/libxl/libxl_event.c
--- a/tools/libxl/libxl_event.c	Thu Oct 25 17:04:37 2012 +0100
+++ b/tools/libxl/libxl_event.c	Thu Oct 25 17:05:29 2012 +0100
@@ -489,7 +489,8 @@ int libxl__ev_xswatch_register(libxl__gc
         int newarraysize = (CTX->watch_nslots + 1) << 2;
         int i;
         libxl__ev_watch_slot *newarray =
-            realloc(CTX->watch_slots, sizeof(*newarray) * newarraysize);
+            libxl__realloc(NOGC,
+                           CTX->watch_slots, sizeof(*newarray) * newarraysize);
         if (!newarray) goto out_nomem;
         for (i = CTX->watch_nslots; i < newarraysize; i++)
             LIBXL_SLIST_INSERT_HEAD(&CTX->watch_freeslots,
@@ -1343,7 +1344,7 @@ static int eventloop_iteration(libxl__eg
 
         struct pollfd *newarray =
             (nfds > INT_MAX / sizeof(struct pollfd) / 2) ? 0 :
-            realloc(poller->fd_polls, sizeof(*newarray) * nfds);
+            libxl__realloc(NOGC, poller->fd_polls, sizeof(*newarray) * nfds);
 
         if (!newarray) { rc = ERROR_NOMEM; goto out; }
 

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

From xen-changelog-bounces@lists.xen.org Fri Oct 26 01:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 26 Oct 2012 01: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 1TRZ8p-0003lz-Kj; Fri, 26 Oct 2012 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 <xen@xenbits.xen.org>) id 1TRZ8o-0003lU-ST
	for xen-changelog@lists.xensource.com; Fri, 26 Oct 2012 01:55:19 +0000
Received: from [85.158.139.83:60585] by server-15.bemta-5.messagelabs.com id
	10/55-26920-68DE9805; Fri, 26 Oct 2012 01:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-182.messagelabs.com!1351216516!30932879!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13250 invoked from network); 26 Oct 2012 01:55:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Oct 2012 01:55:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRZ8m-0005Ni-6i
	for xen-changelog@lists.xensource.com; Fri, 26 Oct 2012 01:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRZ8m-0007GE-1a
	for xen-changelog@lists.xensource.com; Fri, 26 Oct 2012 01:55:16 +0000
Message-Id: <E1TRZ8m-0007GE-1a@xenbits.xen.org>
Date: Fri, 26 Oct 2012 01:55:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Use libxl__realloc in a
	couple of places in libxl_events.c
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1351181129 -3600
# Node ID e9b8bf4656b99de0b0650a6ed7736a9eb80a5ae3
# Parent  6ccfe4d29f95e3928e57662b1022700078c6967b
libxl: Use libxl__realloc in a couple of places in libxl_events.c

This avoids us having to think about the error handling on failure.

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


diff -r 6ccfe4d29f95 -r e9b8bf4656b9 tools/libxl/libxl_event.c
--- a/tools/libxl/libxl_event.c	Thu Oct 25 17:04:37 2012 +0100
+++ b/tools/libxl/libxl_event.c	Thu Oct 25 17:05:29 2012 +0100
@@ -489,7 +489,8 @@ int libxl__ev_xswatch_register(libxl__gc
         int newarraysize = (CTX->watch_nslots + 1) << 2;
         int i;
         libxl__ev_watch_slot *newarray =
-            realloc(CTX->watch_slots, sizeof(*newarray) * newarraysize);
+            libxl__realloc(NOGC,
+                           CTX->watch_slots, sizeof(*newarray) * newarraysize);
         if (!newarray) goto out_nomem;
         for (i = CTX->watch_nslots; i < newarraysize; i++)
             LIBXL_SLIST_INSERT_HEAD(&CTX->watch_freeslots,
@@ -1343,7 +1344,7 @@ static int eventloop_iteration(libxl__eg
 
         struct pollfd *newarray =
             (nfds > INT_MAX / sizeof(struct pollfd) / 2) ? 0 :
-            realloc(poller->fd_polls, sizeof(*newarray) * nfds);
+            libxl__realloc(NOGC, poller->fd_polls, sizeof(*newarray) * nfds);
 
         if (!newarray) { rc = ERROR_NOMEM; goto out; }
 

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

From xen-changelog-bounces@lists.xen.org Fri Oct 26 01:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 26 Oct 2012 01:55:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TRZ8q-0003mI-Nc; Fri, 26 Oct 2012 01:55:20 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRZ8p-0003ls-Gq
	for xen-changelog@lists.xensource.com; Fri, 26 Oct 2012 01:55:19 +0000
Received: from [85.158.138.51:41347] by server-5.bemta-3.messagelabs.com id
	6E/43-12440-68DE9805; Fri, 26 Oct 2012 01:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-174.messagelabs.com!1351216516!19392556!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27609 invoked from network); 26 Oct 2012 01:55:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Oct 2012 01:55:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRZ8l-0005Nf-Ja
	for xen-changelog@lists.xensource.com; Fri, 26 Oct 2012 01:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRZ8l-0007Fz-Cn
	for xen-changelog@lists.xensource.com; Fri, 26 Oct 2012 01:55:15 +0000
Message-Id: <E1TRZ8l-0007Fz-Cn@xenbits.xen.org>
Date: Fri, 26 Oct 2012 01:55:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: Do not leak events when a domain
	exits.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1351181077 -3600
# Node ID 6ccfe4d29f95e3928e57662b1022700078c6967b
# Parent  79185dcdf55806f4d559c9cc1ef6a7953a21c30a
xl: Do not leak events when a domain exits.

The goto in both of these places misses the event free which would
normally clean up.

==8655== 80 bytes in 1 blocks are definitely lost in loss record 1 of 1
==8655==    at 0x4024370: calloc (vg_replace_malloc.c:593)
==8655==    by 0x406EAAE: libxl__zalloc (libxl_internal.c:83)
==8655==    by 0x4078173: libxl__event_new (libxl_event.c:1167)
==8655==    by 0x4056373: domain_death_occurred (libxl.c:958)
==8655==    by 0x4058D06: domain_death_xswatch_callback (libxl.c:1038)
==8655==    by 0x4078EB5: watchfd_callback (libxl_event.c:458)
==8655==    by 0x407839E: afterpoll_internal (libxl_event.c:949)
==8655==    by 0x4079142: eventloop_iteration (libxl_event.c:1371)
==8655==    by 0x40799BB: libxl_event_wait (libxl_event.c:1396)
==8655==    by 0x805CC67: create_domain (xl_cmdimpl.c:1698)
==8655==    by 0x805E001: main_create (xl_cmdimpl.c:3986)
==8655==    by 0x804D43D: main (xl.c:285)

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


diff -r 79185dcdf558 -r 6ccfe4d29f95 stubdom/grub/kexec.c
--- a/stubdom/grub/kexec.c	Thu Oct 25 00:07:16 2012 -0700
+++ b/stubdom/grub/kexec.c	Thu Oct 25 17:04:37 2012 +0100
@@ -137,6 +137,10 @@ void kexec(void *kernel, long kernel_siz
     dom = xc_dom_allocate(xc_handle, cmdline, features);
     dom->allocate = kexec_allocate;
 
+    /* We are using guest owned memory, therefore no limits. */
+    xc_dom_kernel_max_size(dom, 0);
+    xc_dom_ramdisk_max_size(dom, 0);
+
     dom->kernel_blob = kernel;
     dom->kernel_size = kernel_size;
 
diff -r 79185dcdf558 -r 6ccfe4d29f95 tools/libxc/xc_dom.h
--- a/tools/libxc/xc_dom.h	Thu Oct 25 00:07:16 2012 -0700
+++ b/tools/libxc/xc_dom.h	Thu Oct 25 17:04:37 2012 +0100
@@ -55,6 +55,9 @@ struct xc_dom_image {
     void *ramdisk_blob;
     size_t ramdisk_size;
 
+    size_t max_kernel_size;
+    size_t max_ramdisk_size;
+
     /* arguments and parameters */
     char *cmdline;
     uint32_t f_requested[XENFEAT_NR_SUBMAPS];
@@ -194,6 +197,13 @@ void xc_dom_release_phys(struct xc_dom_i
 void xc_dom_release(struct xc_dom_image *dom);
 int xc_dom_mem_init(struct xc_dom_image *dom, unsigned int mem_mb);
 
+#define XC_DOM_DECOMPRESS_MAX (1024*1024*1024) /* 1GB */
+int xc_dom_kernel_check_size(struct xc_dom_image *dom, size_t sz);
+int xc_dom_kernel_max_size(struct xc_dom_image *dom, size_t sz);
+
+int xc_dom_ramdisk_check_size(struct xc_dom_image *dom, size_t sz);
+int xc_dom_ramdisk_max_size(struct xc_dom_image *dom, size_t sz);
+
 size_t xc_dom_check_gzip(xc_interface *xch,
                      void *blob, size_t ziplen);
 int xc_dom_do_gunzip(xc_interface *xch,
@@ -254,7 +264,8 @@ void xc_dom_log_memory_footprint(struct 
 void *xc_dom_malloc(struct xc_dom_image *dom, size_t size);
 void *xc_dom_malloc_page_aligned(struct xc_dom_image *dom, size_t size);
 void *xc_dom_malloc_filemap(struct xc_dom_image *dom,
-                            const char *filename, size_t * size);
+                            const char *filename, size_t * size,
+                            const size_t max_size);
 char *xc_dom_strdup(struct xc_dom_image *dom, const char *str);
 
 /* --- alloc memory pool ------------------------------------------- */
diff -r 79185dcdf558 -r 6ccfe4d29f95 tools/libxc/xc_dom_bzimageloader.c
--- a/tools/libxc/xc_dom_bzimageloader.c	Thu Oct 25 00:07:16 2012 -0700
+++ b/tools/libxc/xc_dom_bzimageloader.c	Thu Oct 25 17:04:37 2012 +0100
@@ -47,7 +47,7 @@ static int xc_try_bzip2_decode(
     char *out_buf;
     char *tmp_buf;
     int retval = -1;
-    int outsize;
+    unsigned int outsize;
     uint64_t total;
 
     stream.bzalloc = NULL;
@@ -79,6 +79,17 @@ static int xc_try_bzip2_decode(
     stream.next_out = out_buf;
     stream.avail_out = dom->kernel_size;
 
+    /*
+     * stream.avail_in is an unsigned int, while kernel_size is a
+     * size_t. Check we aren't overflowing.
+     */
+    if ( stream.avail_in != dom->kernel_size )
+    {
+        DOMPRINTF("BZIP2: Input too large");
+        free(out_buf);
+        goto bzip2_cleanup;
+    }
+
     for ( ; ; )
     {
         ret = BZ2_bzDecompress(&stream);
@@ -98,13 +109,20 @@ static int xc_try_bzip2_decode(
         if ( stream.avail_out == 0 )
         {
             /* Protect against output buffer overflow */
-            if ( outsize > INT_MAX / 2 )
+            if ( outsize > UINT_MAX / 2 )
             {
                 DOMPRINTF("BZIP2: output buffer overflow");
                 free(out_buf);
                 goto bzip2_cleanup;
             }
 
+            if ( xc_dom_kernel_check_size(dom, outsize * 2) )
+            {
+                DOMPRINTF("BZIP2: output too large");
+                free(out_buf);
+                goto bzip2_cleanup;
+            }
+
             tmp_buf = realloc(out_buf, outsize * 2);
             if ( tmp_buf == NULL )
             {
@@ -172,7 +190,7 @@ static int _xc_try_lzma_decode(
     unsigned char *out_buf;
     unsigned char *tmp_buf;
     int retval = -1;
-    int outsize;
+    size_t outsize;
     const char *msg;
 
     /* sigh.  We don't know up-front how much memory we are going to need
@@ -244,13 +262,20 @@ static int _xc_try_lzma_decode(
         if ( stream->avail_out == 0 )
         {
             /* Protect against output buffer overflow */
-            if ( outsize > INT_MAX / 2 )
+            if ( outsize > SIZE_MAX / 2 )
             {
                 DOMPRINTF("%s: output buffer overflow", what);
                 free(out_buf);
                 goto lzma_cleanup;
             }
 
+            if ( xc_dom_kernel_check_size(dom, outsize * 2) )
+            {
+                DOMPRINTF("%s: output too large", what);
+                free(out_buf);
+                goto lzma_cleanup;
+            }
+
             tmp_buf = realloc(out_buf, outsize * 2);
             if ( tmp_buf == NULL )
             {
@@ -359,6 +384,12 @@ static int xc_try_lzo1x_decode(
         0x89, 0x4c, 0x5a, 0x4f, 0x00, 0x0d, 0x0a, 0x1a, 0x0a
     };
 
+    /*
+     * lzo_uint should match size_t. Check that this is the case to be
+     * sure we won't overflow various lzo_uint fields.
+     */
+    XC_BUILD_BUG_ON(sizeof(lzo_uint) != sizeof(size_t));
+
     ret = lzo_init();
     if ( ret != LZO_E_OK )
     {
@@ -438,6 +469,14 @@ static int xc_try_lzo1x_decode(
         if ( src_len <= 0 || src_len > dst_len || src_len > left )
             break;
 
+        msg = "Output buffer overflow";
+        if ( *size > SIZE_MAX - dst_len )
+            break;
+
+        msg = "Decompressed image too large";
+        if ( xc_dom_kernel_check_size(dom, *size + dst_len) )
+            break;
+
         msg = "Failed to (re)alloc memory";
         tmp_buf = realloc(out_buf, *size + dst_len);
         if ( tmp_buf == NULL )
diff -r 79185dcdf558 -r 6ccfe4d29f95 tools/libxc/xc_dom_core.c
--- a/tools/libxc/xc_dom_core.c	Thu Oct 25 00:07:16 2012 -0700
+++ b/tools/libxc/xc_dom_core.c	Thu Oct 25 17:04:37 2012 +0100
@@ -159,7 +159,8 @@ void *xc_dom_malloc_page_aligned(struct 
 }
 
 void *xc_dom_malloc_filemap(struct xc_dom_image *dom,
-                            const char *filename, size_t * size)
+                            const char *filename, size_t * size,
+                            const size_t max_size)
 {
     struct xc_dom_mem *block = NULL;
     int fd = -1;
@@ -171,6 +172,13 @@ void *xc_dom_malloc_filemap(struct xc_do
     lseek(fd, 0, SEEK_SET);
     *size = lseek(fd, 0, SEEK_END);
 
+    if ( max_size && *size > max_size )
+    {
+        xc_dom_panic(dom->xch, XC_OUT_OF_MEMORY,
+                     "tried to map file which is too large");
+        goto err;
+    }
+
     block = malloc(sizeof(*block));
     if ( block == NULL )
         goto err;
@@ -222,6 +230,40 @@ char *xc_dom_strdup(struct xc_dom_image 
 }
 
 /* ------------------------------------------------------------------------ */
+/* decompression buffer sizing                                              */
+int xc_dom_kernel_check_size(struct xc_dom_image *dom, size_t sz)
+{
+    /* No limit */
+    if ( !dom->max_kernel_size )
+        return 0;
+
+    if ( sz > dom->max_kernel_size )
+    {
+        xc_dom_panic(dom->xch, XC_INVALID_KERNEL,
+                     "kernel image too large");
+        return 1;
+    }
+
+    return 0;
+}
+
+int xc_dom_ramdisk_check_size(struct xc_dom_image *dom, size_t sz)
+{
+    /* No limit */
+    if ( !dom->max_ramdisk_size )
+        return 0;
+
+    if ( sz > dom->max_ramdisk_size )
+    {
+        xc_dom_panic(dom->xch, XC_INVALID_KERNEL,
+                     "ramdisk image too large");
+        return 1;
+    }
+
+    return 0;
+}
+
+/* ------------------------------------------------------------------------ */
 /* read files, copy memory blocks, with transparent gunzip                  */
 
 size_t xc_dom_check_gzip(xc_interface *xch, void *blob, size_t ziplen)
@@ -235,7 +277,7 @@ size_t xc_dom_check_gzip(xc_interface *x
 
     gzlen = blob + ziplen - 4;
     unziplen = gzlen[3] << 24 | gzlen[2] << 16 | gzlen[1] << 8 | gzlen[0];
-    if ( (unziplen < 0) || (unziplen > (1024*1024*1024)) ) /* 1GB limit */
+    if ( (unziplen < 0) || (unziplen > XC_DOM_DECOMPRESS_MAX) )
     {
         xc_dom_printf
             (xch,
@@ -288,6 +330,9 @@ int xc_dom_try_gunzip(struct xc_dom_imag
     if ( unziplen == 0 )
         return 0;
 
+    if ( xc_dom_kernel_check_size(dom, unziplen) )
+        return 0;
+
     unzip = xc_dom_malloc(dom, unziplen);
     if ( unzip == NULL )
         return -1;
@@ -590,6 +635,9 @@ struct xc_dom_image *xc_dom_allocate(xc_
     memset(dom, 0, sizeof(*dom));
     dom->xch = xch;
 
+    dom->max_kernel_size = XC_DOM_DECOMPRESS_MAX;
+    dom->max_ramdisk_size = XC_DOM_DECOMPRESS_MAX;
+
     if ( cmdline )
         dom->cmdline = xc_dom_strdup(dom, cmdline);
     if ( features )
@@ -610,10 +658,25 @@ struct xc_dom_image *xc_dom_allocate(xc_
     return NULL;
 }
 
+int xc_dom_kernel_max_size(struct xc_dom_image *dom, size_t sz)
+{
+    DOMPRINTF("%s: kernel_max_size=%zx", __FUNCTION__, sz);
+    dom->max_kernel_size = sz;
+    return 0;
+}
+
+int xc_dom_ramdisk_max_size(struct xc_dom_image *dom, size_t sz)
+{
+    DOMPRINTF("%s: ramdisk_max_size=%zx", __FUNCTION__, sz);
+    dom->max_ramdisk_size = sz;
+    return 0;
+}
+
 int xc_dom_kernel_file(struct xc_dom_image *dom, const char *filename)
 {
     DOMPRINTF("%s: filename=\"%s\"", __FUNCTION__, filename);
-    dom->kernel_blob = xc_dom_malloc_filemap(dom, filename, &dom->kernel_size);
+    dom->kernel_blob = xc_dom_malloc_filemap(dom, filename, &dom->kernel_size,
+                                             dom->max_kernel_size);
     if ( dom->kernel_blob == NULL )
         return -1;
     return xc_dom_try_gunzip(dom, &dom->kernel_blob, &dom->kernel_size);
@@ -622,8 +685,10 @@ int xc_dom_kernel_file(struct xc_dom_ima
 int xc_dom_ramdisk_file(struct xc_dom_image *dom, const char *filename)
 {
     DOMPRINTF("%s: filename=\"%s\"", __FUNCTION__, filename);
+    /* We do not enforce any particular size limit here */
     dom->ramdisk_blob =
-        xc_dom_malloc_filemap(dom, filename, &dom->ramdisk_size);
+        xc_dom_malloc_filemap(dom, filename, &dom->ramdisk_size, 0);
+
     if ( dom->ramdisk_blob == NULL )
         return -1;
 //    return xc_dom_try_gunzip(dom, &dom->ramdisk_blob, &dom->ramdisk_size);
@@ -783,7 +848,11 @@ int xc_dom_build_image(struct xc_dom_ima
         void *ramdiskmap;
 
         unziplen = xc_dom_check_gzip(dom->xch, dom->ramdisk_blob, dom->ramdisk_size);
+        if ( xc_dom_ramdisk_check_size(dom, unziplen) != 0 )
+            unziplen = 0;
+
         ramdisklen = unziplen ? unziplen : dom->ramdisk_size;
+
         if ( xc_dom_alloc_segment(dom, &dom->ramdisk_seg, "ramdisk", 0,
                                   ramdisklen) != 0 )
             goto err;
diff -r 79185dcdf558 -r 6ccfe4d29f95 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Oct 25 00:07:16 2012 -0700
+++ b/tools/libxl/xl_cmdimpl.c	Thu Oct 25 17:04:37 2012 +0100
@@ -2118,6 +2118,7 @@ start:
 
             case 0:
                 LOG("Done. Exiting now");
+                libxl_event_free(ctx, event);
                 ret = 0;
                 goto out;
 
@@ -2127,6 +2128,7 @@ start:
 
         case LIBXL_EVENT_TYPE_DOMAIN_DEATH:
             LOG("Domain %d has been destroyed.", domid);
+            libxl_event_free(ctx, event);
             ret = 0;
             goto out;
 

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

From xen-changelog-bounces@lists.xen.org Fri Oct 26 01:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 26 Oct 2012 01:55:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TRZ8q-0003mI-Nc; Fri, 26 Oct 2012 01:55:20 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRZ8p-0003ls-Gq
	for xen-changelog@lists.xensource.com; Fri, 26 Oct 2012 01:55:19 +0000
Received: from [85.158.138.51:41347] by server-5.bemta-3.messagelabs.com id
	6E/43-12440-68DE9805; Fri, 26 Oct 2012 01:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-174.messagelabs.com!1351216516!19392556!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27609 invoked from network); 26 Oct 2012 01:55:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Oct 2012 01:55:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRZ8l-0005Nf-Ja
	for xen-changelog@lists.xensource.com; Fri, 26 Oct 2012 01:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRZ8l-0007Fz-Cn
	for xen-changelog@lists.xensource.com; Fri, 26 Oct 2012 01:55:15 +0000
Message-Id: <E1TRZ8l-0007Fz-Cn@xenbits.xen.org>
Date: Fri, 26 Oct 2012 01:55:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: Do not leak events when a domain
	exits.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1351181077 -3600
# Node ID 6ccfe4d29f95e3928e57662b1022700078c6967b
# Parent  79185dcdf55806f4d559c9cc1ef6a7953a21c30a
xl: Do not leak events when a domain exits.

The goto in both of these places misses the event free which would
normally clean up.

==8655== 80 bytes in 1 blocks are definitely lost in loss record 1 of 1
==8655==    at 0x4024370: calloc (vg_replace_malloc.c:593)
==8655==    by 0x406EAAE: libxl__zalloc (libxl_internal.c:83)
==8655==    by 0x4078173: libxl__event_new (libxl_event.c:1167)
==8655==    by 0x4056373: domain_death_occurred (libxl.c:958)
==8655==    by 0x4058D06: domain_death_xswatch_callback (libxl.c:1038)
==8655==    by 0x4078EB5: watchfd_callback (libxl_event.c:458)
==8655==    by 0x407839E: afterpoll_internal (libxl_event.c:949)
==8655==    by 0x4079142: eventloop_iteration (libxl_event.c:1371)
==8655==    by 0x40799BB: libxl_event_wait (libxl_event.c:1396)
==8655==    by 0x805CC67: create_domain (xl_cmdimpl.c:1698)
==8655==    by 0x805E001: main_create (xl_cmdimpl.c:3986)
==8655==    by 0x804D43D: main (xl.c:285)

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


diff -r 79185dcdf558 -r 6ccfe4d29f95 stubdom/grub/kexec.c
--- a/stubdom/grub/kexec.c	Thu Oct 25 00:07:16 2012 -0700
+++ b/stubdom/grub/kexec.c	Thu Oct 25 17:04:37 2012 +0100
@@ -137,6 +137,10 @@ void kexec(void *kernel, long kernel_siz
     dom = xc_dom_allocate(xc_handle, cmdline, features);
     dom->allocate = kexec_allocate;
 
+    /* We are using guest owned memory, therefore no limits. */
+    xc_dom_kernel_max_size(dom, 0);
+    xc_dom_ramdisk_max_size(dom, 0);
+
     dom->kernel_blob = kernel;
     dom->kernel_size = kernel_size;
 
diff -r 79185dcdf558 -r 6ccfe4d29f95 tools/libxc/xc_dom.h
--- a/tools/libxc/xc_dom.h	Thu Oct 25 00:07:16 2012 -0700
+++ b/tools/libxc/xc_dom.h	Thu Oct 25 17:04:37 2012 +0100
@@ -55,6 +55,9 @@ struct xc_dom_image {
     void *ramdisk_blob;
     size_t ramdisk_size;
 
+    size_t max_kernel_size;
+    size_t max_ramdisk_size;
+
     /* arguments and parameters */
     char *cmdline;
     uint32_t f_requested[XENFEAT_NR_SUBMAPS];
@@ -194,6 +197,13 @@ void xc_dom_release_phys(struct xc_dom_i
 void xc_dom_release(struct xc_dom_image *dom);
 int xc_dom_mem_init(struct xc_dom_image *dom, unsigned int mem_mb);
 
+#define XC_DOM_DECOMPRESS_MAX (1024*1024*1024) /* 1GB */
+int xc_dom_kernel_check_size(struct xc_dom_image *dom, size_t sz);
+int xc_dom_kernel_max_size(struct xc_dom_image *dom, size_t sz);
+
+int xc_dom_ramdisk_check_size(struct xc_dom_image *dom, size_t sz);
+int xc_dom_ramdisk_max_size(struct xc_dom_image *dom, size_t sz);
+
 size_t xc_dom_check_gzip(xc_interface *xch,
                      void *blob, size_t ziplen);
 int xc_dom_do_gunzip(xc_interface *xch,
@@ -254,7 +264,8 @@ void xc_dom_log_memory_footprint(struct 
 void *xc_dom_malloc(struct xc_dom_image *dom, size_t size);
 void *xc_dom_malloc_page_aligned(struct xc_dom_image *dom, size_t size);
 void *xc_dom_malloc_filemap(struct xc_dom_image *dom,
-                            const char *filename, size_t * size);
+                            const char *filename, size_t * size,
+                            const size_t max_size);
 char *xc_dom_strdup(struct xc_dom_image *dom, const char *str);
 
 /* --- alloc memory pool ------------------------------------------- */
diff -r 79185dcdf558 -r 6ccfe4d29f95 tools/libxc/xc_dom_bzimageloader.c
--- a/tools/libxc/xc_dom_bzimageloader.c	Thu Oct 25 00:07:16 2012 -0700
+++ b/tools/libxc/xc_dom_bzimageloader.c	Thu Oct 25 17:04:37 2012 +0100
@@ -47,7 +47,7 @@ static int xc_try_bzip2_decode(
     char *out_buf;
     char *tmp_buf;
     int retval = -1;
-    int outsize;
+    unsigned int outsize;
     uint64_t total;
 
     stream.bzalloc = NULL;
@@ -79,6 +79,17 @@ static int xc_try_bzip2_decode(
     stream.next_out = out_buf;
     stream.avail_out = dom->kernel_size;
 
+    /*
+     * stream.avail_in is an unsigned int, while kernel_size is a
+     * size_t. Check we aren't overflowing.
+     */
+    if ( stream.avail_in != dom->kernel_size )
+    {
+        DOMPRINTF("BZIP2: Input too large");
+        free(out_buf);
+        goto bzip2_cleanup;
+    }
+
     for ( ; ; )
     {
         ret = BZ2_bzDecompress(&stream);
@@ -98,13 +109,20 @@ static int xc_try_bzip2_decode(
         if ( stream.avail_out == 0 )
         {
             /* Protect against output buffer overflow */
-            if ( outsize > INT_MAX / 2 )
+            if ( outsize > UINT_MAX / 2 )
             {
                 DOMPRINTF("BZIP2: output buffer overflow");
                 free(out_buf);
                 goto bzip2_cleanup;
             }
 
+            if ( xc_dom_kernel_check_size(dom, outsize * 2) )
+            {
+                DOMPRINTF("BZIP2: output too large");
+                free(out_buf);
+                goto bzip2_cleanup;
+            }
+
             tmp_buf = realloc(out_buf, outsize * 2);
             if ( tmp_buf == NULL )
             {
@@ -172,7 +190,7 @@ static int _xc_try_lzma_decode(
     unsigned char *out_buf;
     unsigned char *tmp_buf;
     int retval = -1;
-    int outsize;
+    size_t outsize;
     const char *msg;
 
     /* sigh.  We don't know up-front how much memory we are going to need
@@ -244,13 +262,20 @@ static int _xc_try_lzma_decode(
         if ( stream->avail_out == 0 )
         {
             /* Protect against output buffer overflow */
-            if ( outsize > INT_MAX / 2 )
+            if ( outsize > SIZE_MAX / 2 )
             {
                 DOMPRINTF("%s: output buffer overflow", what);
                 free(out_buf);
                 goto lzma_cleanup;
             }
 
+            if ( xc_dom_kernel_check_size(dom, outsize * 2) )
+            {
+                DOMPRINTF("%s: output too large", what);
+                free(out_buf);
+                goto lzma_cleanup;
+            }
+
             tmp_buf = realloc(out_buf, outsize * 2);
             if ( tmp_buf == NULL )
             {
@@ -359,6 +384,12 @@ static int xc_try_lzo1x_decode(
         0x89, 0x4c, 0x5a, 0x4f, 0x00, 0x0d, 0x0a, 0x1a, 0x0a
     };
 
+    /*
+     * lzo_uint should match size_t. Check that this is the case to be
+     * sure we won't overflow various lzo_uint fields.
+     */
+    XC_BUILD_BUG_ON(sizeof(lzo_uint) != sizeof(size_t));
+
     ret = lzo_init();
     if ( ret != LZO_E_OK )
     {
@@ -438,6 +469,14 @@ static int xc_try_lzo1x_decode(
         if ( src_len <= 0 || src_len > dst_len || src_len > left )
             break;
 
+        msg = "Output buffer overflow";
+        if ( *size > SIZE_MAX - dst_len )
+            break;
+
+        msg = "Decompressed image too large";
+        if ( xc_dom_kernel_check_size(dom, *size + dst_len) )
+            break;
+
         msg = "Failed to (re)alloc memory";
         tmp_buf = realloc(out_buf, *size + dst_len);
         if ( tmp_buf == NULL )
diff -r 79185dcdf558 -r 6ccfe4d29f95 tools/libxc/xc_dom_core.c
--- a/tools/libxc/xc_dom_core.c	Thu Oct 25 00:07:16 2012 -0700
+++ b/tools/libxc/xc_dom_core.c	Thu Oct 25 17:04:37 2012 +0100
@@ -159,7 +159,8 @@ void *xc_dom_malloc_page_aligned(struct 
 }
 
 void *xc_dom_malloc_filemap(struct xc_dom_image *dom,
-                            const char *filename, size_t * size)
+                            const char *filename, size_t * size,
+                            const size_t max_size)
 {
     struct xc_dom_mem *block = NULL;
     int fd = -1;
@@ -171,6 +172,13 @@ void *xc_dom_malloc_filemap(struct xc_do
     lseek(fd, 0, SEEK_SET);
     *size = lseek(fd, 0, SEEK_END);
 
+    if ( max_size && *size > max_size )
+    {
+        xc_dom_panic(dom->xch, XC_OUT_OF_MEMORY,
+                     "tried to map file which is too large");
+        goto err;
+    }
+
     block = malloc(sizeof(*block));
     if ( block == NULL )
         goto err;
@@ -222,6 +230,40 @@ char *xc_dom_strdup(struct xc_dom_image 
 }
 
 /* ------------------------------------------------------------------------ */
+/* decompression buffer sizing                                              */
+int xc_dom_kernel_check_size(struct xc_dom_image *dom, size_t sz)
+{
+    /* No limit */
+    if ( !dom->max_kernel_size )
+        return 0;
+
+    if ( sz > dom->max_kernel_size )
+    {
+        xc_dom_panic(dom->xch, XC_INVALID_KERNEL,
+                     "kernel image too large");
+        return 1;
+    }
+
+    return 0;
+}
+
+int xc_dom_ramdisk_check_size(struct xc_dom_image *dom, size_t sz)
+{
+    /* No limit */
+    if ( !dom->max_ramdisk_size )
+        return 0;
+
+    if ( sz > dom->max_ramdisk_size )
+    {
+        xc_dom_panic(dom->xch, XC_INVALID_KERNEL,
+                     "ramdisk image too large");
+        return 1;
+    }
+
+    return 0;
+}
+
+/* ------------------------------------------------------------------------ */
 /* read files, copy memory blocks, with transparent gunzip                  */
 
 size_t xc_dom_check_gzip(xc_interface *xch, void *blob, size_t ziplen)
@@ -235,7 +277,7 @@ size_t xc_dom_check_gzip(xc_interface *x
 
     gzlen = blob + ziplen - 4;
     unziplen = gzlen[3] << 24 | gzlen[2] << 16 | gzlen[1] << 8 | gzlen[0];
-    if ( (unziplen < 0) || (unziplen > (1024*1024*1024)) ) /* 1GB limit */
+    if ( (unziplen < 0) || (unziplen > XC_DOM_DECOMPRESS_MAX) )
     {
         xc_dom_printf
             (xch,
@@ -288,6 +330,9 @@ int xc_dom_try_gunzip(struct xc_dom_imag
     if ( unziplen == 0 )
         return 0;
 
+    if ( xc_dom_kernel_check_size(dom, unziplen) )
+        return 0;
+
     unzip = xc_dom_malloc(dom, unziplen);
     if ( unzip == NULL )
         return -1;
@@ -590,6 +635,9 @@ struct xc_dom_image *xc_dom_allocate(xc_
     memset(dom, 0, sizeof(*dom));
     dom->xch = xch;
 
+    dom->max_kernel_size = XC_DOM_DECOMPRESS_MAX;
+    dom->max_ramdisk_size = XC_DOM_DECOMPRESS_MAX;
+
     if ( cmdline )
         dom->cmdline = xc_dom_strdup(dom, cmdline);
     if ( features )
@@ -610,10 +658,25 @@ struct xc_dom_image *xc_dom_allocate(xc_
     return NULL;
 }
 
+int xc_dom_kernel_max_size(struct xc_dom_image *dom, size_t sz)
+{
+    DOMPRINTF("%s: kernel_max_size=%zx", __FUNCTION__, sz);
+    dom->max_kernel_size = sz;
+    return 0;
+}
+
+int xc_dom_ramdisk_max_size(struct xc_dom_image *dom, size_t sz)
+{
+    DOMPRINTF("%s: ramdisk_max_size=%zx", __FUNCTION__, sz);
+    dom->max_ramdisk_size = sz;
+    return 0;
+}
+
 int xc_dom_kernel_file(struct xc_dom_image *dom, const char *filename)
 {
     DOMPRINTF("%s: filename=\"%s\"", __FUNCTION__, filename);
-    dom->kernel_blob = xc_dom_malloc_filemap(dom, filename, &dom->kernel_size);
+    dom->kernel_blob = xc_dom_malloc_filemap(dom, filename, &dom->kernel_size,
+                                             dom->max_kernel_size);
     if ( dom->kernel_blob == NULL )
         return -1;
     return xc_dom_try_gunzip(dom, &dom->kernel_blob, &dom->kernel_size);
@@ -622,8 +685,10 @@ int xc_dom_kernel_file(struct xc_dom_ima
 int xc_dom_ramdisk_file(struct xc_dom_image *dom, const char *filename)
 {
     DOMPRINTF("%s: filename=\"%s\"", __FUNCTION__, filename);
+    /* We do not enforce any particular size limit here */
     dom->ramdisk_blob =
-        xc_dom_malloc_filemap(dom, filename, &dom->ramdisk_size);
+        xc_dom_malloc_filemap(dom, filename, &dom->ramdisk_size, 0);
+
     if ( dom->ramdisk_blob == NULL )
         return -1;
 //    return xc_dom_try_gunzip(dom, &dom->ramdisk_blob, &dom->ramdisk_size);
@@ -783,7 +848,11 @@ int xc_dom_build_image(struct xc_dom_ima
         void *ramdiskmap;
 
         unziplen = xc_dom_check_gzip(dom->xch, dom->ramdisk_blob, dom->ramdisk_size);
+        if ( xc_dom_ramdisk_check_size(dom, unziplen) != 0 )
+            unziplen = 0;
+
         ramdisklen = unziplen ? unziplen : dom->ramdisk_size;
+
         if ( xc_dom_alloc_segment(dom, &dom->ramdisk_seg, "ramdisk", 0,
                                   ramdisklen) != 0 )
             goto err;
diff -r 79185dcdf558 -r 6ccfe4d29f95 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Oct 25 00:07:16 2012 -0700
+++ b/tools/libxl/xl_cmdimpl.c	Thu Oct 25 17:04:37 2012 +0100
@@ -2118,6 +2118,7 @@ start:
 
             case 0:
                 LOG("Done. Exiting now");
+                libxl_event_free(ctx, event);
                 ret = 0;
                 goto out;
 
@@ -2127,6 +2128,7 @@ start:
 
         case LIBXL_EVENT_TYPE_DOMAIN_DEATH:
             LOG("Domain %d has been destroyed.", domid);
+            libxl_event_free(ctx, event);
             ret = 0;
             goto out;
 

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

From xen-changelog-bounces@lists.xen.org Fri Oct 26 01:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 26 Oct 2012 01:55:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TRZ8r-0003mT-QY; Fri, 26 Oct 2012 01:55:21 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRZ8q-0003mA-EM
	for xen-changelog@lists.xensource.com; Fri, 26 Oct 2012 01:55:20 +0000
Received: from [85.158.143.99:55409] by server-3.bemta-4.messagelabs.com id
	3F/44-24279-78DE9805; Fri, 26 Oct 2012 01:55:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1351216517!17657960!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24973 invoked from network); 26 Oct 2012 01:55:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Oct 2012 01:55:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRZ8n-0005Nl-Dx
	for xen-changelog@lists.xensource.com; Fri, 26 Oct 2012 01:55:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRZ8m-0007GT-OZ
	for xen-changelog@lists.xensource.com; Fri, 26 Oct 2012 01:55:17 +0000
Message-Id: <E1TRZ8m-0007GT-OZ@xenbits.xen.org>
Date: Fri, 26 Oct 2012 01:55:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: NetBSD PCI passthrough support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1351181575 -3600
# Node ID c26e1a79fe77735410d5712348a612fa4b1e377f
# Parent  e9b8bf4656b99de0b0650a6ed7736a9eb80a5ae3
libxl: NetBSD PCI passthrough support

Add PCI passthrough support for HVM guests.

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


diff -r e9b8bf4656b9 -r c26e1a79fe77 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Thu Oct 25 17:05:29 2012 +0100
+++ b/tools/libxl/libxl_internal.h	Thu Oct 25 17:12:55 2012 +0100
@@ -373,8 +373,6 @@ typedef struct {
 #define PCI_SLOT(devfn)         (((devfn) >> 3) & 0x1f)
 #define PCI_FUNC(devfn)         ((devfn) & 0x07)
 #define AUTO_PHP_SLOT          0x100
-#define SYSFS_PCI_DEV          "/sys/bus/pci/devices"
-#define SYSFS_PCIBACK_DRIVER   "/sys/bus/pci/drivers/pciback"
 #define XENSTORE_PID_FILE      "/var/run/xenstored.pid"
 
 #define PROC_PCI_NUM_RESOURCES 7
diff -r e9b8bf4656b9 -r c26e1a79fe77 tools/libxl/libxl_osdeps.h
--- a/tools/libxl/libxl_osdeps.h	Thu Oct 25 17:05:29 2012 +0100
+++ b/tools/libxl/libxl_osdeps.h	Thu Oct 25 17:12:55 2012 +0100
@@ -23,14 +23,27 @@
 
 #define _GNU_SOURCE
 
-#if defined(__NetBSD__) || defined(__OpenBSD__)
+#if defined(__NetBSD__)
+#define SYSFS_PCI_DEV          "/sys/bus/pci/devices"
+#define SYSFS_PCIBACK_DRIVER   "/kern/xen/pci"
+#include <util.h>
+#elif defined(__OpenBSD__)
 #include <util.h>
 #elif defined(__linux__)
+#define SYSFS_PCI_DEV          "/sys/bus/pci/devices"
+#define SYSFS_PCIBACK_DRIVER   "/sys/bus/pci/drivers/pciback"
 #include <pty.h>
 #elif defined(__sun__)
 #include <stropts.h>
 #endif
 
+#ifndef SYSFS_PCIBACK_DRIVER
+#error define SYSFS_PCIBACK_DRIVER for your platform
+#endif
+#ifndef SYSFS_PCI_DEV
+#error define SYSFS_PCI_DEV for your platform
+#endif
+
 #ifdef NEED_OWN_ASPRINTF
 #include <stdarg.h>
 

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

From xen-changelog-bounces@lists.xen.org Fri Oct 26 01:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 26 Oct 2012 01:55:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TRZ8r-0003mT-QY; Fri, 26 Oct 2012 01:55:21 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRZ8q-0003mA-EM
	for xen-changelog@lists.xensource.com; Fri, 26 Oct 2012 01:55:20 +0000
Received: from [85.158.143.99:55409] by server-3.bemta-4.messagelabs.com id
	3F/44-24279-78DE9805; Fri, 26 Oct 2012 01:55:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1351216517!17657960!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24973 invoked from network); 26 Oct 2012 01:55:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Oct 2012 01:55:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRZ8n-0005Nl-Dx
	for xen-changelog@lists.xensource.com; Fri, 26 Oct 2012 01:55:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TRZ8m-0007GT-OZ
	for xen-changelog@lists.xensource.com; Fri, 26 Oct 2012 01:55:17 +0000
Message-Id: <E1TRZ8m-0007GT-OZ@xenbits.xen.org>
Date: Fri, 26 Oct 2012 01:55:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: NetBSD PCI passthrough support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1351181575 -3600
# Node ID c26e1a79fe77735410d5712348a612fa4b1e377f
# Parent  e9b8bf4656b99de0b0650a6ed7736a9eb80a5ae3
libxl: NetBSD PCI passthrough support

Add PCI passthrough support for HVM guests.

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


diff -r e9b8bf4656b9 -r c26e1a79fe77 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Thu Oct 25 17:05:29 2012 +0100
+++ b/tools/libxl/libxl_internal.h	Thu Oct 25 17:12:55 2012 +0100
@@ -373,8 +373,6 @@ typedef struct {
 #define PCI_SLOT(devfn)         (((devfn) >> 3) & 0x1f)
 #define PCI_FUNC(devfn)         ((devfn) & 0x07)
 #define AUTO_PHP_SLOT          0x100
-#define SYSFS_PCI_DEV          "/sys/bus/pci/devices"
-#define SYSFS_PCIBACK_DRIVER   "/sys/bus/pci/drivers/pciback"
 #define XENSTORE_PID_FILE      "/var/run/xenstored.pid"
 
 #define PROC_PCI_NUM_RESOURCES 7
diff -r e9b8bf4656b9 -r c26e1a79fe77 tools/libxl/libxl_osdeps.h
--- a/tools/libxl/libxl_osdeps.h	Thu Oct 25 17:05:29 2012 +0100
+++ b/tools/libxl/libxl_osdeps.h	Thu Oct 25 17:12:55 2012 +0100
@@ -23,14 +23,27 @@
 
 #define _GNU_SOURCE
 
-#if defined(__NetBSD__) || defined(__OpenBSD__)
+#if defined(__NetBSD__)
+#define SYSFS_PCI_DEV          "/sys/bus/pci/devices"
+#define SYSFS_PCIBACK_DRIVER   "/kern/xen/pci"
+#include <util.h>
+#elif defined(__OpenBSD__)
 #include <util.h>
 #elif defined(__linux__)
+#define SYSFS_PCI_DEV          "/sys/bus/pci/devices"
+#define SYSFS_PCIBACK_DRIVER   "/sys/bus/pci/drivers/pciback"
 #include <pty.h>
 #elif defined(__sun__)
 #include <stropts.h>
 #endif
 
+#ifndef SYSFS_PCIBACK_DRIVER
+#error define SYSFS_PCIBACK_DRIVER for your platform
+#endif
+#ifndef SYSFS_PCI_DEV
+#error define SYSFS_PCI_DEV for your platform
+#endif
+
 #ifdef NEED_OWN_ASPRINTF
 #include <stdarg.h>
 

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

From xen-changelog-bounces@lists.xen.org Mon Oct 29 23:55:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 29 Oct 2012 23: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 1TSzAt-0002pW-A7; Mon, 29 Oct 2012 23:55:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAr-0002oW-6y
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:17 +0000
Received: from [85.158.137.99:22612] by server-10.bemta-3.messagelabs.com id
	3F/22-00901-4671F805; Mon, 29 Oct 2012 23:55:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-217.messagelabs.com!1351554914!18735729!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31858 invoked from network); 29 Oct 2012 23:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2012 23:55:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAn-0006O0-UL
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAn-0000lW-PF
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:13 +0000
Message-Id: <E1TSzAn-0000lW-PF@xenbits.xen.org>
Date: Mon, 29 Oct 2012 23:55:13 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] More efficient TLB-flush
	filtering in alloc_heap_pages().
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1351497712 -3600
# Node ID a18ca08c475e020da935c2024cebc2d8b97074cb
# Parent  de551622e12493ca8747a69d68cd08103411a220
More efficient TLB-flush filtering in alloc_heap_pages().

Rather than per-cpu filtering for every page in a super-page
allocation, simply remember the most recent TLB timestamp across all
allocated pages, and filter on that, just once, at the end of the
function.

For large-CPU systems, doing 2MB allocations during domain creation,
this cuts down the domain creation time *massively*.

TODO: It may make sense to move the filtering out into some callers,
such as memory.c:populate_physmap() and
memory.c:increase_reservation(), so that the filtering can be moved
outside their loops, too.

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 26056:177fdda0be56
xen-unstable date: Mon Oct 15 15:38:11 UTC 2012
---


diff -r de551622e124 -r a18ca08c475e xen/common/page_alloc.c
--- a/xen/common/page_alloc.c	Mon Oct 29 09:01:14 2012 +0100
+++ b/xen/common/page_alloc.c	Mon Oct 29 09:01:52 2012 +0100
@@ -303,9 +303,10 @@ static struct page_info *alloc_heap_page
     unsigned int first_node, i, j, zone = 0, nodemask_retry = 0;
     unsigned int node = (uint8_t)((memflags >> _MEMF_node) - 1);
     unsigned long request = 1UL << order;
-    cpumask_t extra_cpus_mask, mask;
     struct page_info *pg;
     nodemask_t nodemask = (d != NULL ) ? d->node_affinity : node_online_map;
+    bool_t need_tlbflush = 0;
+    uint32_t tlbflush_timestamp = 0;
 
     if ( node == NUMA_NO_NODE )
     {
@@ -417,20 +418,19 @@ static struct page_info *alloc_heap_page
     if ( d != NULL )
         d->last_alloc_node = node;
 
-    cpus_clear(mask);
-
     for ( i = 0; i < (1 << order); i++ )
     {
         /* Reference count must continuously be zero for free pages. */
         BUG_ON(pg[i].count_info != PGC_state_free);
         pg[i].count_info = PGC_state_inuse;
 
-        if ( pg[i].u.free.need_tlbflush )
+        if ( pg[i].u.free.need_tlbflush &&
+             (pg[i].tlbflush_timestamp <= tlbflush_current_time()) &&
+             (!need_tlbflush ||
+              (pg[i].tlbflush_timestamp > tlbflush_timestamp)) )
         {
-            /* Add in extra CPUs that need flushing because of this page. */
-            cpus_andnot(extra_cpus_mask, cpu_online_map, mask);
-            tlbflush_filter(extra_cpus_mask, pg[i].tlbflush_timestamp);
-            cpus_or(mask, mask, extra_cpus_mask);
+            need_tlbflush = 1;
+            tlbflush_timestamp = pg[i].tlbflush_timestamp;
         }
 
         /* Initialise fields which have other uses for free pages. */
@@ -440,10 +440,15 @@ static struct page_info *alloc_heap_page
 
     spin_unlock(&heap_lock);
 
-    if ( unlikely(!cpus_empty(mask)) )
+    if ( need_tlbflush )
     {
-        perfc_incr(need_flush_tlb_flush);
-        flush_tlb_mask(&mask);
+        cpumask_t mask = cpu_online_map;
+        tlbflush_filter(mask, tlbflush_timestamp);
+        if ( !cpus_empty(mask) )
+        {
+            perfc_incr(need_flush_tlb_flush);
+            flush_tlb_mask(&mask);
+        }
     }
 
     return pg;

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

From xen-changelog-bounces@lists.xen.org Mon Oct 29 23:55:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 29 Oct 2012 23: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 1TSzAt-0002pW-A7; Mon, 29 Oct 2012 23:55:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAr-0002oW-6y
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:17 +0000
Received: from [85.158.137.99:22612] by server-10.bemta-3.messagelabs.com id
	3F/22-00901-4671F805; Mon, 29 Oct 2012 23:55:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-217.messagelabs.com!1351554914!18735729!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31858 invoked from network); 29 Oct 2012 23:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2012 23:55:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAn-0006O0-UL
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAn-0000lW-PF
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:13 +0000
Message-Id: <E1TSzAn-0000lW-PF@xenbits.xen.org>
Date: Mon, 29 Oct 2012 23:55:13 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] More efficient TLB-flush
	filtering in alloc_heap_pages().
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1351497712 -3600
# Node ID a18ca08c475e020da935c2024cebc2d8b97074cb
# Parent  de551622e12493ca8747a69d68cd08103411a220
More efficient TLB-flush filtering in alloc_heap_pages().

Rather than per-cpu filtering for every page in a super-page
allocation, simply remember the most recent TLB timestamp across all
allocated pages, and filter on that, just once, at the end of the
function.

For large-CPU systems, doing 2MB allocations during domain creation,
this cuts down the domain creation time *massively*.

TODO: It may make sense to move the filtering out into some callers,
such as memory.c:populate_physmap() and
memory.c:increase_reservation(), so that the filtering can be moved
outside their loops, too.

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 26056:177fdda0be56
xen-unstable date: Mon Oct 15 15:38:11 UTC 2012
---


diff -r de551622e124 -r a18ca08c475e xen/common/page_alloc.c
--- a/xen/common/page_alloc.c	Mon Oct 29 09:01:14 2012 +0100
+++ b/xen/common/page_alloc.c	Mon Oct 29 09:01:52 2012 +0100
@@ -303,9 +303,10 @@ static struct page_info *alloc_heap_page
     unsigned int first_node, i, j, zone = 0, nodemask_retry = 0;
     unsigned int node = (uint8_t)((memflags >> _MEMF_node) - 1);
     unsigned long request = 1UL << order;
-    cpumask_t extra_cpus_mask, mask;
     struct page_info *pg;
     nodemask_t nodemask = (d != NULL ) ? d->node_affinity : node_online_map;
+    bool_t need_tlbflush = 0;
+    uint32_t tlbflush_timestamp = 0;
 
     if ( node == NUMA_NO_NODE )
     {
@@ -417,20 +418,19 @@ static struct page_info *alloc_heap_page
     if ( d != NULL )
         d->last_alloc_node = node;
 
-    cpus_clear(mask);
-
     for ( i = 0; i < (1 << order); i++ )
     {
         /* Reference count must continuously be zero for free pages. */
         BUG_ON(pg[i].count_info != PGC_state_free);
         pg[i].count_info = PGC_state_inuse;
 
-        if ( pg[i].u.free.need_tlbflush )
+        if ( pg[i].u.free.need_tlbflush &&
+             (pg[i].tlbflush_timestamp <= tlbflush_current_time()) &&
+             (!need_tlbflush ||
+              (pg[i].tlbflush_timestamp > tlbflush_timestamp)) )
         {
-            /* Add in extra CPUs that need flushing because of this page. */
-            cpus_andnot(extra_cpus_mask, cpu_online_map, mask);
-            tlbflush_filter(extra_cpus_mask, pg[i].tlbflush_timestamp);
-            cpus_or(mask, mask, extra_cpus_mask);
+            need_tlbflush = 1;
+            tlbflush_timestamp = pg[i].tlbflush_timestamp;
         }
 
         /* Initialise fields which have other uses for free pages. */
@@ -440,10 +440,15 @@ static struct page_info *alloc_heap_page
 
     spin_unlock(&heap_lock);
 
-    if ( unlikely(!cpus_empty(mask)) )
+    if ( need_tlbflush )
     {
-        perfc_incr(need_flush_tlb_flush);
-        flush_tlb_mask(&mask);
+        cpumask_t mask = cpu_online_map;
+        tlbflush_filter(mask, tlbflush_timestamp);
+        if ( !cpus_empty(mask) )
+        {
+            perfc_incr(need_flush_tlb_flush);
+            flush_tlb_mask(&mask);
+        }
     }
 
     return pg;

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

From xen-changelog-bounces@lists.xen.org Mon Oct 29 23:55:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 29 Oct 2012 23: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 1TSzAq-0002ob-Tt; Mon, 29 Oct 2012 23:55:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAp-0002oI-An
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:15 +0000
Received: from [85.158.138.51:38736] by server-12.bemta-3.messagelabs.com id
	DD/EF-27853-2671F805; Mon, 29 Oct 2012 23:55:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-174.messagelabs.com!1351554912!19876350!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10657 invoked from network); 29 Oct 2012 23:55:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2012 23:55:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAl-0006Nr-Tb
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAl-0000kk-NZ
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:11 +0000
Message-Id: <E1TSzAl-0000kk-NZ@xenbits.xen.org>
Date: Mon, 29 Oct 2012 23:55:11 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] hvmloader: Do not zero the
	wallclock fields in shared-info.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1351497407 -3600
# Node ID d601e331d615e06f08f461e105419c80b2eec20e
# Parent  69d1cc78a5bd066ca84019512c6e3d60c1a3fef4
hvmloader: Do not zero the wallclock fields in shared-info.

These fields need to be valid at all times. Hypervisor ensures this
even across 32/64-bit guest transitions.

This fixes a bug where wallclock time is incorrect for booting 32-bit
HVM guests.

This should be backported to Xen 4.1 and 4.2.

Signed-off-by: Keir Fraser <keir@xen.org>
Tested-and-Reported-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
xen-unstable changeset: 25908:12fa949b9060
xen-unstable date: Fri Sep 14 18:47:57 UTC 2012
---


diff -r 69d1cc78a5bd -r d601e331d615 tools/firmware/hvmloader/xenbus.c
--- a/tools/firmware/hvmloader/xenbus.c	Fri Oct 26 16:10:04 2012 +0100
+++ b/tools/firmware/hvmloader/xenbus.c	Mon Oct 29 08:56:47 2012 +0100
@@ -56,6 +56,8 @@ void xenbus_setup(void)
 /* Reset the xenbus connection so the next kernel can start again. */
 void xenbus_shutdown(void)
 {
+    struct shared_info *shinfo = get_shared_info();
+
     ASSERT(rings != NULL);
 
     /* We zero out the whole ring -- the backend can handle this, and it's 
@@ -64,7 +66,9 @@ void xenbus_shutdown(void)
     memset(rings, 0, sizeof *rings);
 
     /* Clear the event-channel state too. */
-    memset(get_shared_info(), 0, PAGE_SIZE);
+    memset(shinfo->vcpu_info, 0, sizeof(shinfo->vcpu_info));
+    memset(shinfo->evtchn_pending, 0, sizeof(shinfo->evtchn_pending));
+    memset(shinfo->evtchn_mask, 0, sizeof(shinfo->evtchn_mask));
 
     rings = NULL;
 }

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

From xen-changelog-bounces@lists.xen.org Mon Oct 29 23:55:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 29 Oct 2012 23: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 1TSzAq-0002ob-Tt; Mon, 29 Oct 2012 23:55:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAp-0002oI-An
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:15 +0000
Received: from [85.158.138.51:38736] by server-12.bemta-3.messagelabs.com id
	DD/EF-27853-2671F805; Mon, 29 Oct 2012 23:55:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-174.messagelabs.com!1351554912!19876350!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10657 invoked from network); 29 Oct 2012 23:55:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2012 23:55:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAl-0006Nr-Tb
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAl-0000kk-NZ
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:11 +0000
Message-Id: <E1TSzAl-0000kk-NZ@xenbits.xen.org>
Date: Mon, 29 Oct 2012 23:55:11 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] hvmloader: Do not zero the
	wallclock fields in shared-info.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1351497407 -3600
# Node ID d601e331d615e06f08f461e105419c80b2eec20e
# Parent  69d1cc78a5bd066ca84019512c6e3d60c1a3fef4
hvmloader: Do not zero the wallclock fields in shared-info.

These fields need to be valid at all times. Hypervisor ensures this
even across 32/64-bit guest transitions.

This fixes a bug where wallclock time is incorrect for booting 32-bit
HVM guests.

This should be backported to Xen 4.1 and 4.2.

Signed-off-by: Keir Fraser <keir@xen.org>
Tested-and-Reported-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
xen-unstable changeset: 25908:12fa949b9060
xen-unstable date: Fri Sep 14 18:47:57 UTC 2012
---


diff -r 69d1cc78a5bd -r d601e331d615 tools/firmware/hvmloader/xenbus.c
--- a/tools/firmware/hvmloader/xenbus.c	Fri Oct 26 16:10:04 2012 +0100
+++ b/tools/firmware/hvmloader/xenbus.c	Mon Oct 29 08:56:47 2012 +0100
@@ -56,6 +56,8 @@ void xenbus_setup(void)
 /* Reset the xenbus connection so the next kernel can start again. */
 void xenbus_shutdown(void)
 {
+    struct shared_info *shinfo = get_shared_info();
+
     ASSERT(rings != NULL);
 
     /* We zero out the whole ring -- the backend can handle this, and it's 
@@ -64,7 +66,9 @@ void xenbus_shutdown(void)
     memset(rings, 0, sizeof *rings);
 
     /* Clear the event-channel state too. */
-    memset(get_shared_info(), 0, PAGE_SIZE);
+    memset(shinfo->vcpu_info, 0, sizeof(shinfo->vcpu_info));
+    memset(shinfo->evtchn_pending, 0, sizeof(shinfo->evtchn_pending));
+    memset(shinfo->evtchn_mask, 0, sizeof(shinfo->evtchn_mask));
 
     rings = NULL;
 }

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

From xen-changelog-bounces@lists.xen.org Mon Oct 29 23:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 29 Oct 2012 23: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 1TSzAs-0002oz-3O; Mon, 29 Oct 2012 23:55:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAq-0002oP-It
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:16 +0000
Received: from [85.158.143.35:23149] by server-2.bemta-4.messagelabs.com id
	23/92-22268-3671F805; Mon, 29 Oct 2012 23:55:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-21.messagelabs.com!1351554913!12174922!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12659 invoked from network); 29 Oct 2012 23:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2012 23:55:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAm-0006Nu-Qw
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAm-0000kz-AK
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:12 +0000
Message-Id: <E1TSzAm-0000kz-AK@xenbits.xen.org>
Date: Mon, 29 Oct 2012 23:55:11 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/amd: Fix xen_apic_write
	warnings 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

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1351497587 -3600
# Node ID 9cedd98b1835418d0a01e116c96fe6b3fb1660cb
# Parent  d601e331d615e06f08f461e105419c80b2eec20e
x86/amd: Fix xen_apic_write warnings in Dom0

[    0.020294] ------------[ cut here ]------------
[    0.020311] WARNING: at arch/x86/xen/enlighten.c:730
xen_apic_write+0x15/0x17()
[    0.020318] Hardware name: empty
[    0.020323] Modules linked in:
[    0.020334] Pid: 1, comm: swapper/0 Not tainted 3.3.8 #7
[    0.020340] Call Trace:
[    0.020354]  [<ffffffff81050379>] warn_slowpath_common+0x80/0x98
[    0.020369]  [<ffffffff810503a6>] warn_slowpath_null+0x15/0x17
[    0.020378]  [<ffffffff810034df>] xen_apic_write+0x15/0x17
[    0.020392]  [<ffffffff8101cb2b>] perf_events_lapic_init+0x2e/0x30
[    0.020410]  [<ffffffff81ee4dd0>] init_hw_perf_events+0x250/0x407
[    0.020419]  [<ffffffff81ee4b80>] ? check_bugs+0x2d/0x2d
[    0.020430]  [<ffffffff81002181>] do_one_initcall+0x7a/0x131
[    0.020444]  [<ffffffff81edbbf9>] kernel_init+0x91/0x15d
[    0.020456]  [<ffffffff817caaa4>] kernel_thread_helper+0x4/0x10
[    0.020471]  [<ffffffff817c347c>] ? retint_restore_args+0x5/0x6
[    0.020481]  [<ffffffff817caaa0>] ? gs_change+0x13/0x13
[    0.020500] ---[ end trace a7919e7f17c0a725 ]---

Kernel function check_hw_exists() writes 0xabcd to msr 0xc0010201 (Performance Event
Counter 0) and read it again to check if it is running as dom0. Early amd cpus does
not reset perf counters during warm reboot. If the kernel is booted with bare metal
and then as a dom0, the content of msr 0xc0010201 will stay and the checking will
pass and PMU will be enabled unexpectedly.

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

Don't reset the counters when used for the NMI watchdog.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 26054:983108e1b56b
xen-unstable date: Mon Oct 15 13:03:36 UTC 2012
---


diff -r d601e331d615 -r 9cedd98b1835 xen/arch/x86/cpu/amd.c
--- a/xen/arch/x86/cpu/amd.c	Mon Oct 29 08:56:47 2012 +0100
+++ b/xen/arch/x86/cpu/amd.c	Mon Oct 29 08:59:47 2012 +0100
@@ -11,6 +11,7 @@
 #include <asm/hvm/support.h>
 #include <asm/setup.h> /* amd_init_cpu */
 #include <asm/acpi.h>
+#include <asm/apic.h>
 
 #include "cpu.h"
 
@@ -659,6 +660,17 @@ static void __devinit init_amd(struct cp
 	if (c->x86 > 0x11)
 		set_bit(X86_FEATURE_ARAT, c->x86_capability);
 
+	/*
+	 * Prior to Family 0x14, perf counters are not reset during warm reboot.
+	 * We have to reset them manually.
+	 */
+	if (nmi_watchdog != NMI_LOCAL_APIC && c->x86 < 0x14) {
+		wrmsrl(MSR_K7_PERFCTR0, 0);
+		wrmsrl(MSR_K7_PERFCTR1, 0);
+		wrmsrl(MSR_K7_PERFCTR2, 0);
+		wrmsrl(MSR_K7_PERFCTR3, 0);
+	}
+
 	/* Prevent TSC drift in non single-processor, single-core platforms. */
 	if ((smp_processor_id() == 1) && c1_ramping_may_cause_clock_drift(c))
 		disable_c1_ramping();

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

From xen-changelog-bounces@lists.xen.org Mon Oct 29 23:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 29 Oct 2012 23: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 1TSzAs-0002oz-3O; Mon, 29 Oct 2012 23:55:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAq-0002oP-It
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:16 +0000
Received: from [85.158.143.35:23149] by server-2.bemta-4.messagelabs.com id
	23/92-22268-3671F805; Mon, 29 Oct 2012 23:55:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-21.messagelabs.com!1351554913!12174922!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12659 invoked from network); 29 Oct 2012 23:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2012 23:55:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAm-0006Nu-Qw
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAm-0000kz-AK
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:12 +0000
Message-Id: <E1TSzAm-0000kz-AK@xenbits.xen.org>
Date: Mon, 29 Oct 2012 23:55:11 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/amd: Fix xen_apic_write
	warnings 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

# HG changeset patch
# User Wei Wang <wei.wang2@amd.com>
# Date 1351497587 -3600
# Node ID 9cedd98b1835418d0a01e116c96fe6b3fb1660cb
# Parent  d601e331d615e06f08f461e105419c80b2eec20e
x86/amd: Fix xen_apic_write warnings in Dom0

[    0.020294] ------------[ cut here ]------------
[    0.020311] WARNING: at arch/x86/xen/enlighten.c:730
xen_apic_write+0x15/0x17()
[    0.020318] Hardware name: empty
[    0.020323] Modules linked in:
[    0.020334] Pid: 1, comm: swapper/0 Not tainted 3.3.8 #7
[    0.020340] Call Trace:
[    0.020354]  [<ffffffff81050379>] warn_slowpath_common+0x80/0x98
[    0.020369]  [<ffffffff810503a6>] warn_slowpath_null+0x15/0x17
[    0.020378]  [<ffffffff810034df>] xen_apic_write+0x15/0x17
[    0.020392]  [<ffffffff8101cb2b>] perf_events_lapic_init+0x2e/0x30
[    0.020410]  [<ffffffff81ee4dd0>] init_hw_perf_events+0x250/0x407
[    0.020419]  [<ffffffff81ee4b80>] ? check_bugs+0x2d/0x2d
[    0.020430]  [<ffffffff81002181>] do_one_initcall+0x7a/0x131
[    0.020444]  [<ffffffff81edbbf9>] kernel_init+0x91/0x15d
[    0.020456]  [<ffffffff817caaa4>] kernel_thread_helper+0x4/0x10
[    0.020471]  [<ffffffff817c347c>] ? retint_restore_args+0x5/0x6
[    0.020481]  [<ffffffff817caaa0>] ? gs_change+0x13/0x13
[    0.020500] ---[ end trace a7919e7f17c0a725 ]---

Kernel function check_hw_exists() writes 0xabcd to msr 0xc0010201 (Performance Event
Counter 0) and read it again to check if it is running as dom0. Early amd cpus does
not reset perf counters during warm reboot. If the kernel is booted with bare metal
and then as a dom0, the content of msr 0xc0010201 will stay and the checking will
pass and PMU will be enabled unexpectedly.

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

Don't reset the counters when used for the NMI watchdog.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 26054:983108e1b56b
xen-unstable date: Mon Oct 15 13:03:36 UTC 2012
---


diff -r d601e331d615 -r 9cedd98b1835 xen/arch/x86/cpu/amd.c
--- a/xen/arch/x86/cpu/amd.c	Mon Oct 29 08:56:47 2012 +0100
+++ b/xen/arch/x86/cpu/amd.c	Mon Oct 29 08:59:47 2012 +0100
@@ -11,6 +11,7 @@
 #include <asm/hvm/support.h>
 #include <asm/setup.h> /* amd_init_cpu */
 #include <asm/acpi.h>
+#include <asm/apic.h>
 
 #include "cpu.h"
 
@@ -659,6 +660,17 @@ static void __devinit init_amd(struct cp
 	if (c->x86 > 0x11)
 		set_bit(X86_FEATURE_ARAT, c->x86_capability);
 
+	/*
+	 * Prior to Family 0x14, perf counters are not reset during warm reboot.
+	 * We have to reset them manually.
+	 */
+	if (nmi_watchdog != NMI_LOCAL_APIC && c->x86 < 0x14) {
+		wrmsrl(MSR_K7_PERFCTR0, 0);
+		wrmsrl(MSR_K7_PERFCTR1, 0);
+		wrmsrl(MSR_K7_PERFCTR2, 0);
+		wrmsrl(MSR_K7_PERFCTR3, 0);
+	}
+
 	/* Prevent TSC drift in non single-processor, single-core platforms. */
 	if ((smp_processor_id() == 1) && c1_ramping_may_cause_clock_drift(c))
 		disable_c1_ramping();

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

From xen-changelog-bounces@lists.xen.org Mon Oct 29 23:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 29 Oct 2012 23: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 1TSzAs-0002p4-5b; Mon, 29 Oct 2012 23:55:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAq-0002oU-Qr
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:17 +0000
Received: from [85.158.143.99:22661] by server-1.bemta-4.messagelabs.com id
	20/AB-19134-4671F805; Mon, 29 Oct 2012 23:55:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1351554913!27521255!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26440 invoked from network); 29 Oct 2012 23:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2012 23:55:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAn-0006Nx-IL
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAn-0000lH-43
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:13 +0000
Message-Id: <E1TSzAn-0000lH-43@xenbits.xen.org>
Date: Mon, 29 Oct 2012 23:55:12 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/xenoprof: fix kernel/user
	mode detection for HVM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jacob Shin <jacob.shin@amd.com>
# Date 1351497674 -3600
# Node ID de551622e12493ca8747a69d68cd08103411a220
# Parent  9cedd98b1835418d0a01e116c96fe6b3fb1660cb
x86/xenoprof: fix kernel/user mode detection for HVM

While trying oprofile under Xen, I noticed that HVM passive domain's
kernel addresses were showing up as user application. It turns out
under HVM get_cpu_user_regs()->cs contains 0x0000beef.

Signed-off-by: Jacob Shin <jacob.shin@amd.com>

Don't cast away const-ness. Use SS instead of CS to determine ring.
Special-case real and protected mode.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 26055:14e32621dbaf
xen-unstable date: Mon Oct 15 13:04:51 UTC 2012
---


diff -r 9cedd98b1835 -r de551622e124 xen/arch/x86/oprofile/xenoprof.c
--- a/xen/arch/x86/oprofile/xenoprof.c	Mon Oct 29 08:59:47 2012 +0100
+++ b/xen/arch/x86/oprofile/xenoprof.c	Mon Oct 29 09:01:14 2012 +0100
@@ -82,10 +82,21 @@ int xenoprofile_get_mode(struct vcpu *v,
     if ( !guest_mode(regs) )
         return 2;
 
-    if ( is_hvm_vcpu(v) )
-        return ((regs->cs & 3) != 3);
+    if ( !is_hvm_vcpu(v) )
+        return guest_kernel_mode(v, regs);
 
-    return guest_kernel_mode(v, regs);  
+    switch ( hvm_guest_x86_mode(v) )
+    {
+        struct segment_register ss;
+
+    case 0: /* real mode */
+        return 1;
+    case 1: /* vm86 mode */
+        return 0;
+    default:
+        hvm_get_segment_register(v, x86_seg_ss, &ss);
+        return (ss.sel & 3) != 3;
+    }
 }
 
 /*

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

From xen-changelog-bounces@lists.xen.org Mon Oct 29 23:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 29 Oct 2012 23: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 1TSzAs-0002p4-5b; Mon, 29 Oct 2012 23:55:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAq-0002oU-Qr
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:17 +0000
Received: from [85.158.143.99:22661] by server-1.bemta-4.messagelabs.com id
	20/AB-19134-4671F805; Mon, 29 Oct 2012 23:55:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1351554913!27521255!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26440 invoked from network); 29 Oct 2012 23:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2012 23:55:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAn-0006Nx-IL
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAn-0000lH-43
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:13 +0000
Message-Id: <E1TSzAn-0000lH-43@xenbits.xen.org>
Date: Mon, 29 Oct 2012 23:55:12 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/xenoprof: fix kernel/user
	mode detection for HVM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jacob Shin <jacob.shin@amd.com>
# Date 1351497674 -3600
# Node ID de551622e12493ca8747a69d68cd08103411a220
# Parent  9cedd98b1835418d0a01e116c96fe6b3fb1660cb
x86/xenoprof: fix kernel/user mode detection for HVM

While trying oprofile under Xen, I noticed that HVM passive domain's
kernel addresses were showing up as user application. It turns out
under HVM get_cpu_user_regs()->cs contains 0x0000beef.

Signed-off-by: Jacob Shin <jacob.shin@amd.com>

Don't cast away const-ness. Use SS instead of CS to determine ring.
Special-case real and protected mode.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 26055:14e32621dbaf
xen-unstable date: Mon Oct 15 13:04:51 UTC 2012
---


diff -r 9cedd98b1835 -r de551622e124 xen/arch/x86/oprofile/xenoprof.c
--- a/xen/arch/x86/oprofile/xenoprof.c	Mon Oct 29 08:59:47 2012 +0100
+++ b/xen/arch/x86/oprofile/xenoprof.c	Mon Oct 29 09:01:14 2012 +0100
@@ -82,10 +82,21 @@ int xenoprofile_get_mode(struct vcpu *v,
     if ( !guest_mode(regs) )
         return 2;
 
-    if ( is_hvm_vcpu(v) )
-        return ((regs->cs & 3) != 3);
+    if ( !is_hvm_vcpu(v) )
+        return guest_kernel_mode(v, regs);
 
-    return guest_kernel_mode(v, regs);  
+    switch ( hvm_guest_x86_mode(v) )
+    {
+        struct segment_register ss;
+
+    case 0: /* real mode */
+        return 1;
+    case 1: /* vm86 mode */
+        return 0;
+    default:
+        hvm_get_segment_register(v, x86_seg_ss, &ss);
+        return (ss.sel & 3) != 3;
+    }
 }
 
 /*

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

From xen-changelog-bounces@lists.xen.org Mon Oct 29 23:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 29 Oct 2012 23: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 1TSzAt-0002pi-F8; Mon, 29 Oct 2012 23:55:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAs-0002ow-5T
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:18 +0000
Received: from [85.158.139.211:47090] by server-8.bemta-5.messagelabs.com id
	76/CE-23193-5671F805; Mon, 29 Oct 2012 23:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-206.messagelabs.com!1351554914!18055647!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11261 invoked from network); 29 Oct 2012 23:55:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2012 23:55:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAo-0006O3-Ka
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAo-0000lo-BS
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:14 +0000
Message-Id: <E1TSzAo-0000lo-BS@xenbits.xen.org>
Date: Mon, 29 Oct 2012 23:55:13 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/oprof: adjust off-by-one
	counter range checks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1351497753 -3600
# Node ID 2cdf9b7338018f3d4ce8125d01564ff5587c7241
# Parent  a18ca08c475e020da935c2024cebc2d8b97074cb
x86/oprof: adjust off-by-one counter range checks

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 26061:4b4c0c7a6031
xen-unstable date: Wed Oct 17 09:23:10 UTC 2012
---


diff -r a18ca08c475e -r 2cdf9b733801 xen/arch/x86/oprofile/xenoprof.c
--- a/xen/arch/x86/oprofile/xenoprof.c	Mon Oct 29 09:01:52 2012 +0100
+++ b/xen/arch/x86/oprofile/xenoprof.c	Mon Oct 29 09:02:33 2012 +0100
@@ -25,7 +25,7 @@ int xenoprof_arch_counter(XEN_GUEST_HAND
     if ( copy_from_guest(&counter, arg, 1) )
         return -EFAULT;
 
-    if ( counter.ind > OP_MAX_COUNTER )
+    if ( counter.ind >= OP_MAX_COUNTER )
         return -E2BIG;
 
     counter_config[counter.ind].count     = counter.count;
@@ -63,7 +63,7 @@ int compat_oprof_arch_counter(XEN_GUEST_
     if ( copy_from_guest(&counter, arg, 1) )
         return -EFAULT;
 
-    if ( counter.ind > OP_MAX_COUNTER )
+    if ( counter.ind >= OP_MAX_COUNTER )
         return -E2BIG;
 
     counter_config[counter.ind].count     = counter.count;

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

From xen-changelog-bounces@lists.xen.org Mon Oct 29 23:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 29 Oct 2012 23: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 1TSzAr-0002og-08; Mon, 29 Oct 2012 23:55:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAp-0002oK-MW
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:16 +0000
Received: from [85.158.137.99:32866] by server-16.bemta-3.messagelabs.com id
	00/44-07461-2671F805; Mon, 29 Oct 2012 23:55:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-217.messagelabs.com!1351554912!23489878!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11419 invoked from network); 29 Oct 2012 23:55:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2012 23:55:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAl-0006No-KU
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAl-0000kT-1R
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:11 +0000
Message-Id: <E1TSzAl-0000kT-1R@xenbits.xen.org>
Date: Mon, 29 Oct 2012 23:55:10 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] libxc: builder: limit maximum
	size of kernel/ramdisk.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1351264204 -3600
# Node ID 69d1cc78a5bd066ca84019512c6e3d60c1a3fef4
# Parent  a15596a619ed738c163c08d3ec275c8880890c52
libxc: builder: limit maximum size of kernel/ramdisk.

Allowing user supplied kernels of arbitrary sizes, especially during
decompression, can swallow up dom0 memory leading to either virtual
address space exhaustion in the builder process or allocation
failures/OOM killing of both toolstack and unrelated processes.

We disable these checks when building in a stub domain for pvgrub
since this uses the guest's own memory and is isolated.

Decompression of gzip compressed kernels and ramdisks has been safe
since 14954:58205257517d (Xen 3.1.0 onwards).

This is XSA-25 / CVE-2012-4544.

Also make explicit checks for buffer overflows in various
decompression routines. These were already ruled out due to other
properties of the code but check them as a belt-and-braces measure.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
[ Includes 25589:60f09d1ab1fe for CVE-2012-2625 ]
---


diff -r a15596a619ed -r 69d1cc78a5bd stubdom/grub/kexec.c
--- a/stubdom/grub/kexec.c	Thu Oct 04 10:44:43 2012 +0200
+++ b/stubdom/grub/kexec.c	Fri Oct 26 16:10:04 2012 +0100
@@ -137,6 +137,10 @@ void kexec(void *kernel, long kernel_siz
     dom = xc_dom_allocate(xc_handle, cmdline, features);
     dom->allocate = kexec_allocate;
 
+    /* We are using guest owned memory, therefore no limits. */
+    xc_dom_kernel_max_size(dom, 0);
+    xc_dom_ramdisk_max_size(dom, 0);
+
     dom->kernel_blob = kernel;
     dom->kernel_size = kernel_size;
 
diff -r a15596a619ed -r 69d1cc78a5bd tools/libxc/xc_dom.h
--- a/tools/libxc/xc_dom.h	Thu Oct 04 10:44:43 2012 +0200
+++ b/tools/libxc/xc_dom.h	Fri Oct 26 16:10:04 2012 +0100
@@ -52,6 +52,9 @@ struct xc_dom_image {
     void *ramdisk_blob;
     size_t ramdisk_size;
 
+    size_t max_kernel_size;
+    size_t max_ramdisk_size;
+
     /* arguments and parameters */
     char *cmdline;
     uint32_t f_requested[XENFEAT_NR_SUBMAPS];
@@ -175,6 +178,23 @@ void xc_dom_release_phys(struct xc_dom_i
 void xc_dom_release(struct xc_dom_image *dom);
 int xc_dom_mem_init(struct xc_dom_image *dom, unsigned int mem_mb);
 
+/* Set this larger if you have enormous ramdisks/kernels. Note that
+ * you should trust all kernels not to be maliciously large (e.g. to
+ * exhaust all dom0 memory) if you do this (see CVE-2012-4544 /
+ * XSA-25). You can also set the default independently for
+ * ramdisks/kernels in xc_dom_allocate() or call
+ * xc_dom_{kernel,ramdisk}_max_size.
+ */
+#ifndef XC_DOM_DECOMPRESS_MAX
+#define XC_DOM_DECOMPRESS_MAX (1024*1024*1024) /* 1GB */
+#endif
+
+int xc_dom_kernel_check_size(struct xc_dom_image *dom, size_t sz);
+int xc_dom_kernel_max_size(struct xc_dom_image *dom, size_t sz);
+
+int xc_dom_ramdisk_check_size(struct xc_dom_image *dom, size_t sz);
+int xc_dom_ramdisk_max_size(struct xc_dom_image *dom, size_t sz);
+
 size_t xc_dom_check_gzip(xc_interface *xch,
                      void *blob, size_t ziplen);
 int xc_dom_do_gunzip(xc_interface *xch,
@@ -224,7 +244,8 @@ void xc_dom_log_memory_footprint(struct 
 void *xc_dom_malloc(struct xc_dom_image *dom, size_t size);
 void *xc_dom_malloc_page_aligned(struct xc_dom_image *dom, size_t size);
 void *xc_dom_malloc_filemap(struct xc_dom_image *dom,
-                            const char *filename, size_t * size);
+                            const char *filename, size_t * size,
+                            const size_t max_size);
 char *xc_dom_strdup(struct xc_dom_image *dom, const char *str);
 
 /* --- alloc memory pool ------------------------------------------- */
diff -r a15596a619ed -r 69d1cc78a5bd tools/libxc/xc_dom_bzimageloader.c
--- a/tools/libxc/xc_dom_bzimageloader.c	Thu Oct 04 10:44:43 2012 +0200
+++ b/tools/libxc/xc_dom_bzimageloader.c	Fri Oct 26 16:10:04 2012 +0100
@@ -47,13 +47,19 @@ static int xc_try_bzip2_decode(
     char *out_buf;
     char *tmp_buf;
     int retval = -1;
-    int outsize;
+    unsigned int outsize;
     uint64_t total;
 
     stream.bzalloc = NULL;
     stream.bzfree = NULL;
     stream.opaque = NULL;
 
+    if ( dom->kernel_size == 0)
+    {
+        DOMPRINTF("BZIP2: Input is 0 size");
+        return -1;
+    }
+
     ret = BZ2_bzDecompressInit(&stream, 0, 0);
     if ( ret != BZ_OK )
     {
@@ -66,6 +72,17 @@ static int xc_try_bzip2_decode(
      * the input buffer to start, and we'll realloc as needed.
      */
     outsize = dom->kernel_size;
+
+    /*
+     * stream.avail_in and outsize are unsigned int, while kernel_size
+     * is a size_t. Check we aren't overflowing.
+     */
+    if ( outsize != dom->kernel_size )
+    {
+        DOMPRINTF("BZIP2: Input too large");
+        goto bzip2_cleanup;
+    }
+
     out_buf = malloc(outsize);
     if ( out_buf == NULL )
     {
@@ -98,13 +115,20 @@ static int xc_try_bzip2_decode(
         if ( stream.avail_out == 0 )
         {
             /* Protect against output buffer overflow */
-            if ( outsize > INT_MAX / 2 )
+            if ( outsize > UINT_MAX / 2 )
             {
                 DOMPRINTF("BZIP2: output buffer overflow");
                 free(out_buf);
                 goto bzip2_cleanup;
             }
 
+            if ( xc_dom_kernel_check_size(dom, outsize * 2) )
+            {
+                DOMPRINTF("BZIP2: output too large");
+                free(out_buf);
+                goto bzip2_cleanup;
+            }
+
             tmp_buf = realloc(out_buf, outsize * 2);
             if ( tmp_buf == NULL )
             {
@@ -172,9 +196,15 @@ static int xc_try_lzma_decode(
     unsigned char *out_buf;
     unsigned char *tmp_buf;
     int retval = -1;
-    int outsize;
+    size_t outsize;
     const char *msg;
 
+    if ( dom->kernel_size == 0)
+    {
+        DOMPRINTF("LZMA: Input is 0 size");
+        return -1;
+    }
+
     ret = lzma_alone_decoder(&stream, 128*1024*1024);
     if ( ret != LZMA_OK )
     {
@@ -251,13 +281,20 @@ static int xc_try_lzma_decode(
         if ( stream.avail_out == 0 )
         {
             /* Protect against output buffer overflow */
-            if ( outsize > INT_MAX / 2 )
+            if ( outsize > SIZE_MAX / 2 )
             {
                 DOMPRINTF("LZMA: output buffer overflow");
                 free(out_buf);
                 goto lzma_cleanup;
             }
 
+            if ( xc_dom_kernel_check_size(dom, outsize * 2) )
+            {
+                DOMPRINTF("LZMA: output too large");
+                free(out_buf);
+                goto lzma_cleanup;
+            }
+
             tmp_buf = realloc(out_buf, outsize * 2);
             if ( tmp_buf == NULL )
             {
@@ -327,6 +364,12 @@ static int xc_try_lzo1x_decode(
         0x89, 0x4c, 0x5a, 0x4f, 0x00, 0x0d, 0x0a, 0x1a, 0x0a
     };
 
+    /*
+     * lzo_uint should match size_t. Check that this is the case to be
+     * sure we won't overflow various lzo_uint fields.
+     */
+    XC_BUILD_BUG_ON(sizeof(lzo_uint) != sizeof(size_t));
+
     ret = lzo_init();
     if ( ret != LZO_E_OK )
     {
@@ -406,6 +449,14 @@ static int xc_try_lzo1x_decode(
         if ( src_len <= 0 || src_len > dst_len || src_len > left )
             break;
 
+        msg = "Output buffer overflow";
+        if ( *size > SIZE_MAX - dst_len )
+            break;
+
+        msg = "Decompressed image too large";
+        if ( xc_dom_kernel_check_size(dom, *size + dst_len) )
+            break;
+
         msg = "Failed to (re)alloc memory";
         tmp_buf = realloc(out_buf, *size + dst_len);
         if ( tmp_buf == NULL )
diff -r a15596a619ed -r 69d1cc78a5bd tools/libxc/xc_dom_core.c
--- a/tools/libxc/xc_dom_core.c	Thu Oct 04 10:44:43 2012 +0200
+++ b/tools/libxc/xc_dom_core.c	Fri Oct 26 16:10:04 2012 +0100
@@ -159,7 +159,8 @@ void *xc_dom_malloc_page_aligned(struct 
 }
 
 void *xc_dom_malloc_filemap(struct xc_dom_image *dom,
-                            const char *filename, size_t * size)
+                            const char *filename, size_t * size,
+                            const size_t max_size)
 {
     struct xc_dom_mem *block = NULL;
     int fd = -1;
@@ -171,6 +172,13 @@ void *xc_dom_malloc_filemap(struct xc_do
     lseek(fd, 0, SEEK_SET);
     *size = lseek(fd, 0, SEEK_END);
 
+    if ( max_size && *size > max_size )
+    {
+        xc_dom_panic(dom->xch, XC_OUT_OF_MEMORY,
+                     "tried to map file which is too large");
+        goto err;
+    }
+
     block = malloc(sizeof(*block));
     if ( block == NULL )
         goto err;
@@ -222,6 +230,40 @@ char *xc_dom_strdup(struct xc_dom_image 
 }
 
 /* ------------------------------------------------------------------------ */
+/* decompression buffer sizing                                              */
+int xc_dom_kernel_check_size(struct xc_dom_image *dom, size_t sz)
+{
+    /* No limit */
+    if ( !dom->max_kernel_size )
+        return 0;
+
+    if ( sz > dom->max_kernel_size )
+    {
+        xc_dom_panic(dom->xch, XC_INVALID_KERNEL,
+                     "kernel image too large");
+        return 1;
+    }
+
+    return 0;
+}
+
+int xc_dom_ramdisk_check_size(struct xc_dom_image *dom, size_t sz)
+{
+    /* No limit */
+    if ( !dom->max_ramdisk_size )
+        return 0;
+
+    if ( sz > dom->max_ramdisk_size )
+    {
+        xc_dom_panic(dom->xch, XC_INVALID_KERNEL,
+                     "ramdisk image too large");
+        return 1;
+    }
+
+    return 0;
+}
+
+/* ------------------------------------------------------------------------ */
 /* read files, copy memory blocks, with transparent gunzip                  */
 
 size_t xc_dom_check_gzip(xc_interface *xch, void *blob, size_t ziplen)
@@ -235,7 +277,7 @@ size_t xc_dom_check_gzip(xc_interface *x
 
     gzlen = blob + ziplen - 4;
     unziplen = gzlen[3] << 24 | gzlen[2] << 16 | gzlen[1] << 8 | gzlen[0];
-    if ( (unziplen < 0) || (unziplen > (1024*1024*1024)) ) /* 1GB limit */
+    if ( (unziplen < 0) || (unziplen > XC_DOM_DECOMPRESS_MAX) )
     {
         xc_dom_printf
             (xch,
@@ -288,6 +330,9 @@ int xc_dom_try_gunzip(struct xc_dom_imag
     if ( unziplen == 0 )
         return 0;
 
+    if ( xc_dom_kernel_check_size(dom, unziplen) )
+        return 0;
+
     unzip = xc_dom_malloc(dom, unziplen);
     if ( unzip == NULL )
         return -1;
@@ -588,6 +633,9 @@ struct xc_dom_image *xc_dom_allocate(xc_
     memset(dom, 0, sizeof(*dom));
     dom->xch = xch;
 
+    dom->max_kernel_size = XC_DOM_DECOMPRESS_MAX;
+    dom->max_ramdisk_size = XC_DOM_DECOMPRESS_MAX;
+
     if ( cmdline )
         dom->cmdline = xc_dom_strdup(dom, cmdline);
     if ( features )
@@ -608,10 +656,25 @@ struct xc_dom_image *xc_dom_allocate(xc_
     return NULL;
 }
 
+int xc_dom_kernel_max_size(struct xc_dom_image *dom, size_t sz)
+{
+    DOMPRINTF("%s: kernel_max_size=%zx", __FUNCTION__, sz);
+    dom->max_kernel_size = sz;
+    return 0;
+}
+
+int xc_dom_ramdisk_max_size(struct xc_dom_image *dom, size_t sz)
+{
+    DOMPRINTF("%s: ramdisk_max_size=%zx", __FUNCTION__, sz);
+    dom->max_ramdisk_size = sz;
+    return 0;
+}
+
 int xc_dom_kernel_file(struct xc_dom_image *dom, const char *filename)
 {
     DOMPRINTF("%s: filename=\"%s\"", __FUNCTION__, filename);
-    dom->kernel_blob = xc_dom_malloc_filemap(dom, filename, &dom->kernel_size);
+    dom->kernel_blob = xc_dom_malloc_filemap(dom, filename, &dom->kernel_size,
+                                             dom->max_kernel_size);
     if ( dom->kernel_blob == NULL )
         return -1;
     return xc_dom_try_gunzip(dom, &dom->kernel_blob, &dom->kernel_size);
@@ -621,7 +684,9 @@ int xc_dom_ramdisk_file(struct xc_dom_im
 {
     DOMPRINTF("%s: filename=\"%s\"", __FUNCTION__, filename);
     dom->ramdisk_blob =
-        xc_dom_malloc_filemap(dom, filename, &dom->ramdisk_size);
+        xc_dom_malloc_filemap(dom, filename, &dom->ramdisk_size,
+                              dom->max_ramdisk_size);
+
     if ( dom->ramdisk_blob == NULL )
         return -1;
 //    return xc_dom_try_gunzip(dom, &dom->ramdisk_blob, &dom->ramdisk_size);
@@ -781,7 +846,11 @@ int xc_dom_build_image(struct xc_dom_ima
         void *ramdiskmap;
 
         unziplen = xc_dom_check_gzip(dom->xch, dom->ramdisk_blob, dom->ramdisk_size);
+        if ( xc_dom_ramdisk_check_size(dom, unziplen) != 0 )
+            unziplen = 0;
+
         ramdisklen = unziplen ? unziplen : dom->ramdisk_size;
+
         if ( xc_dom_alloc_segment(dom, &dom->ramdisk_seg, "ramdisk", 0,
                                   ramdisklen) != 0 )
             goto err;
diff -r a15596a619ed -r 69d1cc78a5bd tools/pygrub/src/pygrub
--- a/tools/pygrub/src/pygrub	Thu Oct 04 10:44:43 2012 +0200
+++ b/tools/pygrub/src/pygrub	Fri Oct 26 16:10:04 2012 +0100
@@ -28,6 +28,7 @@ import grub.LiloConf
 import grub.ExtLinuxConf
 
 PYGRUB_VER = 0.6
+FS_READ_MAX = 1024 * 1024
 
 def enable_cursor(ison):
     if ison:
@@ -421,7 +422,8 @@ class Grub:
         if self.__dict__.get('cf', None) is None:
             raise RuntimeError, "couldn't find bootloader config file in the image provided."
         f = fs.open_file(self.cf.filename)
-        buf = f.read()
+        # limit read size to avoid pathological cases
+        buf = f.read(FS_READ_MAX)
         del f
         self.cf.parse(buf)
 
@@ -670,6 +672,37 @@ if __name__ == "__main__":
     def usage():
         print >> sys.stderr, "Usage: %s [-q|--quiet] [-i|--interactive] [-n|--not-really] [--output=] [--kernel=] [--ramdisk=] [--args=] [--entry=] [--output-directory=] [--output-format=sxp|simple|simple0] <image>" %(sys.argv[0],)
 
+    def copy_from_image(fs, file_to_read, file_type, output_directory,
+                        not_really):
+        if not_really:
+            if fs.file_exists(file_to_read):
+                return "<%s:%s>" % (file_type, file_to_read)
+            else:
+                sys.exit("The requested %s file does not exist" % file_type)
+        try:
+            datafile = fs.open_file(file_to_read)
+        except Exception, e:
+            print >>sys.stderr, e
+            sys.exit("Error opening %s in guest" % file_to_read)
+        (tfd, ret) = tempfile.mkstemp(prefix="boot_"+file_type+".",
+                                      dir=output_directory)
+        dataoff = 0
+        while True:
+            data = datafile.read(FS_READ_MAX, dataoff)
+            if len(data) == 0:
+                os.close(tfd)
+                del datafile
+                return ret
+            try:
+                os.write(tfd, data)
+            except Exception, e:
+                print >>sys.stderr, e
+                os.close(tfd)
+                os.unlink(ret)
+                del datafile
+                sys.exit("Error writing temporary copy of "+file_type)
+            dataoff += len(data)
+
     try:
         opts, args = getopt.gnu_getopt(sys.argv[1:], 'qinh::',
                                    ["quiet", "interactive", "not-really", "help", 
@@ -786,24 +819,18 @@ if __name__ == "__main__":
     if not fs:
         raise RuntimeError, "Unable to find partition containing kernel"
 
-    if not_really:
-        bootcfg["kernel"] = "<kernel:%s>" % chosencfg["kernel"]
-    else:
-        data = fs.open_file(chosencfg["kernel"]).read()
-        (tfd, bootcfg["kernel"]) = tempfile.mkstemp(prefix="boot_kernel.",
-                                                    dir=output_directory)
-        os.write(tfd, data)
-        os.close(tfd)
+    bootcfg["kernel"] = copy_from_image(fs, chosencfg["kernel"], "kernel",
+                                        output_directory, not_really)
 
     if chosencfg["ramdisk"]:
-        if not_really:
-            bootcfg["ramdisk"] = "<ramdisk:%s>" % chosencfg["ramdisk"]
-        else:
-            data = fs.open_file(chosencfg["ramdisk"],).read()
-            (tfd, bootcfg["ramdisk"]) = tempfile.mkstemp(
-                prefix="boot_ramdisk.", dir=output_directory)
-            os.write(tfd, data)
-            os.close(tfd)
+        try:
+            bootcfg["ramdisk"] = copy_from_image(fs, chosencfg["ramdisk"],
+                                                 "ramdisk", output_directory,
+                                                 not_really)
+        except:
+            if not not_really:
+                os.unlink(bootcfg["kernel"])
+            raise
     else:
         initrd = None
 

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

From xen-changelog-bounces@lists.xen.org Mon Oct 29 23:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 29 Oct 2012 23: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 1TSzAr-0002og-08; Mon, 29 Oct 2012 23:55:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAp-0002oK-MW
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:16 +0000
Received: from [85.158.137.99:32866] by server-16.bemta-3.messagelabs.com id
	00/44-07461-2671F805; Mon, 29 Oct 2012 23:55:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-217.messagelabs.com!1351554912!23489878!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11419 invoked from network); 29 Oct 2012 23:55:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2012 23:55:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAl-0006No-KU
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAl-0000kT-1R
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:11 +0000
Message-Id: <E1TSzAl-0000kT-1R@xenbits.xen.org>
Date: Mon, 29 Oct 2012 23:55:10 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] libxc: builder: limit maximum
	size of kernel/ramdisk.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1351264204 -3600
# Node ID 69d1cc78a5bd066ca84019512c6e3d60c1a3fef4
# Parent  a15596a619ed738c163c08d3ec275c8880890c52
libxc: builder: limit maximum size of kernel/ramdisk.

Allowing user supplied kernels of arbitrary sizes, especially during
decompression, can swallow up dom0 memory leading to either virtual
address space exhaustion in the builder process or allocation
failures/OOM killing of both toolstack and unrelated processes.

We disable these checks when building in a stub domain for pvgrub
since this uses the guest's own memory and is isolated.

Decompression of gzip compressed kernels and ramdisks has been safe
since 14954:58205257517d (Xen 3.1.0 onwards).

This is XSA-25 / CVE-2012-4544.

Also make explicit checks for buffer overflows in various
decompression routines. These were already ruled out due to other
properties of the code but check them as a belt-and-braces measure.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
[ Includes 25589:60f09d1ab1fe for CVE-2012-2625 ]
---


diff -r a15596a619ed -r 69d1cc78a5bd stubdom/grub/kexec.c
--- a/stubdom/grub/kexec.c	Thu Oct 04 10:44:43 2012 +0200
+++ b/stubdom/grub/kexec.c	Fri Oct 26 16:10:04 2012 +0100
@@ -137,6 +137,10 @@ void kexec(void *kernel, long kernel_siz
     dom = xc_dom_allocate(xc_handle, cmdline, features);
     dom->allocate = kexec_allocate;
 
+    /* We are using guest owned memory, therefore no limits. */
+    xc_dom_kernel_max_size(dom, 0);
+    xc_dom_ramdisk_max_size(dom, 0);
+
     dom->kernel_blob = kernel;
     dom->kernel_size = kernel_size;
 
diff -r a15596a619ed -r 69d1cc78a5bd tools/libxc/xc_dom.h
--- a/tools/libxc/xc_dom.h	Thu Oct 04 10:44:43 2012 +0200
+++ b/tools/libxc/xc_dom.h	Fri Oct 26 16:10:04 2012 +0100
@@ -52,6 +52,9 @@ struct xc_dom_image {
     void *ramdisk_blob;
     size_t ramdisk_size;
 
+    size_t max_kernel_size;
+    size_t max_ramdisk_size;
+
     /* arguments and parameters */
     char *cmdline;
     uint32_t f_requested[XENFEAT_NR_SUBMAPS];
@@ -175,6 +178,23 @@ void xc_dom_release_phys(struct xc_dom_i
 void xc_dom_release(struct xc_dom_image *dom);
 int xc_dom_mem_init(struct xc_dom_image *dom, unsigned int mem_mb);
 
+/* Set this larger if you have enormous ramdisks/kernels. Note that
+ * you should trust all kernels not to be maliciously large (e.g. to
+ * exhaust all dom0 memory) if you do this (see CVE-2012-4544 /
+ * XSA-25). You can also set the default independently for
+ * ramdisks/kernels in xc_dom_allocate() or call
+ * xc_dom_{kernel,ramdisk}_max_size.
+ */
+#ifndef XC_DOM_DECOMPRESS_MAX
+#define XC_DOM_DECOMPRESS_MAX (1024*1024*1024) /* 1GB */
+#endif
+
+int xc_dom_kernel_check_size(struct xc_dom_image *dom, size_t sz);
+int xc_dom_kernel_max_size(struct xc_dom_image *dom, size_t sz);
+
+int xc_dom_ramdisk_check_size(struct xc_dom_image *dom, size_t sz);
+int xc_dom_ramdisk_max_size(struct xc_dom_image *dom, size_t sz);
+
 size_t xc_dom_check_gzip(xc_interface *xch,
                      void *blob, size_t ziplen);
 int xc_dom_do_gunzip(xc_interface *xch,
@@ -224,7 +244,8 @@ void xc_dom_log_memory_footprint(struct 
 void *xc_dom_malloc(struct xc_dom_image *dom, size_t size);
 void *xc_dom_malloc_page_aligned(struct xc_dom_image *dom, size_t size);
 void *xc_dom_malloc_filemap(struct xc_dom_image *dom,
-                            const char *filename, size_t * size);
+                            const char *filename, size_t * size,
+                            const size_t max_size);
 char *xc_dom_strdup(struct xc_dom_image *dom, const char *str);
 
 /* --- alloc memory pool ------------------------------------------- */
diff -r a15596a619ed -r 69d1cc78a5bd tools/libxc/xc_dom_bzimageloader.c
--- a/tools/libxc/xc_dom_bzimageloader.c	Thu Oct 04 10:44:43 2012 +0200
+++ b/tools/libxc/xc_dom_bzimageloader.c	Fri Oct 26 16:10:04 2012 +0100
@@ -47,13 +47,19 @@ static int xc_try_bzip2_decode(
     char *out_buf;
     char *tmp_buf;
     int retval = -1;
-    int outsize;
+    unsigned int outsize;
     uint64_t total;
 
     stream.bzalloc = NULL;
     stream.bzfree = NULL;
     stream.opaque = NULL;
 
+    if ( dom->kernel_size == 0)
+    {
+        DOMPRINTF("BZIP2: Input is 0 size");
+        return -1;
+    }
+
     ret = BZ2_bzDecompressInit(&stream, 0, 0);
     if ( ret != BZ_OK )
     {
@@ -66,6 +72,17 @@ static int xc_try_bzip2_decode(
      * the input buffer to start, and we'll realloc as needed.
      */
     outsize = dom->kernel_size;
+
+    /*
+     * stream.avail_in and outsize are unsigned int, while kernel_size
+     * is a size_t. Check we aren't overflowing.
+     */
+    if ( outsize != dom->kernel_size )
+    {
+        DOMPRINTF("BZIP2: Input too large");
+        goto bzip2_cleanup;
+    }
+
     out_buf = malloc(outsize);
     if ( out_buf == NULL )
     {
@@ -98,13 +115,20 @@ static int xc_try_bzip2_decode(
         if ( stream.avail_out == 0 )
         {
             /* Protect against output buffer overflow */
-            if ( outsize > INT_MAX / 2 )
+            if ( outsize > UINT_MAX / 2 )
             {
                 DOMPRINTF("BZIP2: output buffer overflow");
                 free(out_buf);
                 goto bzip2_cleanup;
             }
 
+            if ( xc_dom_kernel_check_size(dom, outsize * 2) )
+            {
+                DOMPRINTF("BZIP2: output too large");
+                free(out_buf);
+                goto bzip2_cleanup;
+            }
+
             tmp_buf = realloc(out_buf, outsize * 2);
             if ( tmp_buf == NULL )
             {
@@ -172,9 +196,15 @@ static int xc_try_lzma_decode(
     unsigned char *out_buf;
     unsigned char *tmp_buf;
     int retval = -1;
-    int outsize;
+    size_t outsize;
     const char *msg;
 
+    if ( dom->kernel_size == 0)
+    {
+        DOMPRINTF("LZMA: Input is 0 size");
+        return -1;
+    }
+
     ret = lzma_alone_decoder(&stream, 128*1024*1024);
     if ( ret != LZMA_OK )
     {
@@ -251,13 +281,20 @@ static int xc_try_lzma_decode(
         if ( stream.avail_out == 0 )
         {
             /* Protect against output buffer overflow */
-            if ( outsize > INT_MAX / 2 )
+            if ( outsize > SIZE_MAX / 2 )
             {
                 DOMPRINTF("LZMA: output buffer overflow");
                 free(out_buf);
                 goto lzma_cleanup;
             }
 
+            if ( xc_dom_kernel_check_size(dom, outsize * 2) )
+            {
+                DOMPRINTF("LZMA: output too large");
+                free(out_buf);
+                goto lzma_cleanup;
+            }
+
             tmp_buf = realloc(out_buf, outsize * 2);
             if ( tmp_buf == NULL )
             {
@@ -327,6 +364,12 @@ static int xc_try_lzo1x_decode(
         0x89, 0x4c, 0x5a, 0x4f, 0x00, 0x0d, 0x0a, 0x1a, 0x0a
     };
 
+    /*
+     * lzo_uint should match size_t. Check that this is the case to be
+     * sure we won't overflow various lzo_uint fields.
+     */
+    XC_BUILD_BUG_ON(sizeof(lzo_uint) != sizeof(size_t));
+
     ret = lzo_init();
     if ( ret != LZO_E_OK )
     {
@@ -406,6 +449,14 @@ static int xc_try_lzo1x_decode(
         if ( src_len <= 0 || src_len > dst_len || src_len > left )
             break;
 
+        msg = "Output buffer overflow";
+        if ( *size > SIZE_MAX - dst_len )
+            break;
+
+        msg = "Decompressed image too large";
+        if ( xc_dom_kernel_check_size(dom, *size + dst_len) )
+            break;
+
         msg = "Failed to (re)alloc memory";
         tmp_buf = realloc(out_buf, *size + dst_len);
         if ( tmp_buf == NULL )
diff -r a15596a619ed -r 69d1cc78a5bd tools/libxc/xc_dom_core.c
--- a/tools/libxc/xc_dom_core.c	Thu Oct 04 10:44:43 2012 +0200
+++ b/tools/libxc/xc_dom_core.c	Fri Oct 26 16:10:04 2012 +0100
@@ -159,7 +159,8 @@ void *xc_dom_malloc_page_aligned(struct 
 }
 
 void *xc_dom_malloc_filemap(struct xc_dom_image *dom,
-                            const char *filename, size_t * size)
+                            const char *filename, size_t * size,
+                            const size_t max_size)
 {
     struct xc_dom_mem *block = NULL;
     int fd = -1;
@@ -171,6 +172,13 @@ void *xc_dom_malloc_filemap(struct xc_do
     lseek(fd, 0, SEEK_SET);
     *size = lseek(fd, 0, SEEK_END);
 
+    if ( max_size && *size > max_size )
+    {
+        xc_dom_panic(dom->xch, XC_OUT_OF_MEMORY,
+                     "tried to map file which is too large");
+        goto err;
+    }
+
     block = malloc(sizeof(*block));
     if ( block == NULL )
         goto err;
@@ -222,6 +230,40 @@ char *xc_dom_strdup(struct xc_dom_image 
 }
 
 /* ------------------------------------------------------------------------ */
+/* decompression buffer sizing                                              */
+int xc_dom_kernel_check_size(struct xc_dom_image *dom, size_t sz)
+{
+    /* No limit */
+    if ( !dom->max_kernel_size )
+        return 0;
+
+    if ( sz > dom->max_kernel_size )
+    {
+        xc_dom_panic(dom->xch, XC_INVALID_KERNEL,
+                     "kernel image too large");
+        return 1;
+    }
+
+    return 0;
+}
+
+int xc_dom_ramdisk_check_size(struct xc_dom_image *dom, size_t sz)
+{
+    /* No limit */
+    if ( !dom->max_ramdisk_size )
+        return 0;
+
+    if ( sz > dom->max_ramdisk_size )
+    {
+        xc_dom_panic(dom->xch, XC_INVALID_KERNEL,
+                     "ramdisk image too large");
+        return 1;
+    }
+
+    return 0;
+}
+
+/* ------------------------------------------------------------------------ */
 /* read files, copy memory blocks, with transparent gunzip                  */
 
 size_t xc_dom_check_gzip(xc_interface *xch, void *blob, size_t ziplen)
@@ -235,7 +277,7 @@ size_t xc_dom_check_gzip(xc_interface *x
 
     gzlen = blob + ziplen - 4;
     unziplen = gzlen[3] << 24 | gzlen[2] << 16 | gzlen[1] << 8 | gzlen[0];
-    if ( (unziplen < 0) || (unziplen > (1024*1024*1024)) ) /* 1GB limit */
+    if ( (unziplen < 0) || (unziplen > XC_DOM_DECOMPRESS_MAX) )
     {
         xc_dom_printf
             (xch,
@@ -288,6 +330,9 @@ int xc_dom_try_gunzip(struct xc_dom_imag
     if ( unziplen == 0 )
         return 0;
 
+    if ( xc_dom_kernel_check_size(dom, unziplen) )
+        return 0;
+
     unzip = xc_dom_malloc(dom, unziplen);
     if ( unzip == NULL )
         return -1;
@@ -588,6 +633,9 @@ struct xc_dom_image *xc_dom_allocate(xc_
     memset(dom, 0, sizeof(*dom));
     dom->xch = xch;
 
+    dom->max_kernel_size = XC_DOM_DECOMPRESS_MAX;
+    dom->max_ramdisk_size = XC_DOM_DECOMPRESS_MAX;
+
     if ( cmdline )
         dom->cmdline = xc_dom_strdup(dom, cmdline);
     if ( features )
@@ -608,10 +656,25 @@ struct xc_dom_image *xc_dom_allocate(xc_
     return NULL;
 }
 
+int xc_dom_kernel_max_size(struct xc_dom_image *dom, size_t sz)
+{
+    DOMPRINTF("%s: kernel_max_size=%zx", __FUNCTION__, sz);
+    dom->max_kernel_size = sz;
+    return 0;
+}
+
+int xc_dom_ramdisk_max_size(struct xc_dom_image *dom, size_t sz)
+{
+    DOMPRINTF("%s: ramdisk_max_size=%zx", __FUNCTION__, sz);
+    dom->max_ramdisk_size = sz;
+    return 0;
+}
+
 int xc_dom_kernel_file(struct xc_dom_image *dom, const char *filename)
 {
     DOMPRINTF("%s: filename=\"%s\"", __FUNCTION__, filename);
-    dom->kernel_blob = xc_dom_malloc_filemap(dom, filename, &dom->kernel_size);
+    dom->kernel_blob = xc_dom_malloc_filemap(dom, filename, &dom->kernel_size,
+                                             dom->max_kernel_size);
     if ( dom->kernel_blob == NULL )
         return -1;
     return xc_dom_try_gunzip(dom, &dom->kernel_blob, &dom->kernel_size);
@@ -621,7 +684,9 @@ int xc_dom_ramdisk_file(struct xc_dom_im
 {
     DOMPRINTF("%s: filename=\"%s\"", __FUNCTION__, filename);
     dom->ramdisk_blob =
-        xc_dom_malloc_filemap(dom, filename, &dom->ramdisk_size);
+        xc_dom_malloc_filemap(dom, filename, &dom->ramdisk_size,
+                              dom->max_ramdisk_size);
+
     if ( dom->ramdisk_blob == NULL )
         return -1;
 //    return xc_dom_try_gunzip(dom, &dom->ramdisk_blob, &dom->ramdisk_size);
@@ -781,7 +846,11 @@ int xc_dom_build_image(struct xc_dom_ima
         void *ramdiskmap;
 
         unziplen = xc_dom_check_gzip(dom->xch, dom->ramdisk_blob, dom->ramdisk_size);
+        if ( xc_dom_ramdisk_check_size(dom, unziplen) != 0 )
+            unziplen = 0;
+
         ramdisklen = unziplen ? unziplen : dom->ramdisk_size;
+
         if ( xc_dom_alloc_segment(dom, &dom->ramdisk_seg, "ramdisk", 0,
                                   ramdisklen) != 0 )
             goto err;
diff -r a15596a619ed -r 69d1cc78a5bd tools/pygrub/src/pygrub
--- a/tools/pygrub/src/pygrub	Thu Oct 04 10:44:43 2012 +0200
+++ b/tools/pygrub/src/pygrub	Fri Oct 26 16:10:04 2012 +0100
@@ -28,6 +28,7 @@ import grub.LiloConf
 import grub.ExtLinuxConf
 
 PYGRUB_VER = 0.6
+FS_READ_MAX = 1024 * 1024
 
 def enable_cursor(ison):
     if ison:
@@ -421,7 +422,8 @@ class Grub:
         if self.__dict__.get('cf', None) is None:
             raise RuntimeError, "couldn't find bootloader config file in the image provided."
         f = fs.open_file(self.cf.filename)
-        buf = f.read()
+        # limit read size to avoid pathological cases
+        buf = f.read(FS_READ_MAX)
         del f
         self.cf.parse(buf)
 
@@ -670,6 +672,37 @@ if __name__ == "__main__":
     def usage():
         print >> sys.stderr, "Usage: %s [-q|--quiet] [-i|--interactive] [-n|--not-really] [--output=] [--kernel=] [--ramdisk=] [--args=] [--entry=] [--output-directory=] [--output-format=sxp|simple|simple0] <image>" %(sys.argv[0],)
 
+    def copy_from_image(fs, file_to_read, file_type, output_directory,
+                        not_really):
+        if not_really:
+            if fs.file_exists(file_to_read):
+                return "<%s:%s>" % (file_type, file_to_read)
+            else:
+                sys.exit("The requested %s file does not exist" % file_type)
+        try:
+            datafile = fs.open_file(file_to_read)
+        except Exception, e:
+            print >>sys.stderr, e
+            sys.exit("Error opening %s in guest" % file_to_read)
+        (tfd, ret) = tempfile.mkstemp(prefix="boot_"+file_type+".",
+                                      dir=output_directory)
+        dataoff = 0
+        while True:
+            data = datafile.read(FS_READ_MAX, dataoff)
+            if len(data) == 0:
+                os.close(tfd)
+                del datafile
+                return ret
+            try:
+                os.write(tfd, data)
+            except Exception, e:
+                print >>sys.stderr, e
+                os.close(tfd)
+                os.unlink(ret)
+                del datafile
+                sys.exit("Error writing temporary copy of "+file_type)
+            dataoff += len(data)
+
     try:
         opts, args = getopt.gnu_getopt(sys.argv[1:], 'qinh::',
                                    ["quiet", "interactive", "not-really", "help", 
@@ -786,24 +819,18 @@ if __name__ == "__main__":
     if not fs:
         raise RuntimeError, "Unable to find partition containing kernel"
 
-    if not_really:
-        bootcfg["kernel"] = "<kernel:%s>" % chosencfg["kernel"]
-    else:
-        data = fs.open_file(chosencfg["kernel"]).read()
-        (tfd, bootcfg["kernel"]) = tempfile.mkstemp(prefix="boot_kernel.",
-                                                    dir=output_directory)
-        os.write(tfd, data)
-        os.close(tfd)
+    bootcfg["kernel"] = copy_from_image(fs, chosencfg["kernel"], "kernel",
+                                        output_directory, not_really)
 
     if chosencfg["ramdisk"]:
-        if not_really:
-            bootcfg["ramdisk"] = "<ramdisk:%s>" % chosencfg["ramdisk"]
-        else:
-            data = fs.open_file(chosencfg["ramdisk"],).read()
-            (tfd, bootcfg["ramdisk"]) = tempfile.mkstemp(
-                prefix="boot_ramdisk.", dir=output_directory)
-            os.write(tfd, data)
-            os.close(tfd)
+        try:
+            bootcfg["ramdisk"] = copy_from_image(fs, chosencfg["ramdisk"],
+                                                 "ramdisk", output_directory,
+                                                 not_really)
+        except:
+            if not not_really:
+                os.unlink(bootcfg["kernel"])
+            raise
     else:
         initrd = None
 

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

From xen-changelog-bounces@lists.xen.org Mon Oct 29 23:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 29 Oct 2012 23: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 1TSzAt-0002pi-F8; Mon, 29 Oct 2012 23:55:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAs-0002ow-5T
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:18 +0000
Received: from [85.158.139.211:47090] by server-8.bemta-5.messagelabs.com id
	76/CE-23193-5671F805; Mon, 29 Oct 2012 23:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-206.messagelabs.com!1351554914!18055647!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11261 invoked from network); 29 Oct 2012 23:55:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2012 23:55:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAo-0006O3-Ka
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAo-0000lo-BS
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:14 +0000
Message-Id: <E1TSzAo-0000lo-BS@xenbits.xen.org>
Date: Mon, 29 Oct 2012 23:55:13 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/oprof: adjust off-by-one
	counter range checks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1351497753 -3600
# Node ID 2cdf9b7338018f3d4ce8125d01564ff5587c7241
# Parent  a18ca08c475e020da935c2024cebc2d8b97074cb
x86/oprof: adjust off-by-one counter range checks

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 26061:4b4c0c7a6031
xen-unstable date: Wed Oct 17 09:23:10 UTC 2012
---


diff -r a18ca08c475e -r 2cdf9b733801 xen/arch/x86/oprofile/xenoprof.c
--- a/xen/arch/x86/oprofile/xenoprof.c	Mon Oct 29 09:01:52 2012 +0100
+++ b/xen/arch/x86/oprofile/xenoprof.c	Mon Oct 29 09:02:33 2012 +0100
@@ -25,7 +25,7 @@ int xenoprof_arch_counter(XEN_GUEST_HAND
     if ( copy_from_guest(&counter, arg, 1) )
         return -EFAULT;
 
-    if ( counter.ind > OP_MAX_COUNTER )
+    if ( counter.ind >= OP_MAX_COUNTER )
         return -E2BIG;
 
     counter_config[counter.ind].count     = counter.count;
@@ -63,7 +63,7 @@ int compat_oprof_arch_counter(XEN_GUEST_
     if ( copy_from_guest(&counter, arg, 1) )
         return -EFAULT;
 
-    if ( counter.ind > OP_MAX_COUNTER )
+    if ( counter.ind >= OP_MAX_COUNTER )
         return -E2BIG;
 
     counter_config[counter.ind].count     = counter.count;

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

From xen-changelog-bounces@lists.xen.org Mon Oct 29 23:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 29 Oct 2012 23: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 1TSzAu-0002q7-Kp; Mon, 29 Oct 2012 23:55:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAt-0002pR-Th
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:20 +0000
Received: from [85.158.143.99:14296] by server-3.bemta-4.messagelabs.com id
	62/C8-24279-6671F805; Mon, 29 Oct 2012 23:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-216.messagelabs.com!1351554916!20322586!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28763 invoked from network); 29 Oct 2012 23:55:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2012 23:55:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAq-0006OC-4j
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAq-0000ma-0M
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:16 +0000
Message-Id: <E1TSzAq-0000ma-0M@xenbits.xen.org>
Date: Mon, 29 Oct 2012 23:55:15 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86: don't special case first
	IO-APIC
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1351497888 -3600
# Node ID 700d0f03d50aa6619d313c1ff6aea7fd429d28a7
# Parent  f07e36b09677f71075c513d917eadafb831414ad
x86: don't special case first IO-APIC

It has always been puzzling me why the first IO-APIC gets special cased
in two places, and finally Xen got run on a system where this breaks:

(XEN) ACPI: IOAPIC (id[0x10] address[0xfecff000] gsi_base[0])
(XEN) IOAPIC[0]: apic_id 16, version 17, address 0xfecff000, GSI 0-2
(XEN) ACPI: IOAPIC (id[0x0f] address[0xfec00000] gsi_base[3])
(XEN) IOAPIC[1]: apic_id 15, version 17, address 0xfec00000, GSI 3-38
(XEN) ACPI: IOAPIC (id[0x0e] address[0xfec01000] gsi_base[39])
(XEN) IOAPIC[2]: apic_id 14, version 17, address 0xfec01000, GSI 39-74
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 1 global_irq 4 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 5 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 3 global_irq 6 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 4 global_irq 7 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 6 global_irq 9 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 7 global_irq 10 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 8 global_irq 11 low edge)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 12 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 12 global_irq 15 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 13 global_irq 16 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 14 global_irq 17 low edge)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 15 global_irq 18 dfl dfl)

i.e. all legacy IRQs (apart from the timer one, but the firmware passed
data doesn't look right for that case anyway, as both Xen and native
Linux are falling back to use the virtual wire setup for IRQ0,
apparently rather using pin 2 of the first IO-APIC) are being handled
by the second IO-APIC.

This at once eliminates the possibility of an unmasked RTE getting
written without having got a vector put in place (in
setup_IO_APIC_irqs()).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 26102:22e08c9ac770
xen-unstable date: Wed Oct 24 15:51:48 UTC 2012
---


diff -r f07e36b09677 -r 700d0f03d50a xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c	Mon Oct 29 09:04:06 2012 +0100
+++ b/xen/arch/x86/io_apic.c	Mon Oct 29 09:04:48 2012 +0100
@@ -1094,18 +1094,17 @@ static void __init setup_IO_APIC_irqs(vo
             else
                 add_pin_to_irq(irq, apic, pin);
 
-            if (!apic && !IO_APIC_IRQ(irq))
+            if (!IO_APIC_IRQ(irq))
                 continue;
 
-            if (IO_APIC_IRQ(irq)) {
-                vector = assign_irq_vector(irq);
-                BUG_ON(vector < 0);
-                entry.vector = vector;
-                ioapic_register_intr(irq, IOAPIC_AUTO);
-
-                if (!apic && platform_legacy_irq(irq))
-                    disable_8259A_irq(irq);
-            }
+            vector = assign_irq_vector(irq);
+            BUG_ON(vector < 0);
+            entry.vector = vector;
+            ioapic_register_intr(irq, IOAPIC_AUTO);
+
+            if (platform_legacy_irq(irq))
+                disable_8259A_irq(irq);
+
             cfg = irq_cfg(irq);
             SET_DEST(entry.dest.dest32, entry.dest.logical.logical_dest,
                      cpu_mask_to_apicid(&cfg->cpu_mask));
@@ -2407,18 +2406,15 @@ unsigned apic_gsi_base(int apic);
 
 static int apic_pin_2_gsi_irq(int apic, int pin)
 {
-    int idx, irq;
+    int idx;
 
     if (apic < 0)
        return -EINVAL;
 
-    irq = apic_gsi_base(apic) + pin;
-    if (apic == 0) {
-        idx = find_irq_entry(apic, pin, mp_INT);
-        if (idx >= 0)
-            irq = pin_2_irq(idx, apic, pin);
-    }
-    return irq;
+    idx = find_irq_entry(apic, pin, mp_INT);
+
+    return idx >= 0 ? pin_2_irq(idx, apic, pin)
+                    : apic_gsi_base(apic) + pin;
 }
 
 int ioapic_guest_read(unsigned long physbase, unsigned int reg, u32 *pval)

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

From xen-changelog-bounces@lists.xen.org Mon Oct 29 23:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 29 Oct 2012 23: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 1TSzAu-0002q7-Kp; Mon, 29 Oct 2012 23:55:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAt-0002pR-Th
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:20 +0000
Received: from [85.158.143.99:14296] by server-3.bemta-4.messagelabs.com id
	62/C8-24279-6671F805; Mon, 29 Oct 2012 23:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-216.messagelabs.com!1351554916!20322586!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28763 invoked from network); 29 Oct 2012 23:55:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2012 23:55:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAq-0006OC-4j
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAq-0000ma-0M
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:16 +0000
Message-Id: <E1TSzAq-0000ma-0M@xenbits.xen.org>
Date: Mon, 29 Oct 2012 23:55:15 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86: don't special case first
	IO-APIC
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1351497888 -3600
# Node ID 700d0f03d50aa6619d313c1ff6aea7fd429d28a7
# Parent  f07e36b09677f71075c513d917eadafb831414ad
x86: don't special case first IO-APIC

It has always been puzzling me why the first IO-APIC gets special cased
in two places, and finally Xen got run on a system where this breaks:

(XEN) ACPI: IOAPIC (id[0x10] address[0xfecff000] gsi_base[0])
(XEN) IOAPIC[0]: apic_id 16, version 17, address 0xfecff000, GSI 0-2
(XEN) ACPI: IOAPIC (id[0x0f] address[0xfec00000] gsi_base[3])
(XEN) IOAPIC[1]: apic_id 15, version 17, address 0xfec00000, GSI 3-38
(XEN) ACPI: IOAPIC (id[0x0e] address[0xfec01000] gsi_base[39])
(XEN) IOAPIC[2]: apic_id 14, version 17, address 0xfec01000, GSI 39-74
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 1 global_irq 4 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 5 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 3 global_irq 6 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 4 global_irq 7 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 6 global_irq 9 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 7 global_irq 10 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 8 global_irq 11 low edge)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 12 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 12 global_irq 15 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 13 global_irq 16 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 14 global_irq 17 low edge)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 15 global_irq 18 dfl dfl)

i.e. all legacy IRQs (apart from the timer one, but the firmware passed
data doesn't look right for that case anyway, as both Xen and native
Linux are falling back to use the virtual wire setup for IRQ0,
apparently rather using pin 2 of the first IO-APIC) are being handled
by the second IO-APIC.

This at once eliminates the possibility of an unmasked RTE getting
written without having got a vector put in place (in
setup_IO_APIC_irqs()).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 26102:22e08c9ac770
xen-unstable date: Wed Oct 24 15:51:48 UTC 2012
---


diff -r f07e36b09677 -r 700d0f03d50a xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c	Mon Oct 29 09:04:06 2012 +0100
+++ b/xen/arch/x86/io_apic.c	Mon Oct 29 09:04:48 2012 +0100
@@ -1094,18 +1094,17 @@ static void __init setup_IO_APIC_irqs(vo
             else
                 add_pin_to_irq(irq, apic, pin);
 
-            if (!apic && !IO_APIC_IRQ(irq))
+            if (!IO_APIC_IRQ(irq))
                 continue;
 
-            if (IO_APIC_IRQ(irq)) {
-                vector = assign_irq_vector(irq);
-                BUG_ON(vector < 0);
-                entry.vector = vector;
-                ioapic_register_intr(irq, IOAPIC_AUTO);
-
-                if (!apic && platform_legacy_irq(irq))
-                    disable_8259A_irq(irq);
-            }
+            vector = assign_irq_vector(irq);
+            BUG_ON(vector < 0);
+            entry.vector = vector;
+            ioapic_register_intr(irq, IOAPIC_AUTO);
+
+            if (platform_legacy_irq(irq))
+                disable_8259A_irq(irq);
+
             cfg = irq_cfg(irq);
             SET_DEST(entry.dest.dest32, entry.dest.logical.logical_dest,
                      cpu_mask_to_apicid(&cfg->cpu_mask));
@@ -2407,18 +2406,15 @@ unsigned apic_gsi_base(int apic);
 
 static int apic_pin_2_gsi_irq(int apic, int pin)
 {
-    int idx, irq;
+    int idx;
 
     if (apic < 0)
        return -EINVAL;
 
-    irq = apic_gsi_base(apic) + pin;
-    if (apic == 0) {
-        idx = find_irq_entry(apic, pin, mp_INT);
-        if (idx >= 0)
-            irq = pin_2_irq(idx, apic, pin);
-    }
-    return irq;
+    idx = find_irq_entry(apic, pin, mp_INT);
+
+    return idx >= 0 ? pin_2_irq(idx, apic, pin)
+                    : apic_gsi_base(apic) + pin;
 }
 
 int ioapic_guest_read(unsigned long physbase, unsigned int reg, u32 *pval)

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

From xen-changelog-bounces@lists.xen.org Mon Oct 29 23:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 29 Oct 2012 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 1TSzAt-0002pp-I5; Mon, 29 Oct 2012 23:55:19 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAs-0002oP-QY
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:18 +0000
Received: from [85.158.143.35:23203] by server-2.bemta-4.messagelabs.com id
	16/92-22268-6671F805; Mon, 29 Oct 2012 23:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-21.messagelabs.com!1351554915!13121434!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24359 invoked from network); 29 Oct 2012 23:55:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2012 23:55:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAp-0006O9-KY
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAp-0000mL-Ev
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:15 +0000
Message-Id: <E1TSzAp-0000mL-Ev@xenbits.xen.org>
Date: Mon, 29 Oct 2012 23:55:14 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] hvm: handle PoD and grant pages
	in HVMOP_get_mem_type
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1351497846 -3600
# Node ID f07e36b09677f71075c513d917eadafb831414ad
# Parent  59ac9035595e6923a4e7653fd84b8c0887066ea3
hvm: handle PoD and grant pages in HVMOP_get_mem_type

During kexec in a ballooned PVonHVM guest the new kernel needs to check
each pfn if its backed by a mfn to find ballooned pages. Currently all
PoD and grant pages will appear as HVMMEM_mmio_dm, so the new kernel has
to assume they are ballooned. This is wrong: PoD pages may turn into
real RAM at runtime, grant pages are also RAM.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Tim Deegan <tim@xen.org>
xen-unstable changeset: 26093:4ae08ca5500f
xen-unstable date: Fri Oct 19 14:09:05 UTC 2012
---


diff -r 59ac9035595e -r f07e36b09677 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Mon Oct 29 09:03:17 2012 +0100
+++ b/xen/arch/x86/hvm/hvm.c	Mon Oct 29 09:04:06 2012 +0100
@@ -3578,6 +3578,10 @@ long do_hvm_op(unsigned long op, XEN_GUE
                 a.mem_type =  HVMMEM_ram_ro;
             else if ( p2m_is_ram(t) )
                 a.mem_type =  HVMMEM_ram_rw;
+            else if ( p2m_is_magic(t) )
+                a.mem_type =  HVMMEM_ram_rw;
+            else if ( p2m_is_grant(t) )
+                a.mem_type =  HVMMEM_ram_rw;
             else
                 a.mem_type =  HVMMEM_mmio_dm;
             rc = copy_to_guest(arg, &a, 1) ? -EFAULT : 0;

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

From xen-changelog-bounces@lists.xen.org Mon Oct 29 23:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 29 Oct 2012 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 1TSzAt-0002pp-I5; Mon, 29 Oct 2012 23:55:19 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAs-0002oP-QY
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:18 +0000
Received: from [85.158.143.35:23203] by server-2.bemta-4.messagelabs.com id
	16/92-22268-6671F805; Mon, 29 Oct 2012 23:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-21.messagelabs.com!1351554915!13121434!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24359 invoked from network); 29 Oct 2012 23:55:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2012 23:55:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAp-0006O9-KY
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAp-0000mL-Ev
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:15 +0000
Message-Id: <E1TSzAp-0000mL-Ev@xenbits.xen.org>
Date: Mon, 29 Oct 2012 23:55:14 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] hvm: handle PoD and grant pages
	in HVMOP_get_mem_type
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1351497846 -3600
# Node ID f07e36b09677f71075c513d917eadafb831414ad
# Parent  59ac9035595e6923a4e7653fd84b8c0887066ea3
hvm: handle PoD and grant pages in HVMOP_get_mem_type

During kexec in a ballooned PVonHVM guest the new kernel needs to check
each pfn if its backed by a mfn to find ballooned pages. Currently all
PoD and grant pages will appear as HVMMEM_mmio_dm, so the new kernel has
to assume they are ballooned. This is wrong: PoD pages may turn into
real RAM at runtime, grant pages are also RAM.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Tim Deegan <tim@xen.org>
xen-unstable changeset: 26093:4ae08ca5500f
xen-unstable date: Fri Oct 19 14:09:05 UTC 2012
---


diff -r 59ac9035595e -r f07e36b09677 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Mon Oct 29 09:03:17 2012 +0100
+++ b/xen/arch/x86/hvm/hvm.c	Mon Oct 29 09:04:06 2012 +0100
@@ -3578,6 +3578,10 @@ long do_hvm_op(unsigned long op, XEN_GUE
                 a.mem_type =  HVMMEM_ram_ro;
             else if ( p2m_is_ram(t) )
                 a.mem_type =  HVMMEM_ram_rw;
+            else if ( p2m_is_magic(t) )
+                a.mem_type =  HVMMEM_ram_rw;
+            else if ( p2m_is_grant(t) )
+                a.mem_type =  HVMMEM_ram_rw;
             else
                 a.mem_type =  HVMMEM_mmio_dm;
             rc = copy_to_guest(arg, &a, 1) ? -EFAULT : 0;

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

From xen-changelog-bounces@lists.xen.org Mon Oct 29 23:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 29 Oct 2012 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 1TSzAt-0002pc-Cd; Mon, 29 Oct 2012 23:55:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAs-0002os-1D
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:18 +0000
Received: from [85.158.139.211:47083] by server-3.bemta-5.messagelabs.com id
	7B/50-28618-5671F805; Mon, 29 Oct 2012 23:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-206.messagelabs.com!1351554915!17658013!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29859 invoked from network); 29 Oct 2012 23:55:16 -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;
	29 Oct 2012 23:55:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAp-0006O6-3N
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAo-0000m3-SD
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:14 +0000
Message-Id: <E1TSzAo-0000m3-SD@xenbits.xen.org>
Date: Mon, 29 Oct 2012 23:55:14 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/HPET: obtain proper lock for
	changing IRQ 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

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1351497797 -3600
# Node ID 59ac9035595e6923a4e7653fd84b8c0887066ea3
# Parent  2cdf9b7338018f3d4ce8125d01564ff5587c7241
x86/HPET: obtain proper lock for changing IRQ affinity

The IRQ descriptor lock should be held while adjusting the affinity of
any IRQ; the HPET channel lock isn't sufficient to protect namely
against races with moving the IRQ to a different CPU.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 26063:1f4be6ee4619
xen-unstable date: Wed Oct 17 12:13:20 UTC 2012
---


diff -r 2cdf9b733801 -r 59ac9035595e xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c	Mon Oct 29 09:02:33 2012 +0100
+++ b/xen/arch/x86/hpet.c	Mon Oct 29 09:03:17 2012 +0100
@@ -493,6 +493,16 @@ static struct hpet_event_channel *hpet_g
     return ch;
 }
 
+static void set_channel_irq_affinity(const struct hpet_event_channel *ch)
+{
+    struct irq_desc *desc = irq_to_desc(ch->irq);
+
+    ASSERT(!local_irq_is_enabled());
+    spin_lock(&desc->lock);
+    desc->handler->set_affinity(ch->irq, cpumask_of_cpu(ch->cpu));
+    spin_unlock(&desc->lock);
+}
+
 static void hpet_attach_channel(int cpu, struct hpet_event_channel *ch)
 {
     ASSERT(spin_is_locked(&ch->lock));
@@ -506,9 +516,7 @@ static void hpet_attach_channel(int cpu,
     if ( ch->cpu != cpu )
         return;
 
-    /* set irq affinity */
-    irq_desc[ch->irq].handler->
-        set_affinity(ch->irq, cpumask_of_cpu(ch->cpu));
+    set_channel_irq_affinity(ch);
 }
 
 static void hpet_detach_channel(int cpu, struct hpet_event_channel *ch)
@@ -529,9 +537,7 @@ static void hpet_detach_channel(int cpu,
     }
 
     ch->cpu = first_cpu(ch->cpumask);
-    /* set irq affinity */
-    irq_desc[ch->irq].handler->
-        set_affinity(ch->irq, cpumask_of_cpu(ch->cpu));
+    set_channel_irq_affinity(ch);
 }
 
 #include <asm/mc146818rtc.h>

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

From xen-changelog-bounces@lists.xen.org Mon Oct 29 23:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 29 Oct 2012 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 1TSzAt-0002pc-Cd; Mon, 29 Oct 2012 23:55:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAs-0002os-1D
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:18 +0000
Received: from [85.158.139.211:47083] by server-3.bemta-5.messagelabs.com id
	7B/50-28618-5671F805; Mon, 29 Oct 2012 23:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-206.messagelabs.com!1351554915!17658013!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29859 invoked from network); 29 Oct 2012 23:55:16 -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;
	29 Oct 2012 23:55:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAp-0006O6-3N
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TSzAo-0000m3-SD
	for xen-changelog@lists.xensource.com; Mon, 29 Oct 2012 23:55:14 +0000
Message-Id: <E1TSzAo-0000m3-SD@xenbits.xen.org>
Date: Mon, 29 Oct 2012 23:55:14 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/HPET: obtain proper lock for
	changing IRQ 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

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1351497797 -3600
# Node ID 59ac9035595e6923a4e7653fd84b8c0887066ea3
# Parent  2cdf9b7338018f3d4ce8125d01564ff5587c7241
x86/HPET: obtain proper lock for changing IRQ affinity

The IRQ descriptor lock should be held while adjusting the affinity of
any IRQ; the HPET channel lock isn't sufficient to protect namely
against races with moving the IRQ to a different CPU.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 26063:1f4be6ee4619
xen-unstable date: Wed Oct 17 12:13:20 UTC 2012
---


diff -r 2cdf9b733801 -r 59ac9035595e xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c	Mon Oct 29 09:02:33 2012 +0100
+++ b/xen/arch/x86/hpet.c	Mon Oct 29 09:03:17 2012 +0100
@@ -493,6 +493,16 @@ static struct hpet_event_channel *hpet_g
     return ch;
 }
 
+static void set_channel_irq_affinity(const struct hpet_event_channel *ch)
+{
+    struct irq_desc *desc = irq_to_desc(ch->irq);
+
+    ASSERT(!local_irq_is_enabled());
+    spin_lock(&desc->lock);
+    desc->handler->set_affinity(ch->irq, cpumask_of_cpu(ch->cpu));
+    spin_unlock(&desc->lock);
+}
+
 static void hpet_attach_channel(int cpu, struct hpet_event_channel *ch)
 {
     ASSERT(spin_is_locked(&ch->lock));
@@ -506,9 +516,7 @@ static void hpet_attach_channel(int cpu,
     if ( ch->cpu != cpu )
         return;
 
-    /* set irq affinity */
-    irq_desc[ch->irq].handler->
-        set_affinity(ch->irq, cpumask_of_cpu(ch->cpu));
+    set_channel_irq_affinity(ch);
 }
 
 static void hpet_detach_channel(int cpu, struct hpet_event_channel *ch)
@@ -529,9 +537,7 @@ static void hpet_detach_channel(int cpu,
     }
 
     ch->cpu = first_cpu(ch->cpumask);
-    /* set irq affinity */
-    irq_desc[ch->irq].handler->
-        set_affinity(ch->irq, cpumask_of_cpu(ch->cpu));
+    set_channel_irq_affinity(ch);
 }
 
 #include <asm/mc146818rtc.h>

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

From xen-changelog-bounces@lists.xen.org Tue Oct 30 04:00:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Oct 2012 04:00:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TT301-0000n5-D9; Tue, 30 Oct 2012 04:00:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT300-0000mz-IU
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:20 +0000
Received: from [85.158.139.211:25326] by server-7.bemta-5.messagelabs.com id
	0E/BD-23102-3D05F805; Tue, 30 Oct 2012 04:00:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-206.messagelabs.com!1351569617!18077381!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26591 invoked from network); 30 Oct 2012 04:00:18 -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;
	30 Oct 2012 04:00:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT2zx-0001Ws-Hv
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT2zx-0007Je-4X
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:17 +0000
Message-Id: <E1TT2zx-0007Je-4X@xenbits.xen.org>
Date: Tue, 30 Oct 2012 04:00:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: Do not leak events when a domain
	exits.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1351249392 -3600
# Node ID 03af0abd2b72dfab3f2e50dd502108de8603f741
# Parent  d07692b5c780d5e2a9f86bdd77d6627bdf67aa68
xl: Do not leak events when a domain exits.

The goto in both of these places misses the event free which would
normally clean up.

==8655== 80 bytes in 1 blocks are definitely lost in loss record 1 of 1
==8655==    at 0x4024370: calloc (vg_replace_malloc.c:593)
==8655==    by 0x406EAAE: libxl__zalloc (libxl_internal.c:83)
==8655==    by 0x4078173: libxl__event_new (libxl_event.c:1167)
==8655==    by 0x4056373: domain_death_occurred (libxl.c:958)
==8655==    by 0x4058D06: domain_death_xswatch_callback (libxl.c:1038)
==8655==    by 0x4078EB5: watchfd_callback (libxl_event.c:458)
==8655==    by 0x407839E: afterpoll_internal (libxl_event.c:949)
==8655==    by 0x4079142: eventloop_iteration (libxl_event.c:1371)
==8655==    by 0x40799BB: libxl_event_wait (libxl_event.c:1396)
==8655==    by 0x805CC67: create_domain (xl_cmdimpl.c:1698)
==8655==    by 0x805E001: main_create (xl_cmdimpl.c:3986)
==8655==    by 0x804D43D: main (xl.c:285)

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


diff -r d07692b5c780 -r 03af0abd2b72 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Fri Oct 26 11:39:42 2012 +0100
+++ b/tools/libxl/xl_cmdimpl.c	Fri Oct 26 12:03:12 2012 +0100
@@ -2118,6 +2118,7 @@ start:
 
             case 0:
                 LOG("Done. Exiting now");
+                libxl_event_free(ctx, event);
                 ret = 0;
                 goto out;
 
@@ -2127,6 +2128,7 @@ start:
 
         case LIBXL_EVENT_TYPE_DOMAIN_DEATH:
             LOG("Domain %d has been destroyed.", domid);
+            libxl_event_free(ctx, event);
             ret = 0;
             goto out;
 

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

From xen-changelog-bounces@lists.xen.org Tue Oct 30 04:00:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Oct 2012 04:00:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TT304-0000o0-R6; Tue, 30 Oct 2012 04:00:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT303-0000nO-SN
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:23 +0000
Received: from [85.158.143.99:58243] by server-1.bemta-4.messagelabs.com id
	F1/0A-19134-7D05F805; Tue, 30 Oct 2012 04:00:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-216.messagelabs.com!1351569620!20336620!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28856 invoked from network); 30 Oct 2012 04:00:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2012 04:00:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT300-0001X4-Hn
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT300-0007Kr-Ci
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:20 +0000
Message-Id: <E1TT300-0007Kr-Ci@xenbits.xen.org>
Date: Tue, 30 Oct 2012 04:00:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/MCE: remove K7 support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1351519598 -3600
# Node ID c3dafc201ad38e91e2914bac0f3548848462854c
# Parent  f9ded6e9e554b66ff6d8a0181f70e1dca2517e90
x86/MCE: remove K7 support

Remove K7 support from MCE.

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


diff -r f9ded6e9e554 -r c3dafc201ad3 xen/arch/x86/cpu/mcheck/Makefile
--- a/xen/arch/x86/cpu/mcheck/Makefile	Mon Oct 29 15:04:35 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/Makefile	Mon Oct 29 15:06:38 2012 +0100
@@ -1,5 +1,4 @@
 obj-y += amd_nonfatal.o
-obj-y += k7.o
 obj-y += amd_k8.o
 obj-y += amd_f10.o
 obj-y += mce_amd.o
diff -r f9ded6e9e554 -r c3dafc201ad3 xen/arch/x86/cpu/mcheck/k7.c
--- a/xen/arch/x86/cpu/mcheck/k7.c	Mon Oct 29 15:04:35 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-/*
- * Athlon/Hammer specific Machine Check Exception Reporting
- * (C) Copyright 2002 Dave Jones <davej@codemonkey.org.uk>
- */
-
-#include <xen/init.h>
-#include <xen/types.h>
-#include <xen/kernel.h>
-#include <xen/config.h>
-#include <xen/smp.h>
-
-#include <asm/processor.h> 
-#include <asm/system.h>
-#include <asm/msr.h>
-
-#include "mce.h"
-#include "x86_mca.h"
-
-/* Machine Check Handler For AMD Athlon/Duron */
-static void k7_machine_check(struct cpu_user_regs * regs, long error_code)
-{
-	int recover = 1;
-	uint64_t msr_content, mcgst;
-	int i;
-
-	rdmsrl(MSR_IA32_MCG_STATUS, mcgst);
-	if (mcgst & MCG_STATUS_RIPV)	/* Recoverable ? */
-		recover = 0;
-
-	printk(KERN_EMERG "CPU %d: Machine Check Exception: 0x%016"PRIx64"\n",
-		smp_processor_id(), mcgst);
-
-	for (i = 1; i < nr_mce_banks; i++) {
-		uint64_t value;
-
-		rdmsrl(MSR_IA32_MCx_STATUS(i), msr_content);
-		if (msr_content & MCi_STATUS_VAL) {
-			if (msr_content & MCi_STATUS_UC)
-				recover |= 1;
-			if (msr_content & MCi_STATUS_PCC)
-				recover |= 2;
-			printk(KERN_EMERG "Bank %d: 0x%16"PRIx64,
-				i, msr_content);
-			msr_content &= ~MCi_STATUS_VAL;
-			if (msr_content & MCi_STATUS_MISCV) {
-				rdmsrl(MSR_IA32_MCx_MISC(i), value);
-				printk("[0x%016"PRIx64"]", value);
-			}
-			if (msr_content & MCi_STATUS_ADDRV) {
-				rdmsrl(MSR_IA32_MCx_ADDR(i), value);
-				printk(" at 0x%016"PRIx64, value);
-			}
-			printk("\n");
-			/* Clear it */
-			wrmsrl(MSR_IA32_MCx_STATUS(i), 0x0ULL);
-			/* Serialize */
-			wmb();
-			add_taint(TAINT_MACHINE_CHECK);
-		}
-	}
-
-	if (recover & 2)
-		mc_panic("CPU context corrupt");
-	if (recover & 1)
-		mc_panic("Unable to continue");
-	printk(KERN_EMERG "Attempting to continue.\n");
-	mcgst &= ~MCG_STATUS_MCIP;
-	wrmsrl(MSR_IA32_MCG_STATUS, mcgst);
-}
-
-
-/* AMD K7 machine check */
-enum mcheck_type amd_k7_mcheck_init(struct cpuinfo_x86 *c)
-{
-	int i;
-
-	x86_mce_vector_register(k7_machine_check);
-
-	/* Clear status for MC index 0 separately, we don't touch CTL,
-	 * as some Athlons cause spurious MCEs when its enabled. */
-	wrmsrl(MSR_IA32_MC0_STATUS, 0x0ULL);
-	for (i = 1; i < nr_mce_banks; i++) {
-		wrmsrl(MSR_IA32_MCx_CTL(i), 0xffffffffffffffffULL);
-		wrmsrl(MSR_IA32_MCx_STATUS(i), 0x0ULL);
-	}
-
-	return mcheck_amd_k7;
-}
diff -r f9ded6e9e554 -r c3dafc201ad3 xen/arch/x86/cpu/mcheck/mce.c
--- a/xen/arch/x86/cpu/mcheck/mce.c	Mon Oct 29 15:04:35 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce.c	Mon Oct 29 15:06:38 2012 +0100
@@ -567,15 +567,12 @@ int mce_available(struct cpuinfo_x86 *c)
 }
 
 /*
- * Check if bank 0 is usable for MCE. It isn't for AMD K7,
- * and Intel P6 family before model 0x1a.
+ * Check if bank 0 is usable for MCE. It isn't for Intel P6 family
+ * before model 0x1a.
  */
 unsigned int mce_firstbank(struct cpuinfo_x86 *c)
 {
     if (c->x86 == 6) {
-        if (c->x86_vendor == X86_VENDOR_AMD)
-            return 1;
-
         if (c->x86_vendor == X86_VENDOR_INTEL && c->x86_model < 0x1a)
             return 1;
     }
@@ -591,7 +588,6 @@ int show_mca_info(int inited, struct cpu
         char prefix[20];
         static const char *const type_str[] = {
             [mcheck_amd_famXX] = "AMD",
-            [mcheck_amd_k7] = "AMD K7",
             [mcheck_amd_k8] = "AMD K8",
             [mcheck_intel] = "Intel"
         };
diff -r f9ded6e9e554 -r c3dafc201ad3 xen/arch/x86/cpu/mcheck/mce.h
--- a/xen/arch/x86/cpu/mcheck/mce.h	Mon Oct 29 15:04:35 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce.h	Mon Oct 29 15:06:38 2012 +0100
@@ -33,7 +33,6 @@ enum mcheck_type {
 	mcheck_unset = -1,
 	mcheck_none,
 	mcheck_amd_famXX,
-	mcheck_amd_k7,
 	mcheck_amd_k8,
 	mcheck_intel
 };
diff -r f9ded6e9e554 -r c3dafc201ad3 xen/arch/x86/cpu/mcheck/mce_amd.c
--- a/xen/arch/x86/cpu/mcheck/mce_amd.c	Mon Oct 29 15:04:35 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce_amd.c	Mon Oct 29 15:06:38 2012 +0100
@@ -106,10 +106,6 @@ amd_mcheck_init(struct cpuinfo_x86 *ci)
 
     switch ( ci->x86 )
     {
-    case 6:
-        rc = amd_k7_mcheck_init(ci);
-        break;
-
     default:
         /* Assume that machine check support is available.
          * The minimum provided support is at least the K8. */
diff -r f9ded6e9e554 -r c3dafc201ad3 xen/arch/x86/cpu/mcheck/mce_amd.h
--- a/xen/arch/x86/cpu/mcheck/mce_amd.h	Mon Oct 29 15:04:35 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce_amd.h	Mon Oct 29 15:06:38 2012 +0100
@@ -1,7 +1,6 @@
 #ifndef _MCHECK_AMD_H
 #define _MCHECK_AMD_H
 
-enum mcheck_type amd_k7_mcheck_init(struct cpuinfo_x86 *c);
 enum mcheck_type amd_k8_mcheck_init(struct cpuinfo_x86 *c);
 enum mcheck_type amd_f10_mcheck_init(struct cpuinfo_x86 *c);
 
diff -r f9ded6e9e554 -r c3dafc201ad3 xen/arch/x86/cpu/mcheck/mce_amd_quirks.c
--- a/xen/arch/x86/cpu/mcheck/mce_amd_quirks.c	Mon Oct 29 15:04:35 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce_amd_quirks.c	Mon Oct 29 15:06:38 2012 +0100
@@ -25,8 +25,6 @@
 #define ANY -1
 
 static const struct mce_quirkdata mce_amd_quirks[] = {
-	{ 0x6 /* cpu family */, ANY /* all models */, ANY /* all steppings */,
-	  MCEQUIRK_K7_BANK0 },
 	{ 0xf /* cpu family */, ANY /* all models */, ANY /* all steppings */,
 	  MCEQUIRK_K8_GART },
 	{ 0x10 /* cpu family */, ANY /* all models */, ANY /* all steppings */,
@@ -59,9 +57,6 @@ int mcequirk_amd_apply(enum mcequirk_amd
 	u64 val;
 
 	switch (flags) {
-	case MCEQUIRK_K7_BANK0:
-		return 1; /* first bank */
-
 	case MCEQUIRK_K8_GART:
 		/*
 		 * Enable error reporting for all errors except for GART
diff -r f9ded6e9e554 -r c3dafc201ad3 xen/arch/x86/cpu/mcheck/mce_quirks.h
--- a/xen/arch/x86/cpu/mcheck/mce_quirks.h	Mon Oct 29 15:04:35 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce_quirks.h	Mon Oct 29 15:06:38 2012 +0100
@@ -33,8 +33,7 @@ struct mce_quirkdata {
  */
 
 enum mcequirk_amd_flags {
-	MCEQUIRK_K7_BANK0 = 1,
-	MCEQUIRK_K8_GART,
+	MCEQUIRK_K8_GART = 2,
 	MCEQUIRK_F10_GART
 };
 
diff -r f9ded6e9e554 -r c3dafc201ad3 xen/arch/x86/cpu/mcheck/non-fatal.c
--- a/xen/arch/x86/cpu/mcheck/non-fatal.c	Mon Oct 29 15:04:35 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/non-fatal.c	Mon Oct 29 15:06:38 2012 +0100
@@ -102,12 +102,6 @@ static int __init init_nonfatal_mce_chec
 	 */
 	switch (c->x86_vendor) {
 	case X86_VENDOR_AMD:
-		if (c->x86 == 6) { /* K7 */
-			init_timer(&mce_timer, mce_work_fn, NULL, 0);
-			set_timer(&mce_timer, NOW() + MCE_PERIOD);
-			break;
-		}
-
 		/* Assume we are on K8 or newer AMD CPU here */
 		amd_nonfatal_mcheck_init(c);
 		break;
diff -r f9ded6e9e554 -r c3dafc201ad3 xen/arch/x86/cpu/mcheck/x86_mca.h
--- a/xen/arch/x86/cpu/mcheck/x86_mca.h	Mon Oct 29 15:04:35 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/x86_mca.h	Mon Oct 29 15:06:38 2012 +0100
@@ -1,6 +1,6 @@
 /*
- * MCA implementation for AMD K7/K8 CPUs
- * Copyright (c) 2007 Advanced Micro Devices, Inc. 
+ * MCA implementation for AMD CPUs
+ * Copyright (c) 2007-2012 Advanced Micro Devices, Inc. 
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by

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

From xen-changelog-bounces@lists.xen.org Tue Oct 30 04:00:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Oct 2012 04:00:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TT303-0000nY-LV; Tue, 30 Oct 2012 04:00:23 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT302-0000nA-3F
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:22 +0000
Received: from [85.158.143.99:58185] by server-2.bemta-4.messagelabs.com id
	C7/11-22268-5D05F805; Tue, 30 Oct 2012 04:00:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-216.messagelabs.com!1351569619!27304786!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2352 invoked from network); 30 Oct 2012 04:00:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2012 04:00:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT2zy-0001Wv-Oa
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT2zx-0007Jx-RB
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:18 +0000
Message-Id: <E1TT2zx-0007Jx-RB@xenbits.xen.org>
Date: Tue, 30 Oct 2012 04:00:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] pygrub: Add option to list grub
	entries
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Charles Arnold <carnold@suse.com>
# Date 1351249508 -3600
# Node ID 6f9e46917eb8771914041b98f714e8f485fca5ef
# Parent  03af0abd2b72dfab3f2e50dd502108de8603f741
pygrub: Add option to list grub entries

The argument to "--entry" allows 2 syntaxes, either directly the entry
number in menu.lst, or the whole string behind the "title" key word.
This poses the following issue:

>From Dom0 there is no way to guess the number and, or the complete
title string because this string contains the kernel version, which
will change with a kernel update.

This patch adds [-l|--list-entries] as an argument to pygrub.

Signed-off-by: Charles Arnold <carnold@suse.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 03af0abd2b72 -r 6f9e46917eb8 tools/pygrub/src/pygrub
--- a/tools/pygrub/src/pygrub	Fri Oct 26 12:03:12 2012 +0100
+++ b/tools/pygrub/src/pygrub	Fri Oct 26 12:05:08 2012 +0100
@@ -595,7 +595,17 @@ def run_grub(file, entry, fs, cfg_args):
         sel = g.run()
 
     g = Grub(file, fs)
-    if interactive:
+
+    if list_entries:
+        for i in range(len(g.cf.images)):
+            img = g.cf.images[i]
+            print "title: %s" % img.title
+            print "  root: %s" % img.root
+            print "  kernel: %s" % img.kernel[1]
+            print "  args: %s" % img.args
+            print "  initrd: %s" % img.initrd[1]
+
+    if interactive and not list_entries:
         curses.wrapper(run_main)
     else:
         sel = g.cf.default
@@ -702,7 +712,7 @@ if __name__ == "__main__":
     sel = None
     
     def usage():
-        print >> sys.stderr, "Usage: %s [-q|--quiet] [-i|--interactive] [-n|--not-really] [--output=] [--kernel=] [--ramdisk=] [--args=] [--entry=] [--output-directory=] [--output-format=sxp|simple|simple0] <image>" %(sys.argv[0],)
+        print >> sys.stderr, "Usage: %s [-q|--quiet] [-i|--interactive] [-l|--list-entries] [-n|--not-really] [--output=] [--kernel=] [--ramdisk=] [--args=] [--entry=] [--output-directory=] [--output-format=sxp|simple|simple0] <image>" %(sys.argv[0],)
 
     def copy_from_image(fs, file_to_read, file_type, output_directory,
                         not_really):
@@ -736,8 +746,8 @@ if __name__ == "__main__":
             dataoff += len(data)
 
     try:
-        opts, args = getopt.gnu_getopt(sys.argv[1:], 'qinh::',
-                                   ["quiet", "interactive", "not-really", "help", 
+        opts, args = getopt.gnu_getopt(sys.argv[1:], 'qilnh::',
+                                   ["quiet", "interactive", "list-entries", "not-really", "help",
                                     "output=", "output-format=", "output-directory=",
                                     "entry=", "kernel=", 
                                     "ramdisk=", "args=", "isconfig", "debug"])
@@ -753,6 +763,7 @@ if __name__ == "__main__":
     output = None
     entry = None
     interactive = True
+    list_entries = False
     isconfig = False
     debug = False
     not_really = False
@@ -771,6 +782,8 @@ if __name__ == "__main__":
             interactive = False
         elif o in ("-i", "--interactive"):
             interactive = True
+        elif o in ("-l", "--list-entries"):
+            list_entries = True
         elif o in ("-n", "--not-really"):
             not_really = True
         elif o in ("-h", "--help"):
@@ -855,6 +868,9 @@ if __name__ == "__main__":
             fs = None
             continue
 
+    if list_entries:
+        sys.exit(0)
+
     # Did looping through partitions find us a kernel?
     if not fs:
         raise RuntimeError, "Unable to find partition containing kernel"

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

From xen-changelog-bounces@lists.xen.org Tue Oct 30 04:00:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Oct 2012 04:00:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TT302-0000nJ-Fx; Tue, 30 Oct 2012 04:00:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT301-0000n4-PA
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:22 +0000
Received: from [85.158.137.99:13719] by server-9.bemta-3.messagelabs.com id
	77/0C-16841-4D05F805; Tue, 30 Oct 2012 04:00:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-217.messagelabs.com!1351569617!18750698!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24882 invoked from network); 30 Oct 2012 04:00:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2012 04:00:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT2zw-0001Wp-Rw
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT2zt-0007IS-EB
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:15 +0000
Message-Id: <E1TT2zt-0007IS-EB@xenbits.xen.org>
Date: Tue, 30 Oct 2012 04:00:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Revert 26109:6ccfe4d29f95
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1351247982 -3600
# Node ID d07692b5c780d5e2a9f86bdd77d6627bdf67aa68
# Parent  c26e1a79fe77735410d5712348a612fa4b1e377f
Revert 26109:6ccfe4d29f95

This changeset was contaminated by changes hanging around in my
working tree.  Sorry :-(.

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


diff -r c26e1a79fe77 -r d07692b5c780 stubdom/grub/kexec.c
--- a/stubdom/grub/kexec.c	Thu Oct 25 17:12:55 2012 +0100
+++ b/stubdom/grub/kexec.c	Fri Oct 26 11:39:42 2012 +0100
@@ -137,10 +137,6 @@ void kexec(void *kernel, long kernel_siz
     dom = xc_dom_allocate(xc_handle, cmdline, features);
     dom->allocate = kexec_allocate;
 
-    /* We are using guest owned memory, therefore no limits. */
-    xc_dom_kernel_max_size(dom, 0);
-    xc_dom_ramdisk_max_size(dom, 0);
-
     dom->kernel_blob = kernel;
     dom->kernel_size = kernel_size;
 
diff -r c26e1a79fe77 -r d07692b5c780 tools/libxc/xc_dom.h
--- a/tools/libxc/xc_dom.h	Thu Oct 25 17:12:55 2012 +0100
+++ b/tools/libxc/xc_dom.h	Fri Oct 26 11:39:42 2012 +0100
@@ -55,9 +55,6 @@ struct xc_dom_image {
     void *ramdisk_blob;
     size_t ramdisk_size;
 
-    size_t max_kernel_size;
-    size_t max_ramdisk_size;
-
     /* arguments and parameters */
     char *cmdline;
     uint32_t f_requested[XENFEAT_NR_SUBMAPS];
@@ -197,13 +194,6 @@ void xc_dom_release_phys(struct xc_dom_i
 void xc_dom_release(struct xc_dom_image *dom);
 int xc_dom_mem_init(struct xc_dom_image *dom, unsigned int mem_mb);
 
-#define XC_DOM_DECOMPRESS_MAX (1024*1024*1024) /* 1GB */
-int xc_dom_kernel_check_size(struct xc_dom_image *dom, size_t sz);
-int xc_dom_kernel_max_size(struct xc_dom_image *dom, size_t sz);
-
-int xc_dom_ramdisk_check_size(struct xc_dom_image *dom, size_t sz);
-int xc_dom_ramdisk_max_size(struct xc_dom_image *dom, size_t sz);
-
 size_t xc_dom_check_gzip(xc_interface *xch,
                      void *blob, size_t ziplen);
 int xc_dom_do_gunzip(xc_interface *xch,
@@ -264,8 +254,7 @@ void xc_dom_log_memory_footprint(struct 
 void *xc_dom_malloc(struct xc_dom_image *dom, size_t size);
 void *xc_dom_malloc_page_aligned(struct xc_dom_image *dom, size_t size);
 void *xc_dom_malloc_filemap(struct xc_dom_image *dom,
-                            const char *filename, size_t * size,
-                            const size_t max_size);
+                            const char *filename, size_t * size);
 char *xc_dom_strdup(struct xc_dom_image *dom, const char *str);
 
 /* --- alloc memory pool ------------------------------------------- */
diff -r c26e1a79fe77 -r d07692b5c780 tools/libxc/xc_dom_bzimageloader.c
--- a/tools/libxc/xc_dom_bzimageloader.c	Thu Oct 25 17:12:55 2012 +0100
+++ b/tools/libxc/xc_dom_bzimageloader.c	Fri Oct 26 11:39:42 2012 +0100
@@ -47,7 +47,7 @@ static int xc_try_bzip2_decode(
     char *out_buf;
     char *tmp_buf;
     int retval = -1;
-    unsigned int outsize;
+    int outsize;
     uint64_t total;
 
     stream.bzalloc = NULL;
@@ -79,17 +79,6 @@ static int xc_try_bzip2_decode(
     stream.next_out = out_buf;
     stream.avail_out = dom->kernel_size;
 
-    /*
-     * stream.avail_in is an unsigned int, while kernel_size is a
-     * size_t. Check we aren't overflowing.
-     */
-    if ( stream.avail_in != dom->kernel_size )
-    {
-        DOMPRINTF("BZIP2: Input too large");
-        free(out_buf);
-        goto bzip2_cleanup;
-    }
-
     for ( ; ; )
     {
         ret = BZ2_bzDecompress(&stream);
@@ -109,20 +98,13 @@ static int xc_try_bzip2_decode(
         if ( stream.avail_out == 0 )
         {
             /* Protect against output buffer overflow */
-            if ( outsize > UINT_MAX / 2 )
+            if ( outsize > INT_MAX / 2 )
             {
                 DOMPRINTF("BZIP2: output buffer overflow");
                 free(out_buf);
                 goto bzip2_cleanup;
             }
 
-            if ( xc_dom_kernel_check_size(dom, outsize * 2) )
-            {
-                DOMPRINTF("BZIP2: output too large");
-                free(out_buf);
-                goto bzip2_cleanup;
-            }
-
             tmp_buf = realloc(out_buf, outsize * 2);
             if ( tmp_buf == NULL )
             {
@@ -190,7 +172,7 @@ static int _xc_try_lzma_decode(
     unsigned char *out_buf;
     unsigned char *tmp_buf;
     int retval = -1;
-    size_t outsize;
+    int outsize;
     const char *msg;
 
     /* sigh.  We don't know up-front how much memory we are going to need
@@ -262,20 +244,13 @@ static int _xc_try_lzma_decode(
         if ( stream->avail_out == 0 )
         {
             /* Protect against output buffer overflow */
-            if ( outsize > SIZE_MAX / 2 )
+            if ( outsize > INT_MAX / 2 )
             {
                 DOMPRINTF("%s: output buffer overflow", what);
                 free(out_buf);
                 goto lzma_cleanup;
             }
 
-            if ( xc_dom_kernel_check_size(dom, outsize * 2) )
-            {
-                DOMPRINTF("%s: output too large", what);
-                free(out_buf);
-                goto lzma_cleanup;
-            }
-
             tmp_buf = realloc(out_buf, outsize * 2);
             if ( tmp_buf == NULL )
             {
@@ -384,12 +359,6 @@ static int xc_try_lzo1x_decode(
         0x89, 0x4c, 0x5a, 0x4f, 0x00, 0x0d, 0x0a, 0x1a, 0x0a
     };
 
-    /*
-     * lzo_uint should match size_t. Check that this is the case to be
-     * sure we won't overflow various lzo_uint fields.
-     */
-    XC_BUILD_BUG_ON(sizeof(lzo_uint) != sizeof(size_t));
-
     ret = lzo_init();
     if ( ret != LZO_E_OK )
     {
@@ -469,14 +438,6 @@ static int xc_try_lzo1x_decode(
         if ( src_len <= 0 || src_len > dst_len || src_len > left )
             break;
 
-        msg = "Output buffer overflow";
-        if ( *size > SIZE_MAX - dst_len )
-            break;
-
-        msg = "Decompressed image too large";
-        if ( xc_dom_kernel_check_size(dom, *size + dst_len) )
-            break;
-
         msg = "Failed to (re)alloc memory";
         tmp_buf = realloc(out_buf, *size + dst_len);
         if ( tmp_buf == NULL )
diff -r c26e1a79fe77 -r d07692b5c780 tools/libxc/xc_dom_core.c
--- a/tools/libxc/xc_dom_core.c	Thu Oct 25 17:12:55 2012 +0100
+++ b/tools/libxc/xc_dom_core.c	Fri Oct 26 11:39:42 2012 +0100
@@ -159,8 +159,7 @@ void *xc_dom_malloc_page_aligned(struct 
 }
 
 void *xc_dom_malloc_filemap(struct xc_dom_image *dom,
-                            const char *filename, size_t * size,
-                            const size_t max_size)
+                            const char *filename, size_t * size)
 {
     struct xc_dom_mem *block = NULL;
     int fd = -1;
@@ -172,13 +171,6 @@ void *xc_dom_malloc_filemap(struct xc_do
     lseek(fd, 0, SEEK_SET);
     *size = lseek(fd, 0, SEEK_END);
 
-    if ( max_size && *size > max_size )
-    {
-        xc_dom_panic(dom->xch, XC_OUT_OF_MEMORY,
-                     "tried to map file which is too large");
-        goto err;
-    }
-
     block = malloc(sizeof(*block));
     if ( block == NULL )
         goto err;
@@ -230,40 +222,6 @@ char *xc_dom_strdup(struct xc_dom_image 
 }
 
 /* ------------------------------------------------------------------------ */
-/* decompression buffer sizing                                              */
-int xc_dom_kernel_check_size(struct xc_dom_image *dom, size_t sz)
-{
-    /* No limit */
-    if ( !dom->max_kernel_size )
-        return 0;
-
-    if ( sz > dom->max_kernel_size )
-    {
-        xc_dom_panic(dom->xch, XC_INVALID_KERNEL,
-                     "kernel image too large");
-        return 1;
-    }
-
-    return 0;
-}
-
-int xc_dom_ramdisk_check_size(struct xc_dom_image *dom, size_t sz)
-{
-    /* No limit */
-    if ( !dom->max_ramdisk_size )
-        return 0;
-
-    if ( sz > dom->max_ramdisk_size )
-    {
-        xc_dom_panic(dom->xch, XC_INVALID_KERNEL,
-                     "ramdisk image too large");
-        return 1;
-    }
-
-    return 0;
-}
-
-/* ------------------------------------------------------------------------ */
 /* read files, copy memory blocks, with transparent gunzip                  */
 
 size_t xc_dom_check_gzip(xc_interface *xch, void *blob, size_t ziplen)
@@ -277,7 +235,7 @@ size_t xc_dom_check_gzip(xc_interface *x
 
     gzlen = blob + ziplen - 4;
     unziplen = gzlen[3] << 24 | gzlen[2] << 16 | gzlen[1] << 8 | gzlen[0];
-    if ( (unziplen < 0) || (unziplen > XC_DOM_DECOMPRESS_MAX) )
+    if ( (unziplen < 0) || (unziplen > (1024*1024*1024)) ) /* 1GB limit */
     {
         xc_dom_printf
             (xch,
@@ -330,9 +288,6 @@ int xc_dom_try_gunzip(struct xc_dom_imag
     if ( unziplen == 0 )
         return 0;
 
-    if ( xc_dom_kernel_check_size(dom, unziplen) )
-        return 0;
-
     unzip = xc_dom_malloc(dom, unziplen);
     if ( unzip == NULL )
         return -1;
@@ -635,9 +590,6 @@ struct xc_dom_image *xc_dom_allocate(xc_
     memset(dom, 0, sizeof(*dom));
     dom->xch = xch;
 
-    dom->max_kernel_size = XC_DOM_DECOMPRESS_MAX;
-    dom->max_ramdisk_size = XC_DOM_DECOMPRESS_MAX;
-
     if ( cmdline )
         dom->cmdline = xc_dom_strdup(dom, cmdline);
     if ( features )
@@ -658,25 +610,10 @@ struct xc_dom_image *xc_dom_allocate(xc_
     return NULL;
 }
 
-int xc_dom_kernel_max_size(struct xc_dom_image *dom, size_t sz)
-{
-    DOMPRINTF("%s: kernel_max_size=%zx", __FUNCTION__, sz);
-    dom->max_kernel_size = sz;
-    return 0;
-}
-
-int xc_dom_ramdisk_max_size(struct xc_dom_image *dom, size_t sz)
-{
-    DOMPRINTF("%s: ramdisk_max_size=%zx", __FUNCTION__, sz);
-    dom->max_ramdisk_size = sz;
-    return 0;
-}
-
 int xc_dom_kernel_file(struct xc_dom_image *dom, const char *filename)
 {
     DOMPRINTF("%s: filename=\"%s\"", __FUNCTION__, filename);
-    dom->kernel_blob = xc_dom_malloc_filemap(dom, filename, &dom->kernel_size,
-                                             dom->max_kernel_size);
+    dom->kernel_blob = xc_dom_malloc_filemap(dom, filename, &dom->kernel_size);
     if ( dom->kernel_blob == NULL )
         return -1;
     return xc_dom_try_gunzip(dom, &dom->kernel_blob, &dom->kernel_size);
@@ -685,10 +622,8 @@ int xc_dom_kernel_file(struct xc_dom_ima
 int xc_dom_ramdisk_file(struct xc_dom_image *dom, const char *filename)
 {
     DOMPRINTF("%s: filename=\"%s\"", __FUNCTION__, filename);
-    /* We do not enforce any particular size limit here */
     dom->ramdisk_blob =
-        xc_dom_malloc_filemap(dom, filename, &dom->ramdisk_size, 0);
-
+        xc_dom_malloc_filemap(dom, filename, &dom->ramdisk_size);
     if ( dom->ramdisk_blob == NULL )
         return -1;
 //    return xc_dom_try_gunzip(dom, &dom->ramdisk_blob, &dom->ramdisk_size);
@@ -848,11 +783,7 @@ int xc_dom_build_image(struct xc_dom_ima
         void *ramdiskmap;
 
         unziplen = xc_dom_check_gzip(dom->xch, dom->ramdisk_blob, dom->ramdisk_size);
-        if ( xc_dom_ramdisk_check_size(dom, unziplen) != 0 )
-            unziplen = 0;
-
         ramdisklen = unziplen ? unziplen : dom->ramdisk_size;
-
         if ( xc_dom_alloc_segment(dom, &dom->ramdisk_seg, "ramdisk", 0,
                                   ramdisklen) != 0 )
             goto err;
diff -r c26e1a79fe77 -r d07692b5c780 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Oct 25 17:12:55 2012 +0100
+++ b/tools/libxl/xl_cmdimpl.c	Fri Oct 26 11:39:42 2012 +0100
@@ -2118,7 +2118,6 @@ start:
 
             case 0:
                 LOG("Done. Exiting now");
-                libxl_event_free(ctx, event);
                 ret = 0;
                 goto out;
 
@@ -2128,7 +2127,6 @@ start:
 
         case LIBXL_EVENT_TYPE_DOMAIN_DEATH:
             LOG("Domain %d has been destroyed.", domid);
-            libxl_event_free(ctx, event);
             ret = 0;
             goto out;
 

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

From xen-changelog-bounces@lists.xen.org Tue Oct 30 04:00:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Oct 2012 04:00:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TT304-0000nr-OO; Tue, 30 Oct 2012 04:00:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT303-0000nO-6s
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:23 +0000
Received: from [85.158.143.35:18984] by server-1.bemta-4.messagelabs.com id
	30/0A-19134-6D05F805; Tue, 30 Oct 2012 04:00:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-21.messagelabs.com!1351569619!15604578!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11869 invoked from network); 30 Oct 2012 04:00:20 -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;
	30 Oct 2012 04:00:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT2zz-0001Wy-53
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT2zy-0007KH-Q0
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:18 +0000
Message-Id: <E1TT2zy-0007KH-Q0@xenbits.xen.org>
Date: Tue, 30 Oct 2012 04:00:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxc: builder: limit maximum size
	of kernel/ramdisk.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1351264169 -3600
# Node ID 37a8946eeb9db8b5eafc1c75aded006ad5322af8
# Parent  6f9e46917eb8771914041b98f714e8f485fca5ef
libxc: builder: limit maximum size of kernel/ramdisk.

Allowing user supplied kernels of arbitrary sizes, especially during
decompression, can swallow up dom0 memory leading to either virtual
address space exhaustion in the builder process or allocation
failures/OOM killing of both toolstack and unrelated processes.

We disable these checks when building in a stub domain for pvgrub
since this uses the guest's own memory and is isolated.

Decompression of gzip compressed kernels and ramdisks has been safe
since 14954:58205257517d (Xen 3.1.0 onwards).

This is XSA-25 / CVE-2012-4544.

Also make explicit checks for buffer overflows in various
decompression routines. These were already ruled out due to other
properties of the code but check them as a belt-and-braces measure.

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


diff -r 6f9e46917eb8 -r 37a8946eeb9d stubdom/grub/kexec.c
--- a/stubdom/grub/kexec.c	Fri Oct 26 12:05:08 2012 +0100
+++ b/stubdom/grub/kexec.c	Fri Oct 26 16:09:29 2012 +0100
@@ -137,6 +137,10 @@ void kexec(void *kernel, long kernel_siz
     dom = xc_dom_allocate(xc_handle, cmdline, features);
     dom->allocate = kexec_allocate;
 
+    /* We are using guest owned memory, therefore no limits. */
+    xc_dom_kernel_max_size(dom, 0);
+    xc_dom_ramdisk_max_size(dom, 0);
+
     dom->kernel_blob = kernel;
     dom->kernel_size = kernel_size;
 
diff -r 6f9e46917eb8 -r 37a8946eeb9d tools/libxc/xc_dom.h
--- a/tools/libxc/xc_dom.h	Fri Oct 26 12:05:08 2012 +0100
+++ b/tools/libxc/xc_dom.h	Fri Oct 26 16:09:29 2012 +0100
@@ -55,6 +55,9 @@ struct xc_dom_image {
     void *ramdisk_blob;
     size_t ramdisk_size;
 
+    size_t max_kernel_size;
+    size_t max_ramdisk_size;
+
     /* arguments and parameters */
     char *cmdline;
     uint32_t f_requested[XENFEAT_NR_SUBMAPS];
@@ -194,6 +197,23 @@ void xc_dom_release_phys(struct xc_dom_i
 void xc_dom_release(struct xc_dom_image *dom);
 int xc_dom_mem_init(struct xc_dom_image *dom, unsigned int mem_mb);
 
+/* Set this larger if you have enormous ramdisks/kernels. Note that
+ * you should trust all kernels not to be maliciously large (e.g. to
+ * exhaust all dom0 memory) if you do this (see CVE-2012-4544 /
+ * XSA-25). You can also set the default independently for
+ * ramdisks/kernels in xc_dom_allocate() or call
+ * xc_dom_{kernel,ramdisk}_max_size.
+ */
+#ifndef XC_DOM_DECOMPRESS_MAX
+#define XC_DOM_DECOMPRESS_MAX (1024*1024*1024) /* 1GB */
+#endif
+
+int xc_dom_kernel_check_size(struct xc_dom_image *dom, size_t sz);
+int xc_dom_kernel_max_size(struct xc_dom_image *dom, size_t sz);
+
+int xc_dom_ramdisk_check_size(struct xc_dom_image *dom, size_t sz);
+int xc_dom_ramdisk_max_size(struct xc_dom_image *dom, size_t sz);
+
 size_t xc_dom_check_gzip(xc_interface *xch,
                      void *blob, size_t ziplen);
 int xc_dom_do_gunzip(xc_interface *xch,
@@ -254,7 +274,8 @@ void xc_dom_log_memory_footprint(struct 
 void *xc_dom_malloc(struct xc_dom_image *dom, size_t size);
 void *xc_dom_malloc_page_aligned(struct xc_dom_image *dom, size_t size);
 void *xc_dom_malloc_filemap(struct xc_dom_image *dom,
-                            const char *filename, size_t * size);
+                            const char *filename, size_t * size,
+                            const size_t max_size);
 char *xc_dom_strdup(struct xc_dom_image *dom, const char *str);
 
 /* --- alloc memory pool ------------------------------------------- */
diff -r 6f9e46917eb8 -r 37a8946eeb9d tools/libxc/xc_dom_bzimageloader.c
--- a/tools/libxc/xc_dom_bzimageloader.c	Fri Oct 26 12:05:08 2012 +0100
+++ b/tools/libxc/xc_dom_bzimageloader.c	Fri Oct 26 16:09:29 2012 +0100
@@ -47,13 +47,19 @@ static int xc_try_bzip2_decode(
     char *out_buf;
     char *tmp_buf;
     int retval = -1;
-    int outsize;
+    unsigned int outsize;
     uint64_t total;
 
     stream.bzalloc = NULL;
     stream.bzfree = NULL;
     stream.opaque = NULL;
 
+    if ( dom->kernel_size == 0)
+    {
+        DOMPRINTF("BZIP2: Input is 0 size");
+        return -1;
+    }
+
     ret = BZ2_bzDecompressInit(&stream, 0, 0);
     if ( ret != BZ_OK )
     {
@@ -66,6 +72,17 @@ static int xc_try_bzip2_decode(
      * the input buffer to start, and we'll realloc as needed.
      */
     outsize = dom->kernel_size;
+
+    /*
+     * stream.avail_in and outsize are unsigned int, while kernel_size
+     * is a size_t. Check we aren't overflowing.
+     */
+    if ( outsize != dom->kernel_size )
+    {
+        DOMPRINTF("BZIP2: Input too large");
+        goto bzip2_cleanup;
+    }
+
     out_buf = malloc(outsize);
     if ( out_buf == NULL )
     {
@@ -98,13 +115,20 @@ static int xc_try_bzip2_decode(
         if ( stream.avail_out == 0 )
         {
             /* Protect against output buffer overflow */
-            if ( outsize > INT_MAX / 2 )
+            if ( outsize > UINT_MAX / 2 )
             {
                 DOMPRINTF("BZIP2: output buffer overflow");
                 free(out_buf);
                 goto bzip2_cleanup;
             }
 
+            if ( xc_dom_kernel_check_size(dom, outsize * 2) )
+            {
+                DOMPRINTF("BZIP2: output too large");
+                free(out_buf);
+                goto bzip2_cleanup;
+            }
+
             tmp_buf = realloc(out_buf, outsize * 2);
             if ( tmp_buf == NULL )
             {
@@ -172,9 +196,15 @@ static int _xc_try_lzma_decode(
     unsigned char *out_buf;
     unsigned char *tmp_buf;
     int retval = -1;
-    int outsize;
+    size_t outsize;
     const char *msg;
 
+    if ( dom->kernel_size == 0)
+    {
+        DOMPRINTF("%s: Input is 0 size", what);
+        return -1;
+    }
+
     /* sigh.  We don't know up-front how much memory we are going to need
      * for the output buffer.  Allocate the output buffer to be equal
      * the input buffer to start, and we'll realloc as needed.
@@ -244,13 +274,20 @@ static int _xc_try_lzma_decode(
         if ( stream->avail_out == 0 )
         {
             /* Protect against output buffer overflow */
-            if ( outsize > INT_MAX / 2 )
+            if ( outsize > SIZE_MAX / 2 )
             {
                 DOMPRINTF("%s: output buffer overflow", what);
                 free(out_buf);
                 goto lzma_cleanup;
             }
 
+            if ( xc_dom_kernel_check_size(dom, outsize * 2) )
+            {
+                DOMPRINTF("%s: output too large", what);
+                free(out_buf);
+                goto lzma_cleanup;
+            }
+
             tmp_buf = realloc(out_buf, outsize * 2);
             if ( tmp_buf == NULL )
             {
@@ -359,6 +396,12 @@ static int xc_try_lzo1x_decode(
         0x89, 0x4c, 0x5a, 0x4f, 0x00, 0x0d, 0x0a, 0x1a, 0x0a
     };
 
+    /*
+     * lzo_uint should match size_t. Check that this is the case to be
+     * sure we won't overflow various lzo_uint fields.
+     */
+    XC_BUILD_BUG_ON(sizeof(lzo_uint) != sizeof(size_t));
+
     ret = lzo_init();
     if ( ret != LZO_E_OK )
     {
@@ -438,6 +481,14 @@ static int xc_try_lzo1x_decode(
         if ( src_len <= 0 || src_len > dst_len || src_len > left )
             break;
 
+        msg = "Output buffer overflow";
+        if ( *size > SIZE_MAX - dst_len )
+            break;
+
+        msg = "Decompressed image too large";
+        if ( xc_dom_kernel_check_size(dom, *size + dst_len) )
+            break;
+
         msg = "Failed to (re)alloc memory";
         tmp_buf = realloc(out_buf, *size + dst_len);
         if ( tmp_buf == NULL )
diff -r 6f9e46917eb8 -r 37a8946eeb9d tools/libxc/xc_dom_core.c
--- a/tools/libxc/xc_dom_core.c	Fri Oct 26 12:05:08 2012 +0100
+++ b/tools/libxc/xc_dom_core.c	Fri Oct 26 16:09:29 2012 +0100
@@ -159,7 +159,8 @@ void *xc_dom_malloc_page_aligned(struct 
 }
 
 void *xc_dom_malloc_filemap(struct xc_dom_image *dom,
-                            const char *filename, size_t * size)
+                            const char *filename, size_t * size,
+                            const size_t max_size)
 {
     struct xc_dom_mem *block = NULL;
     int fd = -1;
@@ -171,6 +172,13 @@ void *xc_dom_malloc_filemap(struct xc_do
     lseek(fd, 0, SEEK_SET);
     *size = lseek(fd, 0, SEEK_END);
 
+    if ( max_size && *size > max_size )
+    {
+        xc_dom_panic(dom->xch, XC_OUT_OF_MEMORY,
+                     "tried to map file which is too large");
+        goto err;
+    }
+
     block = malloc(sizeof(*block));
     if ( block == NULL )
         goto err;
@@ -222,6 +230,40 @@ char *xc_dom_strdup(struct xc_dom_image 
 }
 
 /* ------------------------------------------------------------------------ */
+/* decompression buffer sizing                                              */
+int xc_dom_kernel_check_size(struct xc_dom_image *dom, size_t sz)
+{
+    /* No limit */
+    if ( !dom->max_kernel_size )
+        return 0;
+
+    if ( sz > dom->max_kernel_size )
+    {
+        xc_dom_panic(dom->xch, XC_INVALID_KERNEL,
+                     "kernel image too large");
+        return 1;
+    }
+
+    return 0;
+}
+
+int xc_dom_ramdisk_check_size(struct xc_dom_image *dom, size_t sz)
+{
+    /* No limit */
+    if ( !dom->max_ramdisk_size )
+        return 0;
+
+    if ( sz > dom->max_ramdisk_size )
+    {
+        xc_dom_panic(dom->xch, XC_INVALID_KERNEL,
+                     "ramdisk image too large");
+        return 1;
+    }
+
+    return 0;
+}
+
+/* ------------------------------------------------------------------------ */
 /* read files, copy memory blocks, with transparent gunzip                  */
 
 size_t xc_dom_check_gzip(xc_interface *xch, void *blob, size_t ziplen)
@@ -235,7 +277,7 @@ size_t xc_dom_check_gzip(xc_interface *x
 
     gzlen = blob + ziplen - 4;
     unziplen = gzlen[3] << 24 | gzlen[2] << 16 | gzlen[1] << 8 | gzlen[0];
-    if ( (unziplen < 0) || (unziplen > (1024*1024*1024)) ) /* 1GB limit */
+    if ( (unziplen < 0) || (unziplen > XC_DOM_DECOMPRESS_MAX) )
     {
         xc_dom_printf
             (xch,
@@ -288,6 +330,9 @@ int xc_dom_try_gunzip(struct xc_dom_imag
     if ( unziplen == 0 )
         return 0;
 
+    if ( xc_dom_kernel_check_size(dom, unziplen) )
+        return 0;
+
     unzip = xc_dom_malloc(dom, unziplen);
     if ( unzip == NULL )
         return -1;
@@ -590,6 +635,9 @@ struct xc_dom_image *xc_dom_allocate(xc_
     memset(dom, 0, sizeof(*dom));
     dom->xch = xch;
 
+    dom->max_kernel_size = XC_DOM_DECOMPRESS_MAX;
+    dom->max_ramdisk_size = XC_DOM_DECOMPRESS_MAX;
+
     if ( cmdline )
         dom->cmdline = xc_dom_strdup(dom, cmdline);
     if ( features )
@@ -610,10 +658,25 @@ struct xc_dom_image *xc_dom_allocate(xc_
     return NULL;
 }
 
+int xc_dom_kernel_max_size(struct xc_dom_image *dom, size_t sz)
+{
+    DOMPRINTF("%s: kernel_max_size=%zx", __FUNCTION__, sz);
+    dom->max_kernel_size = sz;
+    return 0;
+}
+
+int xc_dom_ramdisk_max_size(struct xc_dom_image *dom, size_t sz)
+{
+    DOMPRINTF("%s: ramdisk_max_size=%zx", __FUNCTION__, sz);
+    dom->max_ramdisk_size = sz;
+    return 0;
+}
+
 int xc_dom_kernel_file(struct xc_dom_image *dom, const char *filename)
 {
     DOMPRINTF("%s: filename=\"%s\"", __FUNCTION__, filename);
-    dom->kernel_blob = xc_dom_malloc_filemap(dom, filename, &dom->kernel_size);
+    dom->kernel_blob = xc_dom_malloc_filemap(dom, filename, &dom->kernel_size,
+                                             dom->max_kernel_size);
     if ( dom->kernel_blob == NULL )
         return -1;
     return xc_dom_try_gunzip(dom, &dom->kernel_blob, &dom->kernel_size);
@@ -623,7 +686,9 @@ int xc_dom_ramdisk_file(struct xc_dom_im
 {
     DOMPRINTF("%s: filename=\"%s\"", __FUNCTION__, filename);
     dom->ramdisk_blob =
-        xc_dom_malloc_filemap(dom, filename, &dom->ramdisk_size);
+        xc_dom_malloc_filemap(dom, filename, &dom->ramdisk_size,
+                              dom->max_ramdisk_size);
+
     if ( dom->ramdisk_blob == NULL )
         return -1;
 //    return xc_dom_try_gunzip(dom, &dom->ramdisk_blob, &dom->ramdisk_size);
@@ -783,7 +848,11 @@ int xc_dom_build_image(struct xc_dom_ima
         void *ramdiskmap;
 
         unziplen = xc_dom_check_gzip(dom->xch, dom->ramdisk_blob, dom->ramdisk_size);
+        if ( xc_dom_ramdisk_check_size(dom, unziplen) != 0 )
+            unziplen = 0;
+
         ramdisklen = unziplen ? unziplen : dom->ramdisk_size;
+
         if ( xc_dom_alloc_segment(dom, &dom->ramdisk_seg, "ramdisk", 0,
                                   ramdisklen) != 0 )
             goto err;

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

From xen-changelog-bounces@lists.xen.org Tue Oct 30 04:00:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Oct 2012 04:00:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TT304-0000nr-OO; Tue, 30 Oct 2012 04:00:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT303-0000nO-6s
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:23 +0000
Received: from [85.158.143.35:18984] by server-1.bemta-4.messagelabs.com id
	30/0A-19134-6D05F805; Tue, 30 Oct 2012 04:00:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-21.messagelabs.com!1351569619!15604578!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11869 invoked from network); 30 Oct 2012 04:00:20 -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;
	30 Oct 2012 04:00:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT2zz-0001Wy-53
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT2zy-0007KH-Q0
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:18 +0000
Message-Id: <E1TT2zy-0007KH-Q0@xenbits.xen.org>
Date: Tue, 30 Oct 2012 04:00:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxc: builder: limit maximum size
	of kernel/ramdisk.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1351264169 -3600
# Node ID 37a8946eeb9db8b5eafc1c75aded006ad5322af8
# Parent  6f9e46917eb8771914041b98f714e8f485fca5ef
libxc: builder: limit maximum size of kernel/ramdisk.

Allowing user supplied kernels of arbitrary sizes, especially during
decompression, can swallow up dom0 memory leading to either virtual
address space exhaustion in the builder process or allocation
failures/OOM killing of both toolstack and unrelated processes.

We disable these checks when building in a stub domain for pvgrub
since this uses the guest's own memory and is isolated.

Decompression of gzip compressed kernels and ramdisks has been safe
since 14954:58205257517d (Xen 3.1.0 onwards).

This is XSA-25 / CVE-2012-4544.

Also make explicit checks for buffer overflows in various
decompression routines. These were already ruled out due to other
properties of the code but check them as a belt-and-braces measure.

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


diff -r 6f9e46917eb8 -r 37a8946eeb9d stubdom/grub/kexec.c
--- a/stubdom/grub/kexec.c	Fri Oct 26 12:05:08 2012 +0100
+++ b/stubdom/grub/kexec.c	Fri Oct 26 16:09:29 2012 +0100
@@ -137,6 +137,10 @@ void kexec(void *kernel, long kernel_siz
     dom = xc_dom_allocate(xc_handle, cmdline, features);
     dom->allocate = kexec_allocate;
 
+    /* We are using guest owned memory, therefore no limits. */
+    xc_dom_kernel_max_size(dom, 0);
+    xc_dom_ramdisk_max_size(dom, 0);
+
     dom->kernel_blob = kernel;
     dom->kernel_size = kernel_size;
 
diff -r 6f9e46917eb8 -r 37a8946eeb9d tools/libxc/xc_dom.h
--- a/tools/libxc/xc_dom.h	Fri Oct 26 12:05:08 2012 +0100
+++ b/tools/libxc/xc_dom.h	Fri Oct 26 16:09:29 2012 +0100
@@ -55,6 +55,9 @@ struct xc_dom_image {
     void *ramdisk_blob;
     size_t ramdisk_size;
 
+    size_t max_kernel_size;
+    size_t max_ramdisk_size;
+
     /* arguments and parameters */
     char *cmdline;
     uint32_t f_requested[XENFEAT_NR_SUBMAPS];
@@ -194,6 +197,23 @@ void xc_dom_release_phys(struct xc_dom_i
 void xc_dom_release(struct xc_dom_image *dom);
 int xc_dom_mem_init(struct xc_dom_image *dom, unsigned int mem_mb);
 
+/* Set this larger if you have enormous ramdisks/kernels. Note that
+ * you should trust all kernels not to be maliciously large (e.g. to
+ * exhaust all dom0 memory) if you do this (see CVE-2012-4544 /
+ * XSA-25). You can also set the default independently for
+ * ramdisks/kernels in xc_dom_allocate() or call
+ * xc_dom_{kernel,ramdisk}_max_size.
+ */
+#ifndef XC_DOM_DECOMPRESS_MAX
+#define XC_DOM_DECOMPRESS_MAX (1024*1024*1024) /* 1GB */
+#endif
+
+int xc_dom_kernel_check_size(struct xc_dom_image *dom, size_t sz);
+int xc_dom_kernel_max_size(struct xc_dom_image *dom, size_t sz);
+
+int xc_dom_ramdisk_check_size(struct xc_dom_image *dom, size_t sz);
+int xc_dom_ramdisk_max_size(struct xc_dom_image *dom, size_t sz);
+
 size_t xc_dom_check_gzip(xc_interface *xch,
                      void *blob, size_t ziplen);
 int xc_dom_do_gunzip(xc_interface *xch,
@@ -254,7 +274,8 @@ void xc_dom_log_memory_footprint(struct 
 void *xc_dom_malloc(struct xc_dom_image *dom, size_t size);
 void *xc_dom_malloc_page_aligned(struct xc_dom_image *dom, size_t size);
 void *xc_dom_malloc_filemap(struct xc_dom_image *dom,
-                            const char *filename, size_t * size);
+                            const char *filename, size_t * size,
+                            const size_t max_size);
 char *xc_dom_strdup(struct xc_dom_image *dom, const char *str);
 
 /* --- alloc memory pool ------------------------------------------- */
diff -r 6f9e46917eb8 -r 37a8946eeb9d tools/libxc/xc_dom_bzimageloader.c
--- a/tools/libxc/xc_dom_bzimageloader.c	Fri Oct 26 12:05:08 2012 +0100
+++ b/tools/libxc/xc_dom_bzimageloader.c	Fri Oct 26 16:09:29 2012 +0100
@@ -47,13 +47,19 @@ static int xc_try_bzip2_decode(
     char *out_buf;
     char *tmp_buf;
     int retval = -1;
-    int outsize;
+    unsigned int outsize;
     uint64_t total;
 
     stream.bzalloc = NULL;
     stream.bzfree = NULL;
     stream.opaque = NULL;
 
+    if ( dom->kernel_size == 0)
+    {
+        DOMPRINTF("BZIP2: Input is 0 size");
+        return -1;
+    }
+
     ret = BZ2_bzDecompressInit(&stream, 0, 0);
     if ( ret != BZ_OK )
     {
@@ -66,6 +72,17 @@ static int xc_try_bzip2_decode(
      * the input buffer to start, and we'll realloc as needed.
      */
     outsize = dom->kernel_size;
+
+    /*
+     * stream.avail_in and outsize are unsigned int, while kernel_size
+     * is a size_t. Check we aren't overflowing.
+     */
+    if ( outsize != dom->kernel_size )
+    {
+        DOMPRINTF("BZIP2: Input too large");
+        goto bzip2_cleanup;
+    }
+
     out_buf = malloc(outsize);
     if ( out_buf == NULL )
     {
@@ -98,13 +115,20 @@ static int xc_try_bzip2_decode(
         if ( stream.avail_out == 0 )
         {
             /* Protect against output buffer overflow */
-            if ( outsize > INT_MAX / 2 )
+            if ( outsize > UINT_MAX / 2 )
             {
                 DOMPRINTF("BZIP2: output buffer overflow");
                 free(out_buf);
                 goto bzip2_cleanup;
             }
 
+            if ( xc_dom_kernel_check_size(dom, outsize * 2) )
+            {
+                DOMPRINTF("BZIP2: output too large");
+                free(out_buf);
+                goto bzip2_cleanup;
+            }
+
             tmp_buf = realloc(out_buf, outsize * 2);
             if ( tmp_buf == NULL )
             {
@@ -172,9 +196,15 @@ static int _xc_try_lzma_decode(
     unsigned char *out_buf;
     unsigned char *tmp_buf;
     int retval = -1;
-    int outsize;
+    size_t outsize;
     const char *msg;
 
+    if ( dom->kernel_size == 0)
+    {
+        DOMPRINTF("%s: Input is 0 size", what);
+        return -1;
+    }
+
     /* sigh.  We don't know up-front how much memory we are going to need
      * for the output buffer.  Allocate the output buffer to be equal
      * the input buffer to start, and we'll realloc as needed.
@@ -244,13 +274,20 @@ static int _xc_try_lzma_decode(
         if ( stream->avail_out == 0 )
         {
             /* Protect against output buffer overflow */
-            if ( outsize > INT_MAX / 2 )
+            if ( outsize > SIZE_MAX / 2 )
             {
                 DOMPRINTF("%s: output buffer overflow", what);
                 free(out_buf);
                 goto lzma_cleanup;
             }
 
+            if ( xc_dom_kernel_check_size(dom, outsize * 2) )
+            {
+                DOMPRINTF("%s: output too large", what);
+                free(out_buf);
+                goto lzma_cleanup;
+            }
+
             tmp_buf = realloc(out_buf, outsize * 2);
             if ( tmp_buf == NULL )
             {
@@ -359,6 +396,12 @@ static int xc_try_lzo1x_decode(
         0x89, 0x4c, 0x5a, 0x4f, 0x00, 0x0d, 0x0a, 0x1a, 0x0a
     };
 
+    /*
+     * lzo_uint should match size_t. Check that this is the case to be
+     * sure we won't overflow various lzo_uint fields.
+     */
+    XC_BUILD_BUG_ON(sizeof(lzo_uint) != sizeof(size_t));
+
     ret = lzo_init();
     if ( ret != LZO_E_OK )
     {
@@ -438,6 +481,14 @@ static int xc_try_lzo1x_decode(
         if ( src_len <= 0 || src_len > dst_len || src_len > left )
             break;
 
+        msg = "Output buffer overflow";
+        if ( *size > SIZE_MAX - dst_len )
+            break;
+
+        msg = "Decompressed image too large";
+        if ( xc_dom_kernel_check_size(dom, *size + dst_len) )
+            break;
+
         msg = "Failed to (re)alloc memory";
         tmp_buf = realloc(out_buf, *size + dst_len);
         if ( tmp_buf == NULL )
diff -r 6f9e46917eb8 -r 37a8946eeb9d tools/libxc/xc_dom_core.c
--- a/tools/libxc/xc_dom_core.c	Fri Oct 26 12:05:08 2012 +0100
+++ b/tools/libxc/xc_dom_core.c	Fri Oct 26 16:09:29 2012 +0100
@@ -159,7 +159,8 @@ void *xc_dom_malloc_page_aligned(struct 
 }
 
 void *xc_dom_malloc_filemap(struct xc_dom_image *dom,
-                            const char *filename, size_t * size)
+                            const char *filename, size_t * size,
+                            const size_t max_size)
 {
     struct xc_dom_mem *block = NULL;
     int fd = -1;
@@ -171,6 +172,13 @@ void *xc_dom_malloc_filemap(struct xc_do
     lseek(fd, 0, SEEK_SET);
     *size = lseek(fd, 0, SEEK_END);
 
+    if ( max_size && *size > max_size )
+    {
+        xc_dom_panic(dom->xch, XC_OUT_OF_MEMORY,
+                     "tried to map file which is too large");
+        goto err;
+    }
+
     block = malloc(sizeof(*block));
     if ( block == NULL )
         goto err;
@@ -222,6 +230,40 @@ char *xc_dom_strdup(struct xc_dom_image 
 }
 
 /* ------------------------------------------------------------------------ */
+/* decompression buffer sizing                                              */
+int xc_dom_kernel_check_size(struct xc_dom_image *dom, size_t sz)
+{
+    /* No limit */
+    if ( !dom->max_kernel_size )
+        return 0;
+
+    if ( sz > dom->max_kernel_size )
+    {
+        xc_dom_panic(dom->xch, XC_INVALID_KERNEL,
+                     "kernel image too large");
+        return 1;
+    }
+
+    return 0;
+}
+
+int xc_dom_ramdisk_check_size(struct xc_dom_image *dom, size_t sz)
+{
+    /* No limit */
+    if ( !dom->max_ramdisk_size )
+        return 0;
+
+    if ( sz > dom->max_ramdisk_size )
+    {
+        xc_dom_panic(dom->xch, XC_INVALID_KERNEL,
+                     "ramdisk image too large");
+        return 1;
+    }
+
+    return 0;
+}
+
+/* ------------------------------------------------------------------------ */
 /* read files, copy memory blocks, with transparent gunzip                  */
 
 size_t xc_dom_check_gzip(xc_interface *xch, void *blob, size_t ziplen)
@@ -235,7 +277,7 @@ size_t xc_dom_check_gzip(xc_interface *x
 
     gzlen = blob + ziplen - 4;
     unziplen = gzlen[3] << 24 | gzlen[2] << 16 | gzlen[1] << 8 | gzlen[0];
-    if ( (unziplen < 0) || (unziplen > (1024*1024*1024)) ) /* 1GB limit */
+    if ( (unziplen < 0) || (unziplen > XC_DOM_DECOMPRESS_MAX) )
     {
         xc_dom_printf
             (xch,
@@ -288,6 +330,9 @@ int xc_dom_try_gunzip(struct xc_dom_imag
     if ( unziplen == 0 )
         return 0;
 
+    if ( xc_dom_kernel_check_size(dom, unziplen) )
+        return 0;
+
     unzip = xc_dom_malloc(dom, unziplen);
     if ( unzip == NULL )
         return -1;
@@ -590,6 +635,9 @@ struct xc_dom_image *xc_dom_allocate(xc_
     memset(dom, 0, sizeof(*dom));
     dom->xch = xch;
 
+    dom->max_kernel_size = XC_DOM_DECOMPRESS_MAX;
+    dom->max_ramdisk_size = XC_DOM_DECOMPRESS_MAX;
+
     if ( cmdline )
         dom->cmdline = xc_dom_strdup(dom, cmdline);
     if ( features )
@@ -610,10 +658,25 @@ struct xc_dom_image *xc_dom_allocate(xc_
     return NULL;
 }
 
+int xc_dom_kernel_max_size(struct xc_dom_image *dom, size_t sz)
+{
+    DOMPRINTF("%s: kernel_max_size=%zx", __FUNCTION__, sz);
+    dom->max_kernel_size = sz;
+    return 0;
+}
+
+int xc_dom_ramdisk_max_size(struct xc_dom_image *dom, size_t sz)
+{
+    DOMPRINTF("%s: ramdisk_max_size=%zx", __FUNCTION__, sz);
+    dom->max_ramdisk_size = sz;
+    return 0;
+}
+
 int xc_dom_kernel_file(struct xc_dom_image *dom, const char *filename)
 {
     DOMPRINTF("%s: filename=\"%s\"", __FUNCTION__, filename);
-    dom->kernel_blob = xc_dom_malloc_filemap(dom, filename, &dom->kernel_size);
+    dom->kernel_blob = xc_dom_malloc_filemap(dom, filename, &dom->kernel_size,
+                                             dom->max_kernel_size);
     if ( dom->kernel_blob == NULL )
         return -1;
     return xc_dom_try_gunzip(dom, &dom->kernel_blob, &dom->kernel_size);
@@ -623,7 +686,9 @@ int xc_dom_ramdisk_file(struct xc_dom_im
 {
     DOMPRINTF("%s: filename=\"%s\"", __FUNCTION__, filename);
     dom->ramdisk_blob =
-        xc_dom_malloc_filemap(dom, filename, &dom->ramdisk_size);
+        xc_dom_malloc_filemap(dom, filename, &dom->ramdisk_size,
+                              dom->max_ramdisk_size);
+
     if ( dom->ramdisk_blob == NULL )
         return -1;
 //    return xc_dom_try_gunzip(dom, &dom->ramdisk_blob, &dom->ramdisk_size);
@@ -783,7 +848,11 @@ int xc_dom_build_image(struct xc_dom_ima
         void *ramdiskmap;
 
         unziplen = xc_dom_check_gzip(dom->xch, dom->ramdisk_blob, dom->ramdisk_size);
+        if ( xc_dom_ramdisk_check_size(dom, unziplen) != 0 )
+            unziplen = 0;
+
         ramdisklen = unziplen ? unziplen : dom->ramdisk_size;
+
         if ( xc_dom_alloc_segment(dom, &dom->ramdisk_seg, "ramdisk", 0,
                                   ramdisklen) != 0 )
             goto err;

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

From xen-changelog-bounces@lists.xen.org Tue Oct 30 04:00:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Oct 2012 04:00:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TT304-0000o0-R6; Tue, 30 Oct 2012 04:00:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT303-0000nO-SN
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:23 +0000
Received: from [85.158.143.99:58243] by server-1.bemta-4.messagelabs.com id
	F1/0A-19134-7D05F805; Tue, 30 Oct 2012 04:00:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-216.messagelabs.com!1351569620!20336620!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28856 invoked from network); 30 Oct 2012 04:00:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2012 04:00:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT300-0001X4-Hn
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT300-0007Kr-Ci
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:20 +0000
Message-Id: <E1TT300-0007Kr-Ci@xenbits.xen.org>
Date: Tue, 30 Oct 2012 04:00:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/MCE: remove K7 support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1351519598 -3600
# Node ID c3dafc201ad38e91e2914bac0f3548848462854c
# Parent  f9ded6e9e554b66ff6d8a0181f70e1dca2517e90
x86/MCE: remove K7 support

Remove K7 support from MCE.

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


diff -r f9ded6e9e554 -r c3dafc201ad3 xen/arch/x86/cpu/mcheck/Makefile
--- a/xen/arch/x86/cpu/mcheck/Makefile	Mon Oct 29 15:04:35 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/Makefile	Mon Oct 29 15:06:38 2012 +0100
@@ -1,5 +1,4 @@
 obj-y += amd_nonfatal.o
-obj-y += k7.o
 obj-y += amd_k8.o
 obj-y += amd_f10.o
 obj-y += mce_amd.o
diff -r f9ded6e9e554 -r c3dafc201ad3 xen/arch/x86/cpu/mcheck/k7.c
--- a/xen/arch/x86/cpu/mcheck/k7.c	Mon Oct 29 15:04:35 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-/*
- * Athlon/Hammer specific Machine Check Exception Reporting
- * (C) Copyright 2002 Dave Jones <davej@codemonkey.org.uk>
- */
-
-#include <xen/init.h>
-#include <xen/types.h>
-#include <xen/kernel.h>
-#include <xen/config.h>
-#include <xen/smp.h>
-
-#include <asm/processor.h> 
-#include <asm/system.h>
-#include <asm/msr.h>
-
-#include "mce.h"
-#include "x86_mca.h"
-
-/* Machine Check Handler For AMD Athlon/Duron */
-static void k7_machine_check(struct cpu_user_regs * regs, long error_code)
-{
-	int recover = 1;
-	uint64_t msr_content, mcgst;
-	int i;
-
-	rdmsrl(MSR_IA32_MCG_STATUS, mcgst);
-	if (mcgst & MCG_STATUS_RIPV)	/* Recoverable ? */
-		recover = 0;
-
-	printk(KERN_EMERG "CPU %d: Machine Check Exception: 0x%016"PRIx64"\n",
-		smp_processor_id(), mcgst);
-
-	for (i = 1; i < nr_mce_banks; i++) {
-		uint64_t value;
-
-		rdmsrl(MSR_IA32_MCx_STATUS(i), msr_content);
-		if (msr_content & MCi_STATUS_VAL) {
-			if (msr_content & MCi_STATUS_UC)
-				recover |= 1;
-			if (msr_content & MCi_STATUS_PCC)
-				recover |= 2;
-			printk(KERN_EMERG "Bank %d: 0x%16"PRIx64,
-				i, msr_content);
-			msr_content &= ~MCi_STATUS_VAL;
-			if (msr_content & MCi_STATUS_MISCV) {
-				rdmsrl(MSR_IA32_MCx_MISC(i), value);
-				printk("[0x%016"PRIx64"]", value);
-			}
-			if (msr_content & MCi_STATUS_ADDRV) {
-				rdmsrl(MSR_IA32_MCx_ADDR(i), value);
-				printk(" at 0x%016"PRIx64, value);
-			}
-			printk("\n");
-			/* Clear it */
-			wrmsrl(MSR_IA32_MCx_STATUS(i), 0x0ULL);
-			/* Serialize */
-			wmb();
-			add_taint(TAINT_MACHINE_CHECK);
-		}
-	}
-
-	if (recover & 2)
-		mc_panic("CPU context corrupt");
-	if (recover & 1)
-		mc_panic("Unable to continue");
-	printk(KERN_EMERG "Attempting to continue.\n");
-	mcgst &= ~MCG_STATUS_MCIP;
-	wrmsrl(MSR_IA32_MCG_STATUS, mcgst);
-}
-
-
-/* AMD K7 machine check */
-enum mcheck_type amd_k7_mcheck_init(struct cpuinfo_x86 *c)
-{
-	int i;
-
-	x86_mce_vector_register(k7_machine_check);
-
-	/* Clear status for MC index 0 separately, we don't touch CTL,
-	 * as some Athlons cause spurious MCEs when its enabled. */
-	wrmsrl(MSR_IA32_MC0_STATUS, 0x0ULL);
-	for (i = 1; i < nr_mce_banks; i++) {
-		wrmsrl(MSR_IA32_MCx_CTL(i), 0xffffffffffffffffULL);
-		wrmsrl(MSR_IA32_MCx_STATUS(i), 0x0ULL);
-	}
-
-	return mcheck_amd_k7;
-}
diff -r f9ded6e9e554 -r c3dafc201ad3 xen/arch/x86/cpu/mcheck/mce.c
--- a/xen/arch/x86/cpu/mcheck/mce.c	Mon Oct 29 15:04:35 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce.c	Mon Oct 29 15:06:38 2012 +0100
@@ -567,15 +567,12 @@ int mce_available(struct cpuinfo_x86 *c)
 }
 
 /*
- * Check if bank 0 is usable for MCE. It isn't for AMD K7,
- * and Intel P6 family before model 0x1a.
+ * Check if bank 0 is usable for MCE. It isn't for Intel P6 family
+ * before model 0x1a.
  */
 unsigned int mce_firstbank(struct cpuinfo_x86 *c)
 {
     if (c->x86 == 6) {
-        if (c->x86_vendor == X86_VENDOR_AMD)
-            return 1;
-
         if (c->x86_vendor == X86_VENDOR_INTEL && c->x86_model < 0x1a)
             return 1;
     }
@@ -591,7 +588,6 @@ int show_mca_info(int inited, struct cpu
         char prefix[20];
         static const char *const type_str[] = {
             [mcheck_amd_famXX] = "AMD",
-            [mcheck_amd_k7] = "AMD K7",
             [mcheck_amd_k8] = "AMD K8",
             [mcheck_intel] = "Intel"
         };
diff -r f9ded6e9e554 -r c3dafc201ad3 xen/arch/x86/cpu/mcheck/mce.h
--- a/xen/arch/x86/cpu/mcheck/mce.h	Mon Oct 29 15:04:35 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce.h	Mon Oct 29 15:06:38 2012 +0100
@@ -33,7 +33,6 @@ enum mcheck_type {
 	mcheck_unset = -1,
 	mcheck_none,
 	mcheck_amd_famXX,
-	mcheck_amd_k7,
 	mcheck_amd_k8,
 	mcheck_intel
 };
diff -r f9ded6e9e554 -r c3dafc201ad3 xen/arch/x86/cpu/mcheck/mce_amd.c
--- a/xen/arch/x86/cpu/mcheck/mce_amd.c	Mon Oct 29 15:04:35 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce_amd.c	Mon Oct 29 15:06:38 2012 +0100
@@ -106,10 +106,6 @@ amd_mcheck_init(struct cpuinfo_x86 *ci)
 
     switch ( ci->x86 )
     {
-    case 6:
-        rc = amd_k7_mcheck_init(ci);
-        break;
-
     default:
         /* Assume that machine check support is available.
          * The minimum provided support is at least the K8. */
diff -r f9ded6e9e554 -r c3dafc201ad3 xen/arch/x86/cpu/mcheck/mce_amd.h
--- a/xen/arch/x86/cpu/mcheck/mce_amd.h	Mon Oct 29 15:04:35 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce_amd.h	Mon Oct 29 15:06:38 2012 +0100
@@ -1,7 +1,6 @@
 #ifndef _MCHECK_AMD_H
 #define _MCHECK_AMD_H
 
-enum mcheck_type amd_k7_mcheck_init(struct cpuinfo_x86 *c);
 enum mcheck_type amd_k8_mcheck_init(struct cpuinfo_x86 *c);
 enum mcheck_type amd_f10_mcheck_init(struct cpuinfo_x86 *c);
 
diff -r f9ded6e9e554 -r c3dafc201ad3 xen/arch/x86/cpu/mcheck/mce_amd_quirks.c
--- a/xen/arch/x86/cpu/mcheck/mce_amd_quirks.c	Mon Oct 29 15:04:35 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce_amd_quirks.c	Mon Oct 29 15:06:38 2012 +0100
@@ -25,8 +25,6 @@
 #define ANY -1
 
 static const struct mce_quirkdata mce_amd_quirks[] = {
-	{ 0x6 /* cpu family */, ANY /* all models */, ANY /* all steppings */,
-	  MCEQUIRK_K7_BANK0 },
 	{ 0xf /* cpu family */, ANY /* all models */, ANY /* all steppings */,
 	  MCEQUIRK_K8_GART },
 	{ 0x10 /* cpu family */, ANY /* all models */, ANY /* all steppings */,
@@ -59,9 +57,6 @@ int mcequirk_amd_apply(enum mcequirk_amd
 	u64 val;
 
 	switch (flags) {
-	case MCEQUIRK_K7_BANK0:
-		return 1; /* first bank */
-
 	case MCEQUIRK_K8_GART:
 		/*
 		 * Enable error reporting for all errors except for GART
diff -r f9ded6e9e554 -r c3dafc201ad3 xen/arch/x86/cpu/mcheck/mce_quirks.h
--- a/xen/arch/x86/cpu/mcheck/mce_quirks.h	Mon Oct 29 15:04:35 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce_quirks.h	Mon Oct 29 15:06:38 2012 +0100
@@ -33,8 +33,7 @@ struct mce_quirkdata {
  */
 
 enum mcequirk_amd_flags {
-	MCEQUIRK_K7_BANK0 = 1,
-	MCEQUIRK_K8_GART,
+	MCEQUIRK_K8_GART = 2,
 	MCEQUIRK_F10_GART
 };
 
diff -r f9ded6e9e554 -r c3dafc201ad3 xen/arch/x86/cpu/mcheck/non-fatal.c
--- a/xen/arch/x86/cpu/mcheck/non-fatal.c	Mon Oct 29 15:04:35 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/non-fatal.c	Mon Oct 29 15:06:38 2012 +0100
@@ -102,12 +102,6 @@ static int __init init_nonfatal_mce_chec
 	 */
 	switch (c->x86_vendor) {
 	case X86_VENDOR_AMD:
-		if (c->x86 == 6) { /* K7 */
-			init_timer(&mce_timer, mce_work_fn, NULL, 0);
-			set_timer(&mce_timer, NOW() + MCE_PERIOD);
-			break;
-		}
-
 		/* Assume we are on K8 or newer AMD CPU here */
 		amd_nonfatal_mcheck_init(c);
 		break;
diff -r f9ded6e9e554 -r c3dafc201ad3 xen/arch/x86/cpu/mcheck/x86_mca.h
--- a/xen/arch/x86/cpu/mcheck/x86_mca.h	Mon Oct 29 15:04:35 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/x86_mca.h	Mon Oct 29 15:06:38 2012 +0100
@@ -1,6 +1,6 @@
 /*
- * MCA implementation for AMD K7/K8 CPUs
- * Copyright (c) 2007 Advanced Micro Devices, Inc. 
+ * MCA implementation for AMD CPUs
+ * Copyright (c) 2007-2012 Advanced Micro Devices, Inc. 
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by

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

From xen-changelog-bounces@lists.xen.org Tue Oct 30 04:00:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Oct 2012 04:00:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TT303-0000nY-LV; Tue, 30 Oct 2012 04:00:23 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT302-0000nA-3F
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:22 +0000
Received: from [85.158.143.99:58185] by server-2.bemta-4.messagelabs.com id
	C7/11-22268-5D05F805; Tue, 30 Oct 2012 04:00:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-216.messagelabs.com!1351569619!27304786!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2352 invoked from network); 30 Oct 2012 04:00:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2012 04:00:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT2zy-0001Wv-Oa
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT2zx-0007Jx-RB
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:18 +0000
Message-Id: <E1TT2zx-0007Jx-RB@xenbits.xen.org>
Date: Tue, 30 Oct 2012 04:00:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] pygrub: Add option to list grub
	entries
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Charles Arnold <carnold@suse.com>
# Date 1351249508 -3600
# Node ID 6f9e46917eb8771914041b98f714e8f485fca5ef
# Parent  03af0abd2b72dfab3f2e50dd502108de8603f741
pygrub: Add option to list grub entries

The argument to "--entry" allows 2 syntaxes, either directly the entry
number in menu.lst, or the whole string behind the "title" key word.
This poses the following issue:

>From Dom0 there is no way to guess the number and, or the complete
title string because this string contains the kernel version, which
will change with a kernel update.

This patch adds [-l|--list-entries] as an argument to pygrub.

Signed-off-by: Charles Arnold <carnold@suse.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 03af0abd2b72 -r 6f9e46917eb8 tools/pygrub/src/pygrub
--- a/tools/pygrub/src/pygrub	Fri Oct 26 12:03:12 2012 +0100
+++ b/tools/pygrub/src/pygrub	Fri Oct 26 12:05:08 2012 +0100
@@ -595,7 +595,17 @@ def run_grub(file, entry, fs, cfg_args):
         sel = g.run()
 
     g = Grub(file, fs)
-    if interactive:
+
+    if list_entries:
+        for i in range(len(g.cf.images)):
+            img = g.cf.images[i]
+            print "title: %s" % img.title
+            print "  root: %s" % img.root
+            print "  kernel: %s" % img.kernel[1]
+            print "  args: %s" % img.args
+            print "  initrd: %s" % img.initrd[1]
+
+    if interactive and not list_entries:
         curses.wrapper(run_main)
     else:
         sel = g.cf.default
@@ -702,7 +712,7 @@ if __name__ == "__main__":
     sel = None
     
     def usage():
-        print >> sys.stderr, "Usage: %s [-q|--quiet] [-i|--interactive] [-n|--not-really] [--output=] [--kernel=] [--ramdisk=] [--args=] [--entry=] [--output-directory=] [--output-format=sxp|simple|simple0] <image>" %(sys.argv[0],)
+        print >> sys.stderr, "Usage: %s [-q|--quiet] [-i|--interactive] [-l|--list-entries] [-n|--not-really] [--output=] [--kernel=] [--ramdisk=] [--args=] [--entry=] [--output-directory=] [--output-format=sxp|simple|simple0] <image>" %(sys.argv[0],)
 
     def copy_from_image(fs, file_to_read, file_type, output_directory,
                         not_really):
@@ -736,8 +746,8 @@ if __name__ == "__main__":
             dataoff += len(data)
 
     try:
-        opts, args = getopt.gnu_getopt(sys.argv[1:], 'qinh::',
-                                   ["quiet", "interactive", "not-really", "help", 
+        opts, args = getopt.gnu_getopt(sys.argv[1:], 'qilnh::',
+                                   ["quiet", "interactive", "list-entries", "not-really", "help",
                                     "output=", "output-format=", "output-directory=",
                                     "entry=", "kernel=", 
                                     "ramdisk=", "args=", "isconfig", "debug"])
@@ -753,6 +763,7 @@ if __name__ == "__main__":
     output = None
     entry = None
     interactive = True
+    list_entries = False
     isconfig = False
     debug = False
     not_really = False
@@ -771,6 +782,8 @@ if __name__ == "__main__":
             interactive = False
         elif o in ("-i", "--interactive"):
             interactive = True
+        elif o in ("-l", "--list-entries"):
+            list_entries = True
         elif o in ("-n", "--not-really"):
             not_really = True
         elif o in ("-h", "--help"):
@@ -855,6 +868,9 @@ if __name__ == "__main__":
             fs = None
             continue
 
+    if list_entries:
+        sys.exit(0)
+
     # Did looping through partitions find us a kernel?
     if not fs:
         raise RuntimeError, "Unable to find partition containing kernel"

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

From xen-changelog-bounces@lists.xen.org Tue Oct 30 04:00:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Oct 2012 04:00:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TT301-0000n5-D9; Tue, 30 Oct 2012 04:00:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT300-0000mz-IU
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:20 +0000
Received: from [85.158.139.211:25326] by server-7.bemta-5.messagelabs.com id
	0E/BD-23102-3D05F805; Tue, 30 Oct 2012 04:00:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-206.messagelabs.com!1351569617!18077381!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26591 invoked from network); 30 Oct 2012 04:00:18 -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;
	30 Oct 2012 04:00:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT2zx-0001Ws-Hv
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT2zx-0007Je-4X
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:17 +0000
Message-Id: <E1TT2zx-0007Je-4X@xenbits.xen.org>
Date: Tue, 30 Oct 2012 04:00:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: Do not leak events when a domain
	exits.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1351249392 -3600
# Node ID 03af0abd2b72dfab3f2e50dd502108de8603f741
# Parent  d07692b5c780d5e2a9f86bdd77d6627bdf67aa68
xl: Do not leak events when a domain exits.

The goto in both of these places misses the event free which would
normally clean up.

==8655== 80 bytes in 1 blocks are definitely lost in loss record 1 of 1
==8655==    at 0x4024370: calloc (vg_replace_malloc.c:593)
==8655==    by 0x406EAAE: libxl__zalloc (libxl_internal.c:83)
==8655==    by 0x4078173: libxl__event_new (libxl_event.c:1167)
==8655==    by 0x4056373: domain_death_occurred (libxl.c:958)
==8655==    by 0x4058D06: domain_death_xswatch_callback (libxl.c:1038)
==8655==    by 0x4078EB5: watchfd_callback (libxl_event.c:458)
==8655==    by 0x407839E: afterpoll_internal (libxl_event.c:949)
==8655==    by 0x4079142: eventloop_iteration (libxl_event.c:1371)
==8655==    by 0x40799BB: libxl_event_wait (libxl_event.c:1396)
==8655==    by 0x805CC67: create_domain (xl_cmdimpl.c:1698)
==8655==    by 0x805E001: main_create (xl_cmdimpl.c:3986)
==8655==    by 0x804D43D: main (xl.c:285)

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


diff -r d07692b5c780 -r 03af0abd2b72 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Fri Oct 26 11:39:42 2012 +0100
+++ b/tools/libxl/xl_cmdimpl.c	Fri Oct 26 12:03:12 2012 +0100
@@ -2118,6 +2118,7 @@ start:
 
             case 0:
                 LOG("Done. Exiting now");
+                libxl_event_free(ctx, event);
                 ret = 0;
                 goto out;
 
@@ -2127,6 +2128,7 @@ start:
 
         case LIBXL_EVENT_TYPE_DOMAIN_DEATH:
             LOG("Domain %d has been destroyed.", domid);
+            libxl_event_free(ctx, event);
             ret = 0;
             goto out;
 

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

From xen-changelog-bounces@lists.xen.org Tue Oct 30 04:00:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Oct 2012 04:00:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TT302-0000nJ-Fx; Tue, 30 Oct 2012 04:00:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT301-0000n4-PA
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:22 +0000
Received: from [85.158.137.99:13719] by server-9.bemta-3.messagelabs.com id
	77/0C-16841-4D05F805; Tue, 30 Oct 2012 04:00:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-217.messagelabs.com!1351569617!18750698!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24882 invoked from network); 30 Oct 2012 04:00:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2012 04:00:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT2zw-0001Wp-Rw
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT2zt-0007IS-EB
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:15 +0000
Message-Id: <E1TT2zt-0007IS-EB@xenbits.xen.org>
Date: Tue, 30 Oct 2012 04:00:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Revert 26109:6ccfe4d29f95
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1351247982 -3600
# Node ID d07692b5c780d5e2a9f86bdd77d6627bdf67aa68
# Parent  c26e1a79fe77735410d5712348a612fa4b1e377f
Revert 26109:6ccfe4d29f95

This changeset was contaminated by changes hanging around in my
working tree.  Sorry :-(.

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


diff -r c26e1a79fe77 -r d07692b5c780 stubdom/grub/kexec.c
--- a/stubdom/grub/kexec.c	Thu Oct 25 17:12:55 2012 +0100
+++ b/stubdom/grub/kexec.c	Fri Oct 26 11:39:42 2012 +0100
@@ -137,10 +137,6 @@ void kexec(void *kernel, long kernel_siz
     dom = xc_dom_allocate(xc_handle, cmdline, features);
     dom->allocate = kexec_allocate;
 
-    /* We are using guest owned memory, therefore no limits. */
-    xc_dom_kernel_max_size(dom, 0);
-    xc_dom_ramdisk_max_size(dom, 0);
-
     dom->kernel_blob = kernel;
     dom->kernel_size = kernel_size;
 
diff -r c26e1a79fe77 -r d07692b5c780 tools/libxc/xc_dom.h
--- a/tools/libxc/xc_dom.h	Thu Oct 25 17:12:55 2012 +0100
+++ b/tools/libxc/xc_dom.h	Fri Oct 26 11:39:42 2012 +0100
@@ -55,9 +55,6 @@ struct xc_dom_image {
     void *ramdisk_blob;
     size_t ramdisk_size;
 
-    size_t max_kernel_size;
-    size_t max_ramdisk_size;
-
     /* arguments and parameters */
     char *cmdline;
     uint32_t f_requested[XENFEAT_NR_SUBMAPS];
@@ -197,13 +194,6 @@ void xc_dom_release_phys(struct xc_dom_i
 void xc_dom_release(struct xc_dom_image *dom);
 int xc_dom_mem_init(struct xc_dom_image *dom, unsigned int mem_mb);
 
-#define XC_DOM_DECOMPRESS_MAX (1024*1024*1024) /* 1GB */
-int xc_dom_kernel_check_size(struct xc_dom_image *dom, size_t sz);
-int xc_dom_kernel_max_size(struct xc_dom_image *dom, size_t sz);
-
-int xc_dom_ramdisk_check_size(struct xc_dom_image *dom, size_t sz);
-int xc_dom_ramdisk_max_size(struct xc_dom_image *dom, size_t sz);
-
 size_t xc_dom_check_gzip(xc_interface *xch,
                      void *blob, size_t ziplen);
 int xc_dom_do_gunzip(xc_interface *xch,
@@ -264,8 +254,7 @@ void xc_dom_log_memory_footprint(struct 
 void *xc_dom_malloc(struct xc_dom_image *dom, size_t size);
 void *xc_dom_malloc_page_aligned(struct xc_dom_image *dom, size_t size);
 void *xc_dom_malloc_filemap(struct xc_dom_image *dom,
-                            const char *filename, size_t * size,
-                            const size_t max_size);
+                            const char *filename, size_t * size);
 char *xc_dom_strdup(struct xc_dom_image *dom, const char *str);
 
 /* --- alloc memory pool ------------------------------------------- */
diff -r c26e1a79fe77 -r d07692b5c780 tools/libxc/xc_dom_bzimageloader.c
--- a/tools/libxc/xc_dom_bzimageloader.c	Thu Oct 25 17:12:55 2012 +0100
+++ b/tools/libxc/xc_dom_bzimageloader.c	Fri Oct 26 11:39:42 2012 +0100
@@ -47,7 +47,7 @@ static int xc_try_bzip2_decode(
     char *out_buf;
     char *tmp_buf;
     int retval = -1;
-    unsigned int outsize;
+    int outsize;
     uint64_t total;
 
     stream.bzalloc = NULL;
@@ -79,17 +79,6 @@ static int xc_try_bzip2_decode(
     stream.next_out = out_buf;
     stream.avail_out = dom->kernel_size;
 
-    /*
-     * stream.avail_in is an unsigned int, while kernel_size is a
-     * size_t. Check we aren't overflowing.
-     */
-    if ( stream.avail_in != dom->kernel_size )
-    {
-        DOMPRINTF("BZIP2: Input too large");
-        free(out_buf);
-        goto bzip2_cleanup;
-    }
-
     for ( ; ; )
     {
         ret = BZ2_bzDecompress(&stream);
@@ -109,20 +98,13 @@ static int xc_try_bzip2_decode(
         if ( stream.avail_out == 0 )
         {
             /* Protect against output buffer overflow */
-            if ( outsize > UINT_MAX / 2 )
+            if ( outsize > INT_MAX / 2 )
             {
                 DOMPRINTF("BZIP2: output buffer overflow");
                 free(out_buf);
                 goto bzip2_cleanup;
             }
 
-            if ( xc_dom_kernel_check_size(dom, outsize * 2) )
-            {
-                DOMPRINTF("BZIP2: output too large");
-                free(out_buf);
-                goto bzip2_cleanup;
-            }
-
             tmp_buf = realloc(out_buf, outsize * 2);
             if ( tmp_buf == NULL )
             {
@@ -190,7 +172,7 @@ static int _xc_try_lzma_decode(
     unsigned char *out_buf;
     unsigned char *tmp_buf;
     int retval = -1;
-    size_t outsize;
+    int outsize;
     const char *msg;
 
     /* sigh.  We don't know up-front how much memory we are going to need
@@ -262,20 +244,13 @@ static int _xc_try_lzma_decode(
         if ( stream->avail_out == 0 )
         {
             /* Protect against output buffer overflow */
-            if ( outsize > SIZE_MAX / 2 )
+            if ( outsize > INT_MAX / 2 )
             {
                 DOMPRINTF("%s: output buffer overflow", what);
                 free(out_buf);
                 goto lzma_cleanup;
             }
 
-            if ( xc_dom_kernel_check_size(dom, outsize * 2) )
-            {
-                DOMPRINTF("%s: output too large", what);
-                free(out_buf);
-                goto lzma_cleanup;
-            }
-
             tmp_buf = realloc(out_buf, outsize * 2);
             if ( tmp_buf == NULL )
             {
@@ -384,12 +359,6 @@ static int xc_try_lzo1x_decode(
         0x89, 0x4c, 0x5a, 0x4f, 0x00, 0x0d, 0x0a, 0x1a, 0x0a
     };
 
-    /*
-     * lzo_uint should match size_t. Check that this is the case to be
-     * sure we won't overflow various lzo_uint fields.
-     */
-    XC_BUILD_BUG_ON(sizeof(lzo_uint) != sizeof(size_t));
-
     ret = lzo_init();
     if ( ret != LZO_E_OK )
     {
@@ -469,14 +438,6 @@ static int xc_try_lzo1x_decode(
         if ( src_len <= 0 || src_len > dst_len || src_len > left )
             break;
 
-        msg = "Output buffer overflow";
-        if ( *size > SIZE_MAX - dst_len )
-            break;
-
-        msg = "Decompressed image too large";
-        if ( xc_dom_kernel_check_size(dom, *size + dst_len) )
-            break;
-
         msg = "Failed to (re)alloc memory";
         tmp_buf = realloc(out_buf, *size + dst_len);
         if ( tmp_buf == NULL )
diff -r c26e1a79fe77 -r d07692b5c780 tools/libxc/xc_dom_core.c
--- a/tools/libxc/xc_dom_core.c	Thu Oct 25 17:12:55 2012 +0100
+++ b/tools/libxc/xc_dom_core.c	Fri Oct 26 11:39:42 2012 +0100
@@ -159,8 +159,7 @@ void *xc_dom_malloc_page_aligned(struct 
 }
 
 void *xc_dom_malloc_filemap(struct xc_dom_image *dom,
-                            const char *filename, size_t * size,
-                            const size_t max_size)
+                            const char *filename, size_t * size)
 {
     struct xc_dom_mem *block = NULL;
     int fd = -1;
@@ -172,13 +171,6 @@ void *xc_dom_malloc_filemap(struct xc_do
     lseek(fd, 0, SEEK_SET);
     *size = lseek(fd, 0, SEEK_END);
 
-    if ( max_size && *size > max_size )
-    {
-        xc_dom_panic(dom->xch, XC_OUT_OF_MEMORY,
-                     "tried to map file which is too large");
-        goto err;
-    }
-
     block = malloc(sizeof(*block));
     if ( block == NULL )
         goto err;
@@ -230,40 +222,6 @@ char *xc_dom_strdup(struct xc_dom_image 
 }
 
 /* ------------------------------------------------------------------------ */
-/* decompression buffer sizing                                              */
-int xc_dom_kernel_check_size(struct xc_dom_image *dom, size_t sz)
-{
-    /* No limit */
-    if ( !dom->max_kernel_size )
-        return 0;
-
-    if ( sz > dom->max_kernel_size )
-    {
-        xc_dom_panic(dom->xch, XC_INVALID_KERNEL,
-                     "kernel image too large");
-        return 1;
-    }
-
-    return 0;
-}
-
-int xc_dom_ramdisk_check_size(struct xc_dom_image *dom, size_t sz)
-{
-    /* No limit */
-    if ( !dom->max_ramdisk_size )
-        return 0;
-
-    if ( sz > dom->max_ramdisk_size )
-    {
-        xc_dom_panic(dom->xch, XC_INVALID_KERNEL,
-                     "ramdisk image too large");
-        return 1;
-    }
-
-    return 0;
-}
-
-/* ------------------------------------------------------------------------ */
 /* read files, copy memory blocks, with transparent gunzip                  */
 
 size_t xc_dom_check_gzip(xc_interface *xch, void *blob, size_t ziplen)
@@ -277,7 +235,7 @@ size_t xc_dom_check_gzip(xc_interface *x
 
     gzlen = blob + ziplen - 4;
     unziplen = gzlen[3] << 24 | gzlen[2] << 16 | gzlen[1] << 8 | gzlen[0];
-    if ( (unziplen < 0) || (unziplen > XC_DOM_DECOMPRESS_MAX) )
+    if ( (unziplen < 0) || (unziplen > (1024*1024*1024)) ) /* 1GB limit */
     {
         xc_dom_printf
             (xch,
@@ -330,9 +288,6 @@ int xc_dom_try_gunzip(struct xc_dom_imag
     if ( unziplen == 0 )
         return 0;
 
-    if ( xc_dom_kernel_check_size(dom, unziplen) )
-        return 0;
-
     unzip = xc_dom_malloc(dom, unziplen);
     if ( unzip == NULL )
         return -1;
@@ -635,9 +590,6 @@ struct xc_dom_image *xc_dom_allocate(xc_
     memset(dom, 0, sizeof(*dom));
     dom->xch = xch;
 
-    dom->max_kernel_size = XC_DOM_DECOMPRESS_MAX;
-    dom->max_ramdisk_size = XC_DOM_DECOMPRESS_MAX;
-
     if ( cmdline )
         dom->cmdline = xc_dom_strdup(dom, cmdline);
     if ( features )
@@ -658,25 +610,10 @@ struct xc_dom_image *xc_dom_allocate(xc_
     return NULL;
 }
 
-int xc_dom_kernel_max_size(struct xc_dom_image *dom, size_t sz)
-{
-    DOMPRINTF("%s: kernel_max_size=%zx", __FUNCTION__, sz);
-    dom->max_kernel_size = sz;
-    return 0;
-}
-
-int xc_dom_ramdisk_max_size(struct xc_dom_image *dom, size_t sz)
-{
-    DOMPRINTF("%s: ramdisk_max_size=%zx", __FUNCTION__, sz);
-    dom->max_ramdisk_size = sz;
-    return 0;
-}
-
 int xc_dom_kernel_file(struct xc_dom_image *dom, const char *filename)
 {
     DOMPRINTF("%s: filename=\"%s\"", __FUNCTION__, filename);
-    dom->kernel_blob = xc_dom_malloc_filemap(dom, filename, &dom->kernel_size,
-                                             dom->max_kernel_size);
+    dom->kernel_blob = xc_dom_malloc_filemap(dom, filename, &dom->kernel_size);
     if ( dom->kernel_blob == NULL )
         return -1;
     return xc_dom_try_gunzip(dom, &dom->kernel_blob, &dom->kernel_size);
@@ -685,10 +622,8 @@ int xc_dom_kernel_file(struct xc_dom_ima
 int xc_dom_ramdisk_file(struct xc_dom_image *dom, const char *filename)
 {
     DOMPRINTF("%s: filename=\"%s\"", __FUNCTION__, filename);
-    /* We do not enforce any particular size limit here */
     dom->ramdisk_blob =
-        xc_dom_malloc_filemap(dom, filename, &dom->ramdisk_size, 0);
-
+        xc_dom_malloc_filemap(dom, filename, &dom->ramdisk_size);
     if ( dom->ramdisk_blob == NULL )
         return -1;
 //    return xc_dom_try_gunzip(dom, &dom->ramdisk_blob, &dom->ramdisk_size);
@@ -848,11 +783,7 @@ int xc_dom_build_image(struct xc_dom_ima
         void *ramdiskmap;
 
         unziplen = xc_dom_check_gzip(dom->xch, dom->ramdisk_blob, dom->ramdisk_size);
-        if ( xc_dom_ramdisk_check_size(dom, unziplen) != 0 )
-            unziplen = 0;
-
         ramdisklen = unziplen ? unziplen : dom->ramdisk_size;
-
         if ( xc_dom_alloc_segment(dom, &dom->ramdisk_seg, "ramdisk", 0,
                                   ramdisklen) != 0 )
             goto err;
diff -r c26e1a79fe77 -r d07692b5c780 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Oct 25 17:12:55 2012 +0100
+++ b/tools/libxl/xl_cmdimpl.c	Fri Oct 26 11:39:42 2012 +0100
@@ -2118,7 +2118,6 @@ start:
 
             case 0:
                 LOG("Done. Exiting now");
-                libxl_event_free(ctx, event);
                 ret = 0;
                 goto out;
 
@@ -2128,7 +2127,6 @@ start:
 
         case LIBXL_EVENT_TYPE_DOMAIN_DEATH:
             LOG("Domain %d has been destroyed.", domid);
-            libxl_event_free(ctx, event);
             ret = 0;
             goto out;
 

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

From xen-changelog-bounces@lists.xen.org Tue Oct 30 04:00:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Oct 2012 04:00:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TT306-0000oM-4r; Tue, 30 Oct 2012 04:00:26 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT304-0000ni-II
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:24 +0000
Received: from [85.158.138.51:10694] by server-15.bemta-3.messagelabs.com id
	1A/F8-09445-7D05F805; Tue, 30 Oct 2012 04:00:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1351569621!27824231!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7571 invoked from network); 30 Oct 2012 04:00:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2012 04:00:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT301-0001X7-66
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT300-0007L7-Vy
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:21 +0000
Message-Id: <E1TT300-0007L7-Vy@xenbits.xen.org>
Date: Tue, 30 Oct 2012 04:00:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/MCE: merge AMD quirks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1351519695 -3600
# Node ID cd182580d88321aa89f48c71c18ad359d91460ec
# Parent  c3dafc201ad38e91e2914bac0f3548848462854c
x86/MCE: merge AMD quirks

merge mce_amd_quirks.c into mce_amd.c

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


diff -r c3dafc201ad3 -r cd182580d883 xen/arch/x86/cpu/mcheck/Makefile
--- a/xen/arch/x86/cpu/mcheck/Makefile	Mon Oct 29 15:06:38 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/Makefile	Mon Oct 29 15:08:15 2012 +0100
@@ -8,7 +8,6 @@ obj-y += mctelem.o
 obj-y += mce.o
 obj-y += mce-apei.o
 obj-y += mce_intel.o
-obj-y += mce_amd_quirks.o
 obj-y += non-fatal.o
 obj-y += util.o
 obj-y += vmce.o
diff -r c3dafc201ad3 -r cd182580d883 xen/arch/x86/cpu/mcheck/mce_amd.c
--- a/xen/arch/x86/cpu/mcheck/mce_amd.c	Mon Oct 29 15:06:38 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce_amd.c	Mon Oct 29 15:08:15 2012 +0100
@@ -21,12 +21,24 @@
 #include <xen/types.h>
 
 #include <asm/msr.h>
+#include <asm/processor.h>
 
 #include "mce.h"
 #include "x86_mca.h"
 #include "mce_amd.h"
 #include "mcaction.h"
 
+#include "mce_quirks.h"
+
+#define ANY -1
+
+static const struct mce_quirkdata mce_amd_quirks[] = {
+    { 0xf /* cpu family */, ANY /* all models */, ANY /* all steppings */,
+      MCEQUIRK_K8_GART },
+    { 0x10 /* cpu family */, ANY /* all models */, ANY /* all steppings */,
+      MCEQUIRK_F10_GART },
+};
+
 /* Error Code Types */
 enum mc_ec_type {
     MC_EC_TLB_TYPE = 0x0010,
@@ -99,6 +111,53 @@ mc_amd_addrcheck(uint64_t status, uint64
     return 0;
 }
 
+/* MC quirks */
+enum mcequirk_amd_flags
+mcequirk_lookup_amd_quirkdata(struct cpuinfo_x86 *c)
+{
+    int i;
+
+    BUG_ON(c->x86_vendor != X86_VENDOR_AMD);
+
+    for ( i = 0; i < ARRAY_SIZE(mce_amd_quirks); i++ )
+    {
+        if ( c->x86 != mce_amd_quirks[i].cpu_family )
+            continue;
+        if ( (mce_amd_quirks[i].cpu_model != ANY) &&
+             (mce_amd_quirks[i].cpu_model != c->x86_model) )
+            continue;
+        if ( (mce_amd_quirks[i].cpu_stepping != ANY) &&
+             (mce_amd_quirks[i].cpu_stepping != c->x86_mask) )
+                continue;
+        return mce_amd_quirks[i].quirk;
+    }
+    return 0;
+}
+
+int mcequirk_amd_apply(enum mcequirk_amd_flags flags)
+{
+    uint64_t val;
+
+    switch ( flags )
+    {
+    case MCEQUIRK_K8_GART:
+        /*
+         * Enable error reporting for all errors except for GART
+         * TBL walk error reporting, which trips off incorrectly
+         * with AGP GART & 3ware & Cerberus.
+         */
+        wrmsrl(MSR_IA32_MCx_CTL(4), ~(1ULL << 10));
+        wrmsrl(MSR_IA32_MCx_STATUS(4), 0ULL);
+        break;
+    case MCEQUIRK_F10_GART:
+        if ( rdmsr_safe(MSR_AMD64_MCx_MASK(4), val) == 0 )
+                wrmsr_safe(MSR_AMD64_MCx_MASK(4), val | (1 << 10));
+        break;
+    }
+
+    return 0;
+}
+
 enum mcheck_type
 amd_mcheck_init(struct cpuinfo_x86 *ci)
 {
diff -r c3dafc201ad3 -r cd182580d883 xen/arch/x86/cpu/mcheck/mce_amd_quirks.c
--- a/xen/arch/x86/cpu/mcheck/mce_amd_quirks.c	Mon Oct 29 15:06:38 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-/*
- * MCA quirks for AMD CPUs
- * Copyright (c) 2009 Advanced Micro Devices, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include <asm-x86/msr.h>
-#include <asm-x86/processor.h>
-
-#include "mce_quirks.h"
-
-#define ANY -1
-
-static const struct mce_quirkdata mce_amd_quirks[] = {
-	{ 0xf /* cpu family */, ANY /* all models */, ANY /* all steppings */,
-	  MCEQUIRK_K8_GART },
-	{ 0x10 /* cpu family */, ANY /* all models */, ANY /* all steppings */,
-	  MCEQUIRK_F10_GART },
-};
-
-enum mcequirk_amd_flags
-mcequirk_lookup_amd_quirkdata(struct cpuinfo_x86 *c)
-{
-	int i;
-
-	BUG_ON(c->x86_vendor != X86_VENDOR_AMD);
-
-	for (i = 0; i < ARRAY_SIZE(mce_amd_quirks); i++) {
-		if (c->x86 != mce_amd_quirks[i].cpu_family)
-			continue;
-		if ( (mce_amd_quirks[i].cpu_model != ANY) &&
-		     (mce_amd_quirks[i].cpu_model != c->x86_model) )
-			continue;
-		if ( (mce_amd_quirks[i].cpu_stepping != ANY) &&
-		     (mce_amd_quirks[i].cpu_stepping != c->x86_mask) )
-			continue;
-		return mce_amd_quirks[i].quirk;
-	}
-	return 0;
-}
-
-int mcequirk_amd_apply(enum mcequirk_amd_flags flags)
-{
-	u64 val;
-
-	switch (flags) {
-	case MCEQUIRK_K8_GART:
-		/*
-		 * Enable error reporting for all errors except for GART
-		 * TBL walk error reporting, which trips off incorrectly
-		 * with AGP GART & 3ware & Cerberus.
-		 */
-		wrmsrl(MSR_IA32_MCx_CTL(4), ~(1ULL << 10));
-		wrmsrl(MSR_IA32_MCx_STATUS(4), 0ULL);
-		break;
-	case MCEQUIRK_F10_GART:
-		if (rdmsr_safe(MSR_AMD64_MCx_MASK(4), val) == 0)
-			wrmsr_safe(MSR_AMD64_MCx_MASK(4), val | (1 << 10));
-		break;
-	}
-
-	return 0;
-}

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

From xen-changelog-bounces@lists.xen.org Tue Oct 30 04:00:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Oct 2012 04:00:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TT306-0000oM-4r; Tue, 30 Oct 2012 04:00:26 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT304-0000ni-II
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:24 +0000
Received: from [85.158.138.51:10694] by server-15.bemta-3.messagelabs.com id
	1A/F8-09445-7D05F805; Tue, 30 Oct 2012 04:00:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1351569621!27824231!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7571 invoked from network); 30 Oct 2012 04:00:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2012 04:00:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT301-0001X7-66
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT300-0007L7-Vy
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:21 +0000
Message-Id: <E1TT300-0007L7-Vy@xenbits.xen.org>
Date: Tue, 30 Oct 2012 04:00:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/MCE: merge AMD quirks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1351519695 -3600
# Node ID cd182580d88321aa89f48c71c18ad359d91460ec
# Parent  c3dafc201ad38e91e2914bac0f3548848462854c
x86/MCE: merge AMD quirks

merge mce_amd_quirks.c into mce_amd.c

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


diff -r c3dafc201ad3 -r cd182580d883 xen/arch/x86/cpu/mcheck/Makefile
--- a/xen/arch/x86/cpu/mcheck/Makefile	Mon Oct 29 15:06:38 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/Makefile	Mon Oct 29 15:08:15 2012 +0100
@@ -8,7 +8,6 @@ obj-y += mctelem.o
 obj-y += mce.o
 obj-y += mce-apei.o
 obj-y += mce_intel.o
-obj-y += mce_amd_quirks.o
 obj-y += non-fatal.o
 obj-y += util.o
 obj-y += vmce.o
diff -r c3dafc201ad3 -r cd182580d883 xen/arch/x86/cpu/mcheck/mce_amd.c
--- a/xen/arch/x86/cpu/mcheck/mce_amd.c	Mon Oct 29 15:06:38 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce_amd.c	Mon Oct 29 15:08:15 2012 +0100
@@ -21,12 +21,24 @@
 #include <xen/types.h>
 
 #include <asm/msr.h>
+#include <asm/processor.h>
 
 #include "mce.h"
 #include "x86_mca.h"
 #include "mce_amd.h"
 #include "mcaction.h"
 
+#include "mce_quirks.h"
+
+#define ANY -1
+
+static const struct mce_quirkdata mce_amd_quirks[] = {
+    { 0xf /* cpu family */, ANY /* all models */, ANY /* all steppings */,
+      MCEQUIRK_K8_GART },
+    { 0x10 /* cpu family */, ANY /* all models */, ANY /* all steppings */,
+      MCEQUIRK_F10_GART },
+};
+
 /* Error Code Types */
 enum mc_ec_type {
     MC_EC_TLB_TYPE = 0x0010,
@@ -99,6 +111,53 @@ mc_amd_addrcheck(uint64_t status, uint64
     return 0;
 }
 
+/* MC quirks */
+enum mcequirk_amd_flags
+mcequirk_lookup_amd_quirkdata(struct cpuinfo_x86 *c)
+{
+    int i;
+
+    BUG_ON(c->x86_vendor != X86_VENDOR_AMD);
+
+    for ( i = 0; i < ARRAY_SIZE(mce_amd_quirks); i++ )
+    {
+        if ( c->x86 != mce_amd_quirks[i].cpu_family )
+            continue;
+        if ( (mce_amd_quirks[i].cpu_model != ANY) &&
+             (mce_amd_quirks[i].cpu_model != c->x86_model) )
+            continue;
+        if ( (mce_amd_quirks[i].cpu_stepping != ANY) &&
+             (mce_amd_quirks[i].cpu_stepping != c->x86_mask) )
+                continue;
+        return mce_amd_quirks[i].quirk;
+    }
+    return 0;
+}
+
+int mcequirk_amd_apply(enum mcequirk_amd_flags flags)
+{
+    uint64_t val;
+
+    switch ( flags )
+    {
+    case MCEQUIRK_K8_GART:
+        /*
+         * Enable error reporting for all errors except for GART
+         * TBL walk error reporting, which trips off incorrectly
+         * with AGP GART & 3ware & Cerberus.
+         */
+        wrmsrl(MSR_IA32_MCx_CTL(4), ~(1ULL << 10));
+        wrmsrl(MSR_IA32_MCx_STATUS(4), 0ULL);
+        break;
+    case MCEQUIRK_F10_GART:
+        if ( rdmsr_safe(MSR_AMD64_MCx_MASK(4), val) == 0 )
+                wrmsr_safe(MSR_AMD64_MCx_MASK(4), val | (1 << 10));
+        break;
+    }
+
+    return 0;
+}
+
 enum mcheck_type
 amd_mcheck_init(struct cpuinfo_x86 *ci)
 {
diff -r c3dafc201ad3 -r cd182580d883 xen/arch/x86/cpu/mcheck/mce_amd_quirks.c
--- a/xen/arch/x86/cpu/mcheck/mce_amd_quirks.c	Mon Oct 29 15:06:38 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-/*
- * MCA quirks for AMD CPUs
- * Copyright (c) 2009 Advanced Micro Devices, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include <asm-x86/msr.h>
-#include <asm-x86/processor.h>
-
-#include "mce_quirks.h"
-
-#define ANY -1
-
-static const struct mce_quirkdata mce_amd_quirks[] = {
-	{ 0xf /* cpu family */, ANY /* all models */, ANY /* all steppings */,
-	  MCEQUIRK_K8_GART },
-	{ 0x10 /* cpu family */, ANY /* all models */, ANY /* all steppings */,
-	  MCEQUIRK_F10_GART },
-};
-
-enum mcequirk_amd_flags
-mcequirk_lookup_amd_quirkdata(struct cpuinfo_x86 *c)
-{
-	int i;
-
-	BUG_ON(c->x86_vendor != X86_VENDOR_AMD);
-
-	for (i = 0; i < ARRAY_SIZE(mce_amd_quirks); i++) {
-		if (c->x86 != mce_amd_quirks[i].cpu_family)
-			continue;
-		if ( (mce_amd_quirks[i].cpu_model != ANY) &&
-		     (mce_amd_quirks[i].cpu_model != c->x86_model) )
-			continue;
-		if ( (mce_amd_quirks[i].cpu_stepping != ANY) &&
-		     (mce_amd_quirks[i].cpu_stepping != c->x86_mask) )
-			continue;
-		return mce_amd_quirks[i].quirk;
-	}
-	return 0;
-}
-
-int mcequirk_amd_apply(enum mcequirk_amd_flags flags)
-{
-	u64 val;
-
-	switch (flags) {
-	case MCEQUIRK_K8_GART:
-		/*
-		 * Enable error reporting for all errors except for GART
-		 * TBL walk error reporting, which trips off incorrectly
-		 * with AGP GART & 3ware & Cerberus.
-		 */
-		wrmsrl(MSR_IA32_MCx_CTL(4), ~(1ULL << 10));
-		wrmsrl(MSR_IA32_MCx_STATUS(4), 0ULL);
-		break;
-	case MCEQUIRK_F10_GART:
-		if (rdmsr_safe(MSR_AMD64_MCx_MASK(4), val) == 0)
-			wrmsr_safe(MSR_AMD64_MCx_MASK(4), val | (1 << 10));
-		break;
-	}
-
-	return 0;
-}

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

From xen-changelog-bounces@lists.xen.org Tue Oct 30 04:00:31 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Oct 2012 04:00: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 1TT306-0000oS-7W; Tue, 30 Oct 2012 04:00:26 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT304-0000np-Pe
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:24 +0000
Received: from [85.158.143.35:19025] by server-3.bemta-4.messagelabs.com id
	E5/87-24279-8D05F805; Tue, 30 Oct 2012 04:00:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-21.messagelabs.com!1351569622!11839978!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24604 invoked from network); 30 Oct 2012 04:00:23 -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;
	30 Oct 2012 04:00:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT301-0001XA-Vw
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT301-0007LO-Lg
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:21 +0000
Message-Id: <E1TT301-0007LO-Lg@xenbits.xen.org>
Date: Tue, 30 Oct 2012 04:00:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] MCE: remove unused MCA_MCE_HANDLER
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1351519736 -3600
# Node ID 10feb09337081cd88d95a126abf575fddb500978
# Parent  cd182580d88321aa89f48c71c18ad359d91460ec
MCE: remove unused MCA_MCE_HANDLER

Remove unused MCA_MCE_HANDLER. MCA_MCE_SCAN is used everywhere instead.

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


diff -r cd182580d883 -r 10feb0933708 xen/arch/x86/cpu/mcheck/mce.c
--- a/xen/arch/x86/cpu/mcheck/mce.c	Mon Oct 29 15:08:15 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce.c	Mon Oct 29 15:08:56 2012 +0100
@@ -298,7 +298,6 @@ mcheck_mca_logout(enum mca_source who, s
 
     gstatus = mca_rdmsr(MSR_IA32_MCG_STATUS);
     switch (who) {
-    case MCA_MCE_HANDLER:
     case MCA_MCE_SCAN:
         mc_flags = MC_FLAG_MCE;
         which = MC_URGENT;
diff -r cd182580d883 -r 10feb0933708 xen/arch/x86/cpu/mcheck/mce.h
--- a/xen/arch/x86/cpu/mcheck/mce.h	Mon Oct 29 15:08:15 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce.h	Mon Oct 29 15:08:56 2012 +0100
@@ -100,7 +100,6 @@ static inline uint64_t mca_rdmsr(unsigne
  * of the MCA data observed in the logout operation. */
 
 enum mca_source {
-	MCA_MCE_HANDLER,
 	MCA_POLLER,
 	MCA_CMCI_HANDLER,
 	MCA_RESET,

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

From xen-changelog-bounces@lists.xen.org Tue Oct 30 04:00:31 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Oct 2012 04:00: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 1TT306-0000oS-7W; Tue, 30 Oct 2012 04:00:26 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT304-0000np-Pe
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:24 +0000
Received: from [85.158.143.35:19025] by server-3.bemta-4.messagelabs.com id
	E5/87-24279-8D05F805; Tue, 30 Oct 2012 04:00:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-21.messagelabs.com!1351569622!11839978!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24604 invoked from network); 30 Oct 2012 04:00:23 -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;
	30 Oct 2012 04:00:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT301-0001XA-Vw
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT301-0007LO-Lg
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:21 +0000
Message-Id: <E1TT301-0007LO-Lg@xenbits.xen.org>
Date: Tue, 30 Oct 2012 04:00:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] MCE: remove unused MCA_MCE_HANDLER
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1351519736 -3600
# Node ID 10feb09337081cd88d95a126abf575fddb500978
# Parent  cd182580d88321aa89f48c71c18ad359d91460ec
MCE: remove unused MCA_MCE_HANDLER

Remove unused MCA_MCE_HANDLER. MCA_MCE_SCAN is used everywhere instead.

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


diff -r cd182580d883 -r 10feb0933708 xen/arch/x86/cpu/mcheck/mce.c
--- a/xen/arch/x86/cpu/mcheck/mce.c	Mon Oct 29 15:08:15 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce.c	Mon Oct 29 15:08:56 2012 +0100
@@ -298,7 +298,6 @@ mcheck_mca_logout(enum mca_source who, s
 
     gstatus = mca_rdmsr(MSR_IA32_MCG_STATUS);
     switch (who) {
-    case MCA_MCE_HANDLER:
     case MCA_MCE_SCAN:
         mc_flags = MC_FLAG_MCE;
         which = MC_URGENT;
diff -r cd182580d883 -r 10feb0933708 xen/arch/x86/cpu/mcheck/mce.h
--- a/xen/arch/x86/cpu/mcheck/mce.h	Mon Oct 29 15:08:15 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce.h	Mon Oct 29 15:08:56 2012 +0100
@@ -100,7 +100,6 @@ static inline uint64_t mca_rdmsr(unsigne
  * of the MCA data observed in the logout operation. */
 
 enum mca_source {
-	MCA_MCE_HANDLER,
 	MCA_POLLER,
 	MCA_CMCI_HANDLER,
 	MCA_RESET,

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

From xen-changelog-bounces@lists.xen.org Tue Oct 30 04:00:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Oct 2012 04:00: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 1TT306-0000oX-A8; Tue, 30 Oct 2012 04:00:26 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT304-0000nq-S4
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:25 +0000
Received: from [193.109.254.147:46626] by server-8.bemta-14.messagelabs.com id
	3D/D6-16549-8D05F805; Tue, 30 Oct 2012 04:00:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-27.messagelabs.com!1351569620!3241492!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32120 invoked from network); 30 Oct 2012 04:00:21 -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;
	30 Oct 2012 04:00:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT300-0001X1-7a
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT2zz-0007KY-Hg
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:19 +0000
Message-Id: <E1TT2zz-0007KY-Hg@xenbits.xen.org>
Date: Tue, 30 Oct 2012 04:00:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/MCE: consolidate AMD
	initialization
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1351519475 -3600
# Node ID f9ded6e9e554b66ff6d8a0181f70e1dca2517e90
# Parent  37a8946eeb9db8b5eafc1c75aded006ad5322af8
x86/MCE: consolidate AMD initialization

Move AMD specific initialization to AMD files.

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


diff -r 37a8946eeb9d -r f9ded6e9e554 xen/arch/x86/cpu/mcheck/mce.c
--- a/xen/arch/x86/cpu/mcheck/mce.c	Fri Oct 26 16:09:29 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce.c	Mon Oct 29 15:04:35 2012 +0100
@@ -560,30 +560,6 @@ void mcheck_mca_clearbanks(struct mca_ba
     }
 }
 
-static enum mcheck_type amd_mcheck_init(struct cpuinfo_x86 *ci)
-{
-    enum mcheck_type rc = mcheck_none;
-
-    switch (ci->x86) {
-    case 6:
-        rc = amd_k7_mcheck_init(ci);
-        break;
-
-    default:
-        /* Assume that machine check support is available.
-         * The minimum provided support is at least the K8. */
-    case 0xf:
-        rc = amd_k8_mcheck_init(ci);
-        break;
-
-    case 0x10 ... 0x17:
-        rc = amd_f10_mcheck_init(ci);
-        break;
-    }
-
-    return rc;
-}
-
 /*check the existence of Machine Check*/
 int mce_available(struct cpuinfo_x86 *c)
 {
diff -r 37a8946eeb9d -r f9ded6e9e554 xen/arch/x86/cpu/mcheck/mce.h
--- a/xen/arch/x86/cpu/mcheck/mce.h	Fri Oct 26 16:09:29 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce.h	Mon Oct 29 15:04:35 2012 +0100
@@ -39,10 +39,7 @@ enum mcheck_type {
 };
 
 /* Init functions */
-enum mcheck_type amd_k7_mcheck_init(struct cpuinfo_x86 *c);
-enum mcheck_type amd_k8_mcheck_init(struct cpuinfo_x86 *c);
-enum mcheck_type amd_f10_mcheck_init(struct cpuinfo_x86 *c);
-
+enum mcheck_type amd_mcheck_init(struct cpuinfo_x86 *c);
 enum mcheck_type intel_mcheck_init(struct cpuinfo_x86 *c, bool_t bsp);
 
 void intel_mcheck_timer(struct cpuinfo_x86 *c);
diff -r 37a8946eeb9d -r f9ded6e9e554 xen/arch/x86/cpu/mcheck/mce_amd.c
--- a/xen/arch/x86/cpu/mcheck/mce_amd.c	Fri Oct 26 16:09:29 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce_amd.c	Mon Oct 29 15:04:35 2012 +0100
@@ -98,3 +98,29 @@ mc_amd_addrcheck(uint64_t status, uint64
     BUG();
     return 0;
 }
+
+enum mcheck_type
+amd_mcheck_init(struct cpuinfo_x86 *ci)
+{
+    enum mcheck_type rc = mcheck_none;
+
+    switch ( ci->x86 )
+    {
+    case 6:
+        rc = amd_k7_mcheck_init(ci);
+        break;
+
+    default:
+        /* Assume that machine check support is available.
+         * The minimum provided support is at least the K8. */
+    case 0xf:
+        rc = amd_k8_mcheck_init(ci);
+        break;
+
+    case 0x10 ... 0x17:
+        rc = amd_f10_mcheck_init(ci);
+        break;
+    }
+
+    return rc;
+}
diff -r 37a8946eeb9d -r f9ded6e9e554 xen/arch/x86/cpu/mcheck/mce_amd.h
--- a/xen/arch/x86/cpu/mcheck/mce_amd.h	Fri Oct 26 16:09:29 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce_amd.h	Mon Oct 29 15:04:35 2012 +0100
@@ -1,6 +1,10 @@
 #ifndef _MCHECK_AMD_H
 #define _MCHECK_AMD_H
 
+enum mcheck_type amd_k7_mcheck_init(struct cpuinfo_x86 *c);
+enum mcheck_type amd_k8_mcheck_init(struct cpuinfo_x86 *c);
+enum mcheck_type amd_f10_mcheck_init(struct cpuinfo_x86 *c);
+
 int mc_amd_recoverable_scan(uint64_t status);
 int mc_amd_addrcheck(uint64_t status, uint64_t misc, int addrtype);
 

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

From xen-changelog-bounces@lists.xen.org Tue Oct 30 04:00:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Oct 2012 04:00: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 1TT306-0000oX-A8; Tue, 30 Oct 2012 04:00:26 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT304-0000nq-S4
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:25 +0000
Received: from [193.109.254.147:46626] by server-8.bemta-14.messagelabs.com id
	3D/D6-16549-8D05F805; Tue, 30 Oct 2012 04:00:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-27.messagelabs.com!1351569620!3241492!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32120 invoked from network); 30 Oct 2012 04:00:21 -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;
	30 Oct 2012 04:00:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT300-0001X1-7a
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TT2zz-0007KY-Hg
	for xen-changelog@lists.xensource.com; Tue, 30 Oct 2012 04:00:19 +0000
Message-Id: <E1TT2zz-0007KY-Hg@xenbits.xen.org>
Date: Tue, 30 Oct 2012 04:00:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/MCE: consolidate AMD
	initialization
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Christoph Egger <Christoph.Egger@amd.com>
# Date 1351519475 -3600
# Node ID f9ded6e9e554b66ff6d8a0181f70e1dca2517e90
# Parent  37a8946eeb9db8b5eafc1c75aded006ad5322af8
x86/MCE: consolidate AMD initialization

Move AMD specific initialization to AMD files.

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


diff -r 37a8946eeb9d -r f9ded6e9e554 xen/arch/x86/cpu/mcheck/mce.c
--- a/xen/arch/x86/cpu/mcheck/mce.c	Fri Oct 26 16:09:29 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce.c	Mon Oct 29 15:04:35 2012 +0100
@@ -560,30 +560,6 @@ void mcheck_mca_clearbanks(struct mca_ba
     }
 }
 
-static enum mcheck_type amd_mcheck_init(struct cpuinfo_x86 *ci)
-{
-    enum mcheck_type rc = mcheck_none;
-
-    switch (ci->x86) {
-    case 6:
-        rc = amd_k7_mcheck_init(ci);
-        break;
-
-    default:
-        /* Assume that machine check support is available.
-         * The minimum provided support is at least the K8. */
-    case 0xf:
-        rc = amd_k8_mcheck_init(ci);
-        break;
-
-    case 0x10 ... 0x17:
-        rc = amd_f10_mcheck_init(ci);
-        break;
-    }
-
-    return rc;
-}
-
 /*check the existence of Machine Check*/
 int mce_available(struct cpuinfo_x86 *c)
 {
diff -r 37a8946eeb9d -r f9ded6e9e554 xen/arch/x86/cpu/mcheck/mce.h
--- a/xen/arch/x86/cpu/mcheck/mce.h	Fri Oct 26 16:09:29 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce.h	Mon Oct 29 15:04:35 2012 +0100
@@ -39,10 +39,7 @@ enum mcheck_type {
 };
 
 /* Init functions */
-enum mcheck_type amd_k7_mcheck_init(struct cpuinfo_x86 *c);
-enum mcheck_type amd_k8_mcheck_init(struct cpuinfo_x86 *c);
-enum mcheck_type amd_f10_mcheck_init(struct cpuinfo_x86 *c);
-
+enum mcheck_type amd_mcheck_init(struct cpuinfo_x86 *c);
 enum mcheck_type intel_mcheck_init(struct cpuinfo_x86 *c, bool_t bsp);
 
 void intel_mcheck_timer(struct cpuinfo_x86 *c);
diff -r 37a8946eeb9d -r f9ded6e9e554 xen/arch/x86/cpu/mcheck/mce_amd.c
--- a/xen/arch/x86/cpu/mcheck/mce_amd.c	Fri Oct 26 16:09:29 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce_amd.c	Mon Oct 29 15:04:35 2012 +0100
@@ -98,3 +98,29 @@ mc_amd_addrcheck(uint64_t status, uint64
     BUG();
     return 0;
 }
+
+enum mcheck_type
+amd_mcheck_init(struct cpuinfo_x86 *ci)
+{
+    enum mcheck_type rc = mcheck_none;
+
+    switch ( ci->x86 )
+    {
+    case 6:
+        rc = amd_k7_mcheck_init(ci);
+        break;
+
+    default:
+        /* Assume that machine check support is available.
+         * The minimum provided support is at least the K8. */
+    case 0xf:
+        rc = amd_k8_mcheck_init(ci);
+        break;
+
+    case 0x10 ... 0x17:
+        rc = amd_f10_mcheck_init(ci);
+        break;
+    }
+
+    return rc;
+}
diff -r 37a8946eeb9d -r f9ded6e9e554 xen/arch/x86/cpu/mcheck/mce_amd.h
--- a/xen/arch/x86/cpu/mcheck/mce_amd.h	Fri Oct 26 16:09:29 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce_amd.h	Mon Oct 29 15:04:35 2012 +0100
@@ -1,6 +1,10 @@
 #ifndef _MCHECK_AMD_H
 #define _MCHECK_AMD_H
 
+enum mcheck_type amd_k7_mcheck_init(struct cpuinfo_x86 *c);
+enum mcheck_type amd_k8_mcheck_init(struct cpuinfo_x86 *c);
+enum mcheck_type amd_f10_mcheck_init(struct cpuinfo_x86 *c);
+
 int mc_amd_recoverable_scan(uint64_t status);
 int mc_amd_addrcheck(uint64_t status, uint64_t misc, int addrtype);
 

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

From xen-changelog-bounces@lists.xen.org Wed Oct 31 02:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 31 Oct 2012 02:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TTOSa-0008QQ-Gw; Wed, 31 Oct 2012 02:55:16 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TTOSZ-0008QF-Ay
	for xen-changelog@lists.xensource.com; Wed, 31 Oct 2012 02:55:15 +0000
Received: from [193.109.254.147:9026] by server-11.bemta-14.messagelabs.com id
	80/F6-29027-21390905; Wed, 31 Oct 2012 02:55:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-27.messagelabs.com!1351652111!1361425!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG, UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5027 invoked from network); 31 Oct 2012 02:55:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Oct 2012 02:55:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TTOSV-0001rb-HW
	for xen-changelog@lists.xensource.com; Wed, 31 Oct 2012 02:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TTOSV-0000zd-3A
	for xen-changelog@lists.xensource.com; Wed, 31 Oct 2012 02:55:11 +0000
Message-Id: <E1TTOSV-0000zd-3A@xenbits.xen.org>
Date: Wed, 31 Oct 2012 02:55:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: use MOV instead of PUSH/POP
	when saving/restoring register 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 Jan Beulich <jbeulich@suse.com>
# Date 1351611883 -3600
# Node ID 3daa252ed1321668a40749f1d47b1e9cf8c5a479
# Parent  8a7f0f36462dbdf2ea6414cdbcf168b4d631c309
x86: use MOV instead of PUSH/POP when saving/restoring register state

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


diff -r 8a7f0f36462d -r 3daa252ed132 xen/arch/x86/x86_64/compat/entry.S
--- a/xen/arch/x86/x86_64/compat/entry.S	Tue Oct 30 14:53:47 2012 +0000
+++ b/xen/arch/x86/x86_64/compat/entry.S	Tue Oct 30 16:44:43 2012 +0100
@@ -21,8 +21,7 @@ ENTRY(compat_hypercall)
 UNLIKELY_START(ne, msi_check)
         movl  $HYPERCALL_VECTOR,%edi
         call  check_for_unexpected_msi
-        RESTORE_ALL
-        SAVE_ALL
+        LOAD_C_CLOBBERED
 UNLIKELY_END(msi_check)
 
         GET_CURRENT(%rbx)
@@ -173,8 +172,7 @@ compat_bad_hypercall:
 /* %rbx: struct vcpu, interrupts disabled */
 compat_restore_all_guest:
         ASSERT_INTERRUPTS_DISABLED
-        RESTORE_ALL
-        addq  $8,%rsp
+        RESTORE_ALL adj=8
 .Lft0:  iretq
 
 .section .fixup,"ax"
diff -r 8a7f0f36462d -r 3daa252ed132 xen/arch/x86/x86_64/entry.S
--- a/xen/arch/x86/x86_64/entry.S	Tue Oct 30 14:53:47 2012 +0000
+++ b/xen/arch/x86/x86_64/entry.S	Tue Oct 30 16:44:43 2012 +0100
@@ -47,12 +47,10 @@ restore_all_guest:
         cmpl  $1,%ecx
         ja    .Lforce_iret
 
-        addq  $8,%rsp
-        popq  %rcx                    # RIP
-        popq  %r11                    # CS
-        cmpw  $FLAT_USER_CS32,%r11
-        popq  %r11                    # RFLAGS
-        popq  %rsp                    # RSP
+        cmpw  $FLAT_USER_CS32,16(%rsp)# CS
+        movq  8(%rsp),%rcx            # RIP
+        movq  24(%rsp),%r11           # RFLAGS
+        movq  32(%rsp),%rsp           # RSP
         je    1f
         sysretq
 1:      sysretl
@@ -101,8 +99,7 @@ 1:      call  create_bounce_frame
         ALIGN
 /* No special register assumptions. */
 restore_all_xen:
-        RESTORE_ALL
-        addq  $8,%rsp
+        RESTORE_ALL adj=8
         iretq
 
 /*
@@ -311,8 +308,7 @@ ENTRY(int80_direct_trap)
 UNLIKELY_START(ne, msi_check)
         movl  $0x80,%edi
         call  check_for_unexpected_msi
-        RESTORE_ALL
-        SAVE_ALL
+        LOAD_C_CLOBBERED
 UNLIKELY_END(msi_check)
 
         GET_CURRENT(%rbx)
diff -r 8a7f0f36462d -r 3daa252ed132 xen/include/asm-x86/x86_64/asm_defns.h
--- a/xen/include/asm-x86/x86_64/asm_defns.h	Tue Oct 30 14:53:47 2012 +0000
+++ b/xen/include/asm-x86/x86_64/asm_defns.h	Tue Oct 30 16:44:43 2012 +0100
@@ -5,11 +5,11 @@
 
 #ifdef CONFIG_FRAME_POINTER
 /* Indicate special exception stack frame by inverting the frame pointer. */
-#define SETUP_EXCEPTION_FRAME_POINTER           \
-        movq  %rsp,%rbp;                        \
+#define SETUP_EXCEPTION_FRAME_POINTER(offs)     \
+        leaq  offs(%rsp),%rbp;                  \
         notq  %rbp
 #else
-#define SETUP_EXCEPTION_FRAME_POINTER
+#define SETUP_EXCEPTION_FRAME_POINTER(offs)
 #endif
 
 #ifndef NDEBUG
@@ -27,40 +27,49 @@ 1:      addq  $8,%rsp;
 #define ASSERT_INTERRUPTS_DISABLED ASSERT_INTERRUPT_STATUS(z)
 
 #define SAVE_ALL                                \
+        addq  $-(UREGS_error_code-UREGS_r15), %rsp; \
         cld;                                    \
-        pushq %rdi;                             \
-        pushq %rsi;                             \
-        pushq %rdx;                             \
-        pushq %rcx;                             \
-        pushq %rax;                             \
-        pushq %r8;                              \
-        pushq %r9;                              \
-        pushq %r10;                             \
-        pushq %r11;                             \
-        pushq %rbx;                             \
-        pushq %rbp;                             \
-        SETUP_EXCEPTION_FRAME_POINTER;          \
-        pushq %r12;                             \
-        pushq %r13;                             \
-        pushq %r14;                             \
-        pushq %r15;
+        movq  %rdi,UREGS_rdi(%rsp);             \
+        movq  %rsi,UREGS_rsi(%rsp);             \
+        movq  %rdx,UREGS_rdx(%rsp);             \
+        movq  %rcx,UREGS_rcx(%rsp);             \
+        movq  %rax,UREGS_rax(%rsp);             \
+        movq  %r8,UREGS_r8(%rsp);               \
+        movq  %r9,UREGS_r9(%rsp);               \
+        movq  %r10,UREGS_r10(%rsp);             \
+        movq  %r11,UREGS_r11(%rsp);             \
+        movq  %rbx,UREGS_rbx(%rsp);             \
+        movq  %rbp,UREGS_rbp(%rsp);             \
+        SETUP_EXCEPTION_FRAME_POINTER(UREGS_rbp); \
+        movq  %r12,UREGS_r12(%rsp);             \
+        movq  %r13,UREGS_r13(%rsp);             \
+        movq  %r14,UREGS_r14(%rsp);             \
+        movq  %r15,UREGS_r15(%rsp);             \
 
-#define RESTORE_ALL                             \
-        popq  %r15;                             \
-        popq  %r14;                             \
-        popq  %r13;                             \
-        popq  %r12;                             \
-        popq  %rbp;                             \
-        popq  %rbx;                             \
-        popq  %r11;                             \
-        popq  %r10;                             \
-        popq  %r9;                              \
-        popq  %r8;                              \
-        popq  %rax;                             \
-        popq  %rcx;                             \
-        popq  %rdx;                             \
-        popq  %rsi;                             \
-        popq  %rdi;
+#ifdef __ASSEMBLY__
+.macro LOAD_C_CLOBBERED
+        movq  UREGS_r11(%rsp),%r11
+        movq  UREGS_r10(%rsp),%r10
+        movq  UREGS_r9(%rsp),%r9
+        movq  UREGS_r8(%rsp),%r8
+        movq  UREGS_rax(%rsp),%rax
+        movq  UREGS_rcx(%rsp),%rcx
+        movq  UREGS_rdx(%rsp),%rdx
+        movq  UREGS_rsi(%rsp),%rsi
+        movq  UREGS_rdi(%rsp),%rdi
+.endm
+
+.macro RESTORE_ALL adj=0
+        movq  UREGS_r15(%rsp),%r15
+        movq  UREGS_r14(%rsp),%r14
+        movq  UREGS_r13(%rsp),%r13
+        movq  UREGS_r12(%rsp),%r12
+        movq  UREGS_rbp(%rsp),%rbp
+        movq  UREGS_rbx(%rsp),%rbx
+        LOAD_C_CLOBBERED
+        subq  $-(UREGS_error_code-UREGS_r15+\adj), %rsp
+.endm
+#endif
 
 #ifdef PERF_COUNTERS
 #define PERFC_INCR(_name,_idx,_cur)             \
@@ -94,7 +103,7 @@ 1:      addq  $8,%rsp;
 __asm__(                                        \
     "\n" __ALIGN_STR"\n"                        \
     "common_interrupt:\n\t"                     \
-    STR(SAVE_ALL)                               \
+    STR(SAVE_ALL) "\n\t"                        \
     "movq %rsp,%rdi\n\t"                        \
     "callq " STR(do_IRQ) "\n\t"                 \
     "jmp ret_from_intr\n");

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

From xen-changelog-bounces@lists.xen.org Wed Oct 31 02:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 31 Oct 2012 02:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TTOSa-0008QQ-Gw; Wed, 31 Oct 2012 02:55:16 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TTOSZ-0008QF-Ay
	for xen-changelog@lists.xensource.com; Wed, 31 Oct 2012 02:55:15 +0000
Received: from [193.109.254.147:9026] by server-11.bemta-14.messagelabs.com id
	80/F6-29027-21390905; Wed, 31 Oct 2012 02:55:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-27.messagelabs.com!1351652111!1361425!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG, UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5027 invoked from network); 31 Oct 2012 02:55:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Oct 2012 02:55:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TTOSV-0001rb-HW
	for xen-changelog@lists.xensource.com; Wed, 31 Oct 2012 02:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TTOSV-0000zd-3A
	for xen-changelog@lists.xensource.com; Wed, 31 Oct 2012 02:55:11 +0000
Message-Id: <E1TTOSV-0000zd-3A@xenbits.xen.org>
Date: Wed, 31 Oct 2012 02:55:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: use MOV instead of PUSH/POP
	when saving/restoring register 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 Jan Beulich <jbeulich@suse.com>
# Date 1351611883 -3600
# Node ID 3daa252ed1321668a40749f1d47b1e9cf8c5a479
# Parent  8a7f0f36462dbdf2ea6414cdbcf168b4d631c309
x86: use MOV instead of PUSH/POP when saving/restoring register state

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


diff -r 8a7f0f36462d -r 3daa252ed132 xen/arch/x86/x86_64/compat/entry.S
--- a/xen/arch/x86/x86_64/compat/entry.S	Tue Oct 30 14:53:47 2012 +0000
+++ b/xen/arch/x86/x86_64/compat/entry.S	Tue Oct 30 16:44:43 2012 +0100
@@ -21,8 +21,7 @@ ENTRY(compat_hypercall)
 UNLIKELY_START(ne, msi_check)
         movl  $HYPERCALL_VECTOR,%edi
         call  check_for_unexpected_msi
-        RESTORE_ALL
-        SAVE_ALL
+        LOAD_C_CLOBBERED
 UNLIKELY_END(msi_check)
 
         GET_CURRENT(%rbx)
@@ -173,8 +172,7 @@ compat_bad_hypercall:
 /* %rbx: struct vcpu, interrupts disabled */
 compat_restore_all_guest:
         ASSERT_INTERRUPTS_DISABLED
-        RESTORE_ALL
-        addq  $8,%rsp
+        RESTORE_ALL adj=8
 .Lft0:  iretq
 
 .section .fixup,"ax"
diff -r 8a7f0f36462d -r 3daa252ed132 xen/arch/x86/x86_64/entry.S
--- a/xen/arch/x86/x86_64/entry.S	Tue Oct 30 14:53:47 2012 +0000
+++ b/xen/arch/x86/x86_64/entry.S	Tue Oct 30 16:44:43 2012 +0100
@@ -47,12 +47,10 @@ restore_all_guest:
         cmpl  $1,%ecx
         ja    .Lforce_iret
 
-        addq  $8,%rsp
-        popq  %rcx                    # RIP
-        popq  %r11                    # CS
-        cmpw  $FLAT_USER_CS32,%r11
-        popq  %r11                    # RFLAGS
-        popq  %rsp                    # RSP
+        cmpw  $FLAT_USER_CS32,16(%rsp)# CS
+        movq  8(%rsp),%rcx            # RIP
+        movq  24(%rsp),%r11           # RFLAGS
+        movq  32(%rsp),%rsp           # RSP
         je    1f
         sysretq
 1:      sysretl
@@ -101,8 +99,7 @@ 1:      call  create_bounce_frame
         ALIGN
 /* No special register assumptions. */
 restore_all_xen:
-        RESTORE_ALL
-        addq  $8,%rsp
+        RESTORE_ALL adj=8
         iretq
 
 /*
@@ -311,8 +308,7 @@ ENTRY(int80_direct_trap)
 UNLIKELY_START(ne, msi_check)
         movl  $0x80,%edi
         call  check_for_unexpected_msi
-        RESTORE_ALL
-        SAVE_ALL
+        LOAD_C_CLOBBERED
 UNLIKELY_END(msi_check)
 
         GET_CURRENT(%rbx)
diff -r 8a7f0f36462d -r 3daa252ed132 xen/include/asm-x86/x86_64/asm_defns.h
--- a/xen/include/asm-x86/x86_64/asm_defns.h	Tue Oct 30 14:53:47 2012 +0000
+++ b/xen/include/asm-x86/x86_64/asm_defns.h	Tue Oct 30 16:44:43 2012 +0100
@@ -5,11 +5,11 @@
 
 #ifdef CONFIG_FRAME_POINTER
 /* Indicate special exception stack frame by inverting the frame pointer. */
-#define SETUP_EXCEPTION_FRAME_POINTER           \
-        movq  %rsp,%rbp;                        \
+#define SETUP_EXCEPTION_FRAME_POINTER(offs)     \
+        leaq  offs(%rsp),%rbp;                  \
         notq  %rbp
 #else
-#define SETUP_EXCEPTION_FRAME_POINTER
+#define SETUP_EXCEPTION_FRAME_POINTER(offs)
 #endif
 
 #ifndef NDEBUG
@@ -27,40 +27,49 @@ 1:      addq  $8,%rsp;
 #define ASSERT_INTERRUPTS_DISABLED ASSERT_INTERRUPT_STATUS(z)
 
 #define SAVE_ALL                                \
+        addq  $-(UREGS_error_code-UREGS_r15), %rsp; \
         cld;                                    \
-        pushq %rdi;                             \
-        pushq %rsi;                             \
-        pushq %rdx;                             \
-        pushq %rcx;                             \
-        pushq %rax;                             \
-        pushq %r8;                              \
-        pushq %r9;                              \
-        pushq %r10;                             \
-        pushq %r11;                             \
-        pushq %rbx;                             \
-        pushq %rbp;                             \
-        SETUP_EXCEPTION_FRAME_POINTER;          \
-        pushq %r12;                             \
-        pushq %r13;                             \
-        pushq %r14;                             \
-        pushq %r15;
+        movq  %rdi,UREGS_rdi(%rsp);             \
+        movq  %rsi,UREGS_rsi(%rsp);             \
+        movq  %rdx,UREGS_rdx(%rsp);             \
+        movq  %rcx,UREGS_rcx(%rsp);             \
+        movq  %rax,UREGS_rax(%rsp);             \
+        movq  %r8,UREGS_r8(%rsp);               \
+        movq  %r9,UREGS_r9(%rsp);               \
+        movq  %r10,UREGS_r10(%rsp);             \
+        movq  %r11,UREGS_r11(%rsp);             \
+        movq  %rbx,UREGS_rbx(%rsp);             \
+        movq  %rbp,UREGS_rbp(%rsp);             \
+        SETUP_EXCEPTION_FRAME_POINTER(UREGS_rbp); \
+        movq  %r12,UREGS_r12(%rsp);             \
+        movq  %r13,UREGS_r13(%rsp);             \
+        movq  %r14,UREGS_r14(%rsp);             \
+        movq  %r15,UREGS_r15(%rsp);             \
 
-#define RESTORE_ALL                             \
-        popq  %r15;                             \
-        popq  %r14;                             \
-        popq  %r13;                             \
-        popq  %r12;                             \
-        popq  %rbp;                             \
-        popq  %rbx;                             \
-        popq  %r11;                             \
-        popq  %r10;                             \
-        popq  %r9;                              \
-        popq  %r8;                              \
-        popq  %rax;                             \
-        popq  %rcx;                             \
-        popq  %rdx;                             \
-        popq  %rsi;                             \
-        popq  %rdi;
+#ifdef __ASSEMBLY__
+.macro LOAD_C_CLOBBERED
+        movq  UREGS_r11(%rsp),%r11
+        movq  UREGS_r10(%rsp),%r10
+        movq  UREGS_r9(%rsp),%r9
+        movq  UREGS_r8(%rsp),%r8
+        movq  UREGS_rax(%rsp),%rax
+        movq  UREGS_rcx(%rsp),%rcx
+        movq  UREGS_rdx(%rsp),%rdx
+        movq  UREGS_rsi(%rsp),%rsi
+        movq  UREGS_rdi(%rsp),%rdi
+.endm
+
+.macro RESTORE_ALL adj=0
+        movq  UREGS_r15(%rsp),%r15
+        movq  UREGS_r14(%rsp),%r14
+        movq  UREGS_r13(%rsp),%r13
+        movq  UREGS_r12(%rsp),%r12
+        movq  UREGS_rbp(%rsp),%rbp
+        movq  UREGS_rbx(%rsp),%rbx
+        LOAD_C_CLOBBERED
+        subq  $-(UREGS_error_code-UREGS_r15+\adj), %rsp
+.endm
+#endif
 
 #ifdef PERF_COUNTERS
 #define PERFC_INCR(_name,_idx,_cur)             \
@@ -94,7 +103,7 @@ 1:      addq  $8,%rsp;
 __asm__(                                        \
     "\n" __ALIGN_STR"\n"                        \
     "common_interrupt:\n\t"                     \
-    STR(SAVE_ALL)                               \
+    STR(SAVE_ALL) "\n\t"                        \
     "movq %rsp,%rdi\n\t"                        \
     "callq " STR(do_IRQ) "\n\t"                 \
     "jmp ret_from_intr\n");

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

From xen-changelog-bounces@lists.xen.org Wed Oct 31 02:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 31 Oct 2012 02:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TTOSZ-0008QG-EG; Wed, 31 Oct 2012 02:55:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TTOSY-0008QA-2u
	for xen-changelog@lists.xensource.com; Wed, 31 Oct 2012 02:55:14 +0000
Received: from [85.158.139.83:17805] by server-9.bemta-5.messagelabs.com id
	01/45-23053-11390905; Wed, 31 Oct 2012 02:55:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-182.messagelabs.com!1351652111!27503571!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26256 invoked from network); 31 Oct 2012 02:55:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Oct 2012 02:55:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TTOSU-0001rY-V4
	for xen-changelog@lists.xensource.com; Wed, 31 Oct 2012 02:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TTOSU-0000zM-Cv
	for xen-changelog@lists.xensource.com; Wed, 31 Oct 2012 02:55:10 +0000
Message-Id: <E1TTOSU-0000zM-Cv@xenbits.xen.org>
Date: Wed, 31 Oct 2012 02:55:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: document persistent grants
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Roger Pau Monne <roger.pau@citrix.com>
# Date 1351608827 0
# Node ID 8a7f0f36462dbdf2ea6414cdbcf168b4d631c309
# Parent  10feb09337081cd88d95a126abf575fddb500978
docs: document persistent grants

Document the new persistent grants block-device feature.

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


diff -r 10feb0933708 -r 8a7f0f36462d xen/include/public/io/blkif.h
--- a/xen/include/public/io/blkif.h	Mon Oct 29 15:08:56 2012 +0100
+++ b/xen/include/public/io/blkif.h	Tue Oct 30 14:53:47 2012 +0000
@@ -126,6 +126,19 @@
  *      of this type may still be returned at any time with the
  *      BLKIF_RSP_EOPNOTSUPP result code.
  *
+ * feature-persistent
+ *      Values:         0/1 (boolean)
+ *      Default Value:  0
+ *      Notes: 7
+ *
+ *      A value of "1" indicates that the backend can keep the grants used
+ *      by the frontend driver mapped, so the same set of grants should be
+ *      used in all transactions. The maximum number of grants the backend
+ *      can map persistently depends on the implementation, but ideally it
+ *      should be RING_SIZE * BLKIF_MAX_SEGMENTS_PER_REQUEST. Using this
+ *      feature the backend doesn't need to unmap each grant, preventing
+ *      costly TLB flushes.
+ *
  *----------------------- Request Transport Parameters ------------------------
  *
  * max-ring-page-order
@@ -242,6 +255,15 @@
  *      The size of the frontend allocated request ring buffer in units of
  *      machine pages.  The value must be a power of 2.
  *
+ * feature-persistent
+ *      Values:         0/1 (boolean)
+ *      Default Value:  0
+ *      Notes: 7, 8
+ *
+ *      A value of "1" indicates that the frontend will reuse the same grants
+ *      for all transactions, allowing the backend to map them with write
+ *      access (even when it should be read-only).
+ *
  *------------------------- Virtual Device Properties -------------------------
  *
  * device-type
@@ -279,6 +301,13 @@
  *     'ring-ref' is used to communicate the grant reference for this
  *     page to the backend.  When using a multi-page ring, the 'ring-ref'
  *     node is not created.  Instead 'ring-ref0' - 'ring-refN' are used.
+ * (7) When using persistent grants data has to be copied from/to the page
+ *     where the grant is currently mapped. The overhead of doing this copy
+ *     however doesn't suppress the speed improvement of not having to unmap
+ *     the grants.
+ * (8) The frontend driver has to allow the backend driver to map all grants
+ *     with write access, even when they should be mapped read-only, since
+ *     further requests may reuse this grants and require write permisions.
  */
 
 /*

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

From xen-changelog-bounces@lists.xen.org Wed Oct 31 02:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 31 Oct 2012 02:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TTOSZ-0008QG-EG; Wed, 31 Oct 2012 02:55:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TTOSY-0008QA-2u
	for xen-changelog@lists.xensource.com; Wed, 31 Oct 2012 02:55:14 +0000
Received: from [85.158.139.83:17805] by server-9.bemta-5.messagelabs.com id
	01/45-23053-11390905; Wed, 31 Oct 2012 02:55:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-182.messagelabs.com!1351652111!27503571!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26256 invoked from network); 31 Oct 2012 02:55:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Oct 2012 02:55:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TTOSU-0001rY-V4
	for xen-changelog@lists.xensource.com; Wed, 31 Oct 2012 02:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TTOSU-0000zM-Cv
	for xen-changelog@lists.xensource.com; Wed, 31 Oct 2012 02:55:10 +0000
Message-Id: <E1TTOSU-0000zM-Cv@xenbits.xen.org>
Date: Wed, 31 Oct 2012 02:55:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: document persistent grants
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Roger Pau Monne <roger.pau@citrix.com>
# Date 1351608827 0
# Node ID 8a7f0f36462dbdf2ea6414cdbcf168b4d631c309
# Parent  10feb09337081cd88d95a126abf575fddb500978
docs: document persistent grants

Document the new persistent grants block-device feature.

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


diff -r 10feb0933708 -r 8a7f0f36462d xen/include/public/io/blkif.h
--- a/xen/include/public/io/blkif.h	Mon Oct 29 15:08:56 2012 +0100
+++ b/xen/include/public/io/blkif.h	Tue Oct 30 14:53:47 2012 +0000
@@ -126,6 +126,19 @@
  *      of this type may still be returned at any time with the
  *      BLKIF_RSP_EOPNOTSUPP result code.
  *
+ * feature-persistent
+ *      Values:         0/1 (boolean)
+ *      Default Value:  0
+ *      Notes: 7
+ *
+ *      A value of "1" indicates that the backend can keep the grants used
+ *      by the frontend driver mapped, so the same set of grants should be
+ *      used in all transactions. The maximum number of grants the backend
+ *      can map persistently depends on the implementation, but ideally it
+ *      should be RING_SIZE * BLKIF_MAX_SEGMENTS_PER_REQUEST. Using this
+ *      feature the backend doesn't need to unmap each grant, preventing
+ *      costly TLB flushes.
+ *
  *----------------------- Request Transport Parameters ------------------------
  *
  * max-ring-page-order
@@ -242,6 +255,15 @@
  *      The size of the frontend allocated request ring buffer in units of
  *      machine pages.  The value must be a power of 2.
  *
+ * feature-persistent
+ *      Values:         0/1 (boolean)
+ *      Default Value:  0
+ *      Notes: 7, 8
+ *
+ *      A value of "1" indicates that the frontend will reuse the same grants
+ *      for all transactions, allowing the backend to map them with write
+ *      access (even when it should be read-only).
+ *
  *------------------------- Virtual Device Properties -------------------------
  *
  * device-type
@@ -279,6 +301,13 @@
  *     'ring-ref' is used to communicate the grant reference for this
  *     page to the backend.  When using a multi-page ring, the 'ring-ref'
  *     node is not created.  Instead 'ring-ref0' - 'ring-refN' are used.
+ * (7) When using persistent grants data has to be copied from/to the page
+ *     where the grant is currently mapped. The overhead of doing this copy
+ *     however doesn't suppress the speed improvement of not having to unmap
+ *     the grants.
+ * (8) The frontend driver has to allow the backend driver to map all grants
+ *     with write access, even when they should be mapped read-only, since
+ *     further requests may reuse this grants and require write permisions.
  */
 
 /*

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

From xen-changelog-bounces@lists.xen.org Wed Oct 31 02:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 31 Oct 2012 02:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TTOSc-0008Qz-O0; Wed, 31 Oct 2012 02:55:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TTOSb-0008QP-8M
	for xen-changelog@lists.xensource.com; Wed, 31 Oct 2012 02:55:17 +0000
Received: from [85.158.143.35:28305] by server-3.bemta-4.messagelabs.com id
	AC/F8-06841-41390905; Wed, 31 Oct 2012 02:55:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-21.messagelabs.com!1351652114!15132558!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1411 invoked from network); 31 Oct 2012 02:55:15 -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;
	31 Oct 2012 02:55:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TTOSX-0001rh-RX
	for xen-changelog@lists.xensource.com; Wed, 31 Oct 2012 02:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TTOSX-00010O-Mq
	for xen-changelog@lists.xensource.com; Wed, 31 Oct 2012 02:55:13 +0000
Message-Id: <E1TTOSX-00010O-Mq@xenbits.xen.org>
Date: Wed, 31 Oct 2012 02:55:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] autoconf: add file missing from
	26123:f6d5b3bf74a8
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1351620731 0
# Node ID bf249cd5f2c1266875acc9c33c5172d94b77a897
# Parent  f6d5b3bf74a83fe84eb2909657b7f1db7f0f8253
autoconf: add file missing from 26123:f6d5b3bf74a8

This file was in 26123:f6d5b3bf74a8 as submitted but I failed to add it.

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


diff -r f6d5b3bf74a8 -r bf249cd5f2c1 tools/m4/fetcher.m4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/m4/fetcher.m4	Tue Oct 30 18:12:11 2012 +0000
@@ -0,0 +1,14 @@
+AC_DEFUN([AX_CHECK_FETCHER], [
+AC_PATH_PROG([WGET],[wget], [no])
+AS_IF([test x"$WGET" != x"no"], [
+    FETCHER="$WGET -c -O"
+], [
+    AC_PATH_PROG([FTP],[ftp], [no])
+    AS_IF([test x"$FTP" != x"no"], [
+        FETCHER="$FTP -o"
+    ], [
+        AC_MSG_ERROR([cannot find wget or ftp])
+    ])
+])
+AC_SUBST(FETCHER)
+])

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

From xen-changelog-bounces@lists.xen.org Wed Oct 31 02:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 31 Oct 2012 02:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TTOSc-0008Qz-O0; Wed, 31 Oct 2012 02:55:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TTOSb-0008QP-8M
	for xen-changelog@lists.xensource.com; Wed, 31 Oct 2012 02:55:17 +0000
Received: from [85.158.143.35:28305] by server-3.bemta-4.messagelabs.com id
	AC/F8-06841-41390905; Wed, 31 Oct 2012 02:55:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-21.messagelabs.com!1351652114!15132558!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1411 invoked from network); 31 Oct 2012 02:55:15 -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;
	31 Oct 2012 02:55:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TTOSX-0001rh-RX
	for xen-changelog@lists.xensource.com; Wed, 31 Oct 2012 02:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TTOSX-00010O-Mq
	for xen-changelog@lists.xensource.com; Wed, 31 Oct 2012 02:55:13 +0000
Message-Id: <E1TTOSX-00010O-Mq@xenbits.xen.org>
Date: Wed, 31 Oct 2012 02:55:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] autoconf: add file missing from
	26123:f6d5b3bf74a8
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1351620731 0
# Node ID bf249cd5f2c1266875acc9c33c5172d94b77a897
# Parent  f6d5b3bf74a83fe84eb2909657b7f1db7f0f8253
autoconf: add file missing from 26123:f6d5b3bf74a8

This file was in 26123:f6d5b3bf74a8 as submitted but I failed to add it.

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


diff -r f6d5b3bf74a8 -r bf249cd5f2c1 tools/m4/fetcher.m4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/m4/fetcher.m4	Tue Oct 30 18:12:11 2012 +0000
@@ -0,0 +1,14 @@
+AC_DEFUN([AX_CHECK_FETCHER], [
+AC_PATH_PROG([WGET],[wget], [no])
+AS_IF([test x"$WGET" != x"no"], [
+    FETCHER="$WGET -c -O"
+], [
+    AC_PATH_PROG([FTP],[ftp], [no])
+    AS_IF([test x"$FTP" != x"no"], [
+        FETCHER="$FTP -o"
+    ], [
+        AC_MSG_ERROR([cannot find wget or ftp])
+    ])
+])
+AC_SUBST(FETCHER)
+])

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

From xen-changelog-bounces@lists.xen.org Wed Oct 31 02:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 31 Oct 2012 02:55:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TTOSb-0008Qi-Jk; Wed, 31 Oct 2012 02:55:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TTOSa-0008QP-Gu
	for xen-changelog@lists.xensource.com; Wed, 31 Oct 2012 02:55:16 +0000
Received: from [85.158.143.99:46730] by server-3.bemta-4.messagelabs.com id
	2C/F8-06841-31390905; Wed, 31 Oct 2012 02:55:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-216.messagelabs.com!1351652112!16807037!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 513 invoked from network); 31 Oct 2012 02:55:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Oct 2012 02:55:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TTOSW-0001re-6H
	for xen-changelog@lists.xensource.com; Wed, 31 Oct 2012 02:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TTOSV-0000zu-QY
	for xen-changelog@lists.xensource.com; Wed, 31 Oct 2012 02:55:11 +0000
Message-Id: <E1TTOSV-0000zu-QY@xenbits.xen.org>
Date: Wed, 31 Oct 2012 02:55:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: save/restore only partial
	register state where possible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1351611967 -3600
# Node ID ab2dc9b9f68dc4561619a50b05c6409834eda65e
# Parent  3daa252ed1321668a40749f1d47b1e9cf8c5a479
x86: save/restore only partial register state where possible

... and make restore conditional not only upon having saved the state,
but also upon whether saved state was actually modified (and register
values are known to have been preserved).

Note that RBP is unconditionally considered a volatile register (i.e.
irrespective of CONFIG_FRAME_POINTER), since the RBP handling would
become overly complicated due to the need to save/restore it on the
compat mode hypercall path [6th argument].

Note further that for compat mode code paths, saving/restoring R8...R15
is entirely unnecessary - we don't allow those guests to enter 64-bit
mode, and hence they have no way of seeing these registers' contents
(and there consequently also is no information leak, except if the
context saving domctl would be considered such).

Finally, note that this may not properly deal with gdbstub's needs, yet
(but if so, I can't really suggest adjustments, as I don't know that
code).

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


diff -r 3daa252ed132 -r ab2dc9b9f68d tools/tests/x86_emulator/x86_emulate.c
--- a/tools/tests/x86_emulator/x86_emulate.c	Tue Oct 30 16:44:43 2012 +0100
+++ b/tools/tests/x86_emulator/x86_emulate.c	Tue Oct 30 16:46:07 2012 +0100
@@ -10,6 +10,7 @@ typedef bool bool_t;
 #define BUG() abort()
 
 #define cpu_has_amd_erratum(nr) 0
+#define mark_regs_dirty(r) ((void)(r))
 
 #include "x86_emulate/x86_emulate.h"
 #include "x86_emulate/x86_emulate.c"
diff -r 3daa252ed132 -r ab2dc9b9f68d xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Tue Oct 30 16:44:43 2012 +0100
+++ b/xen/arch/x86/domain.c	Tue Oct 30 16:46:07 2012 +0100
@@ -143,6 +143,7 @@ static void continue_idle_domain(struct 
 static void continue_nonidle_domain(struct vcpu *v)
 {
     check_wakeup_from_wait();
+    mark_regs_dirty(guest_cpu_user_regs());
     reset_stack_and_jump(ret_from_intr);
 }
 
@@ -1312,7 +1313,7 @@ static void load_segments(struct vcpu *n
             if ( test_bit(_VGCF_failsafe_disables_events, &n->arch.vgc_flags) )
                 vcpu_info(n, evtchn_upcall_mask) = 1;
 
-            regs->entry_vector  = TRAP_syscall;
+            regs->entry_vector |= TRAP_syscall;
             regs->_eflags      &= 0xFFFCBEFFUL;
             regs->ss            = FLAT_COMPAT_KERNEL_SS;
             regs->_esp          = (unsigned long)(esp-7);
@@ -1354,7 +1355,7 @@ static void load_segments(struct vcpu *n
         if ( test_bit(_VGCF_failsafe_disables_events, &n->arch.vgc_flags) )
             vcpu_info(n, evtchn_upcall_mask) = 1;
 
-        regs->entry_vector  = TRAP_syscall;
+        regs->entry_vector |= TRAP_syscall;
         regs->rflags       &= ~(X86_EFLAGS_AC|X86_EFLAGS_VM|X86_EFLAGS_RF|
                                 X86_EFLAGS_NT|X86_EFLAGS_TF);
         regs->ss            = FLAT_KERNEL_SS;
diff -r 3daa252ed132 -r ab2dc9b9f68d xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c	Tue Oct 30 16:44:43 2012 +0100
+++ b/xen/arch/x86/irq.c	Tue Oct 30 16:46:07 2012 +0100
@@ -704,7 +704,7 @@ void irq_complete_move(struct irq_desc *
     if (likely(!desc->arch.move_in_progress))
         return;
 
-    vector = get_irq_regs()->entry_vector;
+    vector = (u8)get_irq_regs()->entry_vector;
     me = smp_processor_id();
 
     if ( vector == desc->arch.vector &&
@@ -798,7 +798,7 @@ void do_IRQ(struct cpu_user_regs *regs)
     struct irqaction *action;
     uint32_t          tsc_in;
     struct irq_desc  *desc;
-    unsigned int      vector = regs->entry_vector;
+    unsigned int      vector = (u8)regs->entry_vector;
     int irq = __get_cpu_var(vector_irq[vector]);
     struct cpu_user_regs *old_regs = set_irq_regs(regs);
     
@@ -892,7 +892,7 @@ void do_IRQ(struct cpu_user_regs *regs)
 
  out:
     if ( desc->handler->end )
-        desc->handler->end(desc, regs->entry_vector);
+        desc->handler->end(desc, vector);
  out_no_end:
     spin_unlock(&desc->lock);
  out_no_unlock:
@@ -1113,7 +1113,7 @@ static void __do_IRQ_guest(int irq)
     struct domain      *d;
     int                 i, sp;
     struct pending_eoi *peoi = this_cpu(pending_eoi);
-    int vector = get_irq_regs()->entry_vector;
+    unsigned int        vector = (u8)get_irq_regs()->entry_vector;
 
     if ( unlikely(action->nr_guests == 0) )
     {
diff -r 3daa252ed132 -r ab2dc9b9f68d xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c	Tue Oct 30 16:44:43 2012 +0100
+++ b/xen/arch/x86/traps.c	Tue Oct 30 16:46:07 2012 +0100
@@ -2082,6 +2082,7 @@ static int emulate_privileged_op(struct 
             goto fail;
         if ( admin_io_okay(port, op_bytes, v, regs) )
         {
+            mark_regs_dirty(regs);
             io_emul(regs);            
         }
         else
@@ -2111,6 +2112,7 @@ static int emulate_privileged_op(struct 
             goto fail;
         if ( admin_io_okay(port, op_bytes, v, regs) )
         {
+            mark_regs_dirty(regs);
             io_emul(regs);            
             if ( (op_bytes == 1) && pv_post_outb_hook )
                 pv_post_outb_hook(port, regs->eax);
diff -r 3daa252ed132 -r ab2dc9b9f68d xen/arch/x86/x86_64/compat/entry.S
--- a/xen/arch/x86/x86_64/compat/entry.S	Tue Oct 30 16:44:43 2012 +0100
+++ b/xen/arch/x86/x86_64/compat/entry.S	Tue Oct 30 16:46:07 2012 +0100
@@ -14,8 +14,7 @@
 
 ENTRY(compat_hypercall)
         pushq $0
-        movl  $TRAP_syscall,4(%rsp)
-        SAVE_ALL
+        SAVE_VOLATILE type=TRAP_syscall compat=1
 
         cmpb  $0,untrusted_msi(%rip)
 UNLIKELY_START(ne, msi_check)
@@ -126,6 +125,7 @@ compat_test_guest_events:
 /* %rbx: struct vcpu */
 compat_process_softirqs:
         sti
+        andl  $~TRAP_regs_partial,UREGS_entry_vector(%rsp)
         call  do_softirq
         jmp   compat_test_all_events
 
@@ -172,7 +172,7 @@ compat_bad_hypercall:
 /* %rbx: struct vcpu, interrupts disabled */
 compat_restore_all_guest:
         ASSERT_INTERRUPTS_DISABLED
-        RESTORE_ALL adj=8
+        RESTORE_ALL adj=8 compat=1
 .Lft0:  iretq
 
 .section .fixup,"ax"
@@ -243,7 +243,7 @@ UNLIKELY_END(compat_syscall_gpf)
 
 ENTRY(compat_sysenter)
         movq  VCPU_trap_ctxt(%rbx),%rcx
-        cmpl  $TRAP_gp_fault,UREGS_entry_vector(%rsp)
+        cmpb  $TRAP_gp_fault,UREGS_entry_vector(%rsp)
         movzwl VCPU_sysenter_sel(%rbx),%eax
         movzwl TRAP_gp_fault * TRAPINFO_sizeof + TRAPINFO_cs(%rcx),%ecx
         cmovel %ecx,%eax
diff -r 3daa252ed132 -r ab2dc9b9f68d xen/arch/x86/x86_64/entry.S
--- a/xen/arch/x86/x86_64/entry.S	Tue Oct 30 16:44:43 2012 +0100
+++ b/xen/arch/x86/x86_64/entry.S	Tue Oct 30 16:46:07 2012 +0100
@@ -123,9 +123,8 @@ ENTRY(syscall_enter)
         movl  $FLAT_KERNEL_SS,24(%rsp)
         pushq %rcx
         pushq $0
-        movl  $TRAP_syscall,4(%rsp)
-        movq  24(%rsp),%r11 /* Re-load user RFLAGS into %r11 before SAVE_ALL */
-        SAVE_ALL
+        movq  24(%rsp),%r11 /* Re-load user RFLAGS into %r11 before saving */
+        SAVE_VOLATILE TRAP_syscall
         GET_CURRENT(%rbx)
         movq  VCPU_domain(%rbx),%rcx
         testb $1,DOMAIN_is_32bit_pv(%rcx)
@@ -222,6 +221,7 @@ test_guest_events:
 /* %rbx: struct vcpu */
 process_softirqs:
         sti       
+        SAVE_PRESERVED
         call do_softirq
         jmp  test_all_events
 
@@ -275,8 +275,7 @@ sysenter_eflags_saved:
         pushq $3 /* ring 3 null cs */
         pushq $0 /* null rip */
         pushq $0
-        movl  $TRAP_syscall,4(%rsp)
-        SAVE_ALL
+        SAVE_VOLATILE TRAP_syscall
         GET_CURRENT(%rbx)
         cmpb  $0,VCPU_sysenter_disables_events(%rbx)
         movq  VCPU_sysenter_addr(%rbx),%rax
@@ -286,6 +285,7 @@ sysenter_eflags_saved:
         leal  (,%rcx,TBF_INTERRUPT),%ecx
 UNLIKELY_START(z, sysenter_gpf)
         movq  VCPU_trap_ctxt(%rbx),%rsi
+        SAVE_PRESERVED
         movl  $TRAP_gp_fault,UREGS_entry_vector(%rsp)
         movl  %eax,TRAPBOUNCE_error_code(%rdx)
         movq  TRAP_gp_fault * TRAPINFO_sizeof + TRAPINFO_eip(%rsi),%rax
@@ -302,7 +302,7 @@ UNLIKELY_END(sysenter_gpf)
 
 ENTRY(int80_direct_trap)
         pushq $0
-        SAVE_ALL
+        SAVE_VOLATILE 0x80
 
         cmpb  $0,untrusted_msi(%rip)
 UNLIKELY_START(ne, msi_check)
@@ -331,6 +331,7 @@ int80_slow_path:
          * IDT entry with DPL==0.
          */
         movl  $((0x80 << 3) | 0x2),UREGS_error_code(%rsp)
+        SAVE_PRESERVED
         movl  $TRAP_gp_fault,UREGS_entry_vector(%rsp)
         /* A GPF wouldn't have incremented the instruction pointer. */
         subq  $2,UREGS_rip(%rsp)
@@ -412,7 +413,7 @@ UNLIKELY_END(bounce_failsafe)
         /* Rewrite our stack frame and return to guest-OS mode. */
         /* IA32 Ref. Vol. 3: TF, VM, RF and NT flags are cleared on trap. */
         /* Also clear AC: alignment checks shouldn't trigger in kernel mode. */
-        movl  $TRAP_syscall,UREGS_entry_vector+8(%rsp)
+        orl   $TRAP_syscall,UREGS_entry_vector+8(%rsp)
         andl  $~(X86_EFLAGS_AC|X86_EFLAGS_VM|X86_EFLAGS_RF|\
                  X86_EFLAGS_NT|X86_EFLAGS_TF),UREGS_eflags+8(%rsp)
         movq  $FLAT_KERNEL_SS,UREGS_ss+8(%rsp)
@@ -477,7 +478,7 @@ handle_exception_saved:
         jz    exception_with_ints_disabled
         sti
 1:      movq  %rsp,%rdi
-        movl  UREGS_entry_vector(%rsp),%eax
+        movzbl UREGS_entry_vector(%rsp),%eax
         leaq  exception_table(%rip),%rdx
         GET_CURRENT(%rbx)
         PERFC_INCR(exceptions, %rax, %rbx)
@@ -518,7 +519,7 @@ 1:      movq  UREGS_error_code(%rsp),%ra
 
 /* No special register assumptions. */
 FATAL_exception_with_ints_disabled:
-        movl  UREGS_entry_vector(%rsp),%edi
+        movzbl UREGS_entry_vector(%rsp),%edi
         movq  %rsp,%rsi
         call  fatal_trap
         ud2
@@ -624,7 +625,7 @@ handle_ist_exception:
         movq  %rdi,%rsp
         rep   movsq
 1:      movq  %rsp,%rdi
-        movl  UREGS_entry_vector(%rsp),%eax
+        movzbl UREGS_entry_vector(%rsp),%eax
         leaq  exception_table(%rip),%rdx
         callq *(%rdx,%rax,8)
         jmp   ret_from_intr
diff -r 3daa252ed132 -r ab2dc9b9f68d xen/arch/x86/x86_64/traps.c
--- a/xen/arch/x86/x86_64/traps.c	Tue Oct 30 16:44:43 2012 +0100
+++ b/xen/arch/x86/x86_64/traps.c	Tue Oct 30 16:46:07 2012 +0100
@@ -67,10 +67,15 @@ static void _show_registers(
            regs->rbp, regs->rsp, regs->r8);
     printk("r9:  %016lx   r10: %016lx   r11: %016lx\n",
            regs->r9,  regs->r10, regs->r11);
-    printk("r12: %016lx   r13: %016lx   r14: %016lx\n",
-           regs->r12, regs->r13, regs->r14);
-    printk("r15: %016lx   cr0: %016lx   cr4: %016lx\n",
-           regs->r15, crs[0], crs[4]);
+    if ( !(regs->entry_vector & TRAP_regs_partial) )
+    {
+        printk("r12: %016lx   r13: %016lx   r14: %016lx\n",
+               regs->r12, regs->r13, regs->r14);
+        printk("r15: %016lx   cr0: %016lx   cr4: %016lx\n",
+               regs->r15, crs[0], crs[4]);
+    }
+    else
+        printk("cr0: %016lx   cr4: %016lx\n", crs[0], crs[4]);
     printk("cr3: %016lx   cr2: %016lx\n", crs[3], crs[2]);
     printk("ds: %04x   es: %04x   fs: %04x   gs: %04x   "
            "ss: %04x   cs: %04x\n",
@@ -301,7 +306,7 @@ unsigned long do_iret(void)
 
     if ( !(iret_saved.flags & VGCF_in_syscall) )
     {
-        regs->entry_vector = 0;
+        regs->entry_vector &= ~TRAP_syscall;
         regs->r11 = iret_saved.r11;
         regs->rcx = iret_saved.rcx;
     }
diff -r 3daa252ed132 -r ab2dc9b9f68d xen/arch/x86/x86_emulate.c
--- a/xen/arch/x86/x86_emulate.c	Tue Oct 30 16:44:43 2012 +0100
+++ b/xen/arch/x86/x86_emulate.c	Tue Oct 30 16:46:07 2012 +0100
@@ -10,6 +10,7 @@
  */
 
 #include <asm/x86_emulate.h>
+#include <asm/asm_defns.h> /* mark_regs_dirty() */
 #include <asm/processor.h> /* current_cpu_info */
 #include <asm/amd.h> /* cpu_has_amd_erratum() */
 
diff -r 3daa252ed132 -r ab2dc9b9f68d xen/arch/x86/x86_emulate/x86_emulate.c
--- a/xen/arch/x86/x86_emulate/x86_emulate.c	Tue Oct 30 16:44:43 2012 +0100
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c	Tue Oct 30 16:46:07 2012 +0100
@@ -1292,10 +1292,10 @@ decode_register(
     case  9: p = &regs->r9;  break;
     case 10: p = &regs->r10; break;
     case 11: p = &regs->r11; break;
-    case 12: p = &regs->r12; break;
-    case 13: p = &regs->r13; break;
-    case 14: p = &regs->r14; break;
-    case 15: p = &regs->r15; break;
+    case 12: mark_regs_dirty(regs); p = &regs->r12; break;
+    case 13: mark_regs_dirty(regs); p = &regs->r13; break;
+    case 14: mark_regs_dirty(regs); p = &regs->r14; break;
+    case 15: mark_regs_dirty(regs); p = &regs->r15; break;
 #endif
     default: BUG(); p = NULL; break;
     }
diff -r 3daa252ed132 -r ab2dc9b9f68d xen/common/wait.c
--- a/xen/common/wait.c	Tue Oct 30 16:44:43 2012 +0100
+++ b/xen/common/wait.c	Tue Oct 30 16:46:07 2012 +0100
@@ -124,10 +124,12 @@ void wake_up_all(struct waitqueue_head *
 
 static void __prepare_to_wait(struct waitqueue_vcpu *wqv)
 {
-    char *cpu_info = (char *)get_cpu_info();
+    struct cpu_info *cpu_info = get_cpu_info();
     struct vcpu *curr = current;
     unsigned long dummy;
+    u32 entry_vector = cpu_info->guest_cpu_user_regs.entry_vector;
 
+    cpu_info->guest_cpu_user_regs.entry_vector &= ~TRAP_regs_partial;
     ASSERT(wqv->esp == 0);
 
     /* Save current VCPU affinity; force wakeup on *this* CPU only. */
@@ -157,6 +159,8 @@ static void __prepare_to_wait(struct wai
         gdprintk(XENLOG_ERR, "Stack too large in %s\n", __FUNCTION__);
         domain_crash_synchronous();
     }
+
+    cpu_info->guest_cpu_user_regs.entry_vector = entry_vector;
 }
 
 static void __finish_wait(struct waitqueue_vcpu *wqv)
diff -r 3daa252ed132 -r ab2dc9b9f68d xen/include/asm-x86/x86_64/asm_defns.h
--- a/xen/include/asm-x86/x86_64/asm_defns.h	Tue Oct 30 16:44:43 2012 +0100
+++ b/xen/include/asm-x86/x86_64/asm_defns.h	Tue Oct 30 16:46:07 2012 +0100
@@ -26,6 +26,31 @@ 1:      addq  $8,%rsp;
 #define ASSERT_INTERRUPTS_ENABLED  ASSERT_INTERRUPT_STATUS(nz)
 #define ASSERT_INTERRUPTS_DISABLED ASSERT_INTERRUPT_STATUS(z)
 
+/*
+ * This flag is set in an exception frame when registers R12-R15 did not get
+ * saved.
+ */
+#define _TRAP_regs_partial 16
+#define TRAP_regs_partial  (1 << _TRAP_regs_partial)
+/*
+ * This flag gets set in an exception frame when registers R12-R15 possibly
+ * get modified from their originally saved values and hence need to be
+ * restored even if the normal call flow would restore register values.
+ *
+ * The flag being set implies _TRAP_regs_partial to be unset. Restoring
+ * R12-R15 thus is
+ * - required when this flag is set,
+ * - safe when _TRAP_regs_partial is unset.
+ */
+#define _TRAP_regs_dirty   17
+#define TRAP_regs_dirty    (1 << _TRAP_regs_dirty)
+
+#define mark_regs_dirty(r) ({ \
+        struct cpu_user_regs *r__ = (r); \
+        ASSERT(!((r__)->entry_vector & TRAP_regs_partial)); \
+        r__->entry_vector |= TRAP_regs_dirty; \
+})
+
 #define SAVE_ALL                                \
         addq  $-(UREGS_error_code-UREGS_r15), %rsp; \
         cld;                                    \
@@ -47,11 +72,66 @@ 1:      addq  $8,%rsp;
         movq  %r15,UREGS_r15(%rsp);             \
 
 #ifdef __ASSEMBLY__
-.macro LOAD_C_CLOBBERED
+
+/*
+ * Save all registers not preserved by C code or used in entry/exit code. Mark
+ * the frame as partial.
+ *
+ * @type: exception type
+ * @compat: R8-R15 don't need saving, and the frame nevertheless is complete
+ */
+.macro SAVE_VOLATILE type compat=0
+.if \compat
+        movl  $\type,UREGS_entry_vector-UREGS_error_code(%rsp)
+.else
+        movl  $\type|TRAP_regs_partial,\
+              UREGS_entry_vector-UREGS_error_code(%rsp)
+.endif
+        addq  $-(UREGS_error_code-UREGS_r15),%rsp
+        cld
+        movq  %rdi,UREGS_rdi(%rsp)
+        movq  %rsi,UREGS_rsi(%rsp)
+        movq  %rdx,UREGS_rdx(%rsp)
+        movq  %rcx,UREGS_rcx(%rsp)
+        movq  %rax,UREGS_rax(%rsp)
+.if !\compat
+        movq  %r8,UREGS_r8(%rsp)
+        movq  %r9,UREGS_r9(%rsp)
+        movq  %r10,UREGS_r10(%rsp)
+        movq  %r11,UREGS_r11(%rsp)
+.endif
+        movq  %rbx,UREGS_rbx(%rsp)
+        movq  %rbp,UREGS_rbp(%rsp)
+        SETUP_EXCEPTION_FRAME_POINTER(UREGS_rbp)
+.endm
+
+/*
+ * Complete a frame potentially only partially saved.
+ */
+.macro SAVE_PRESERVED
+        btrl  $_TRAP_regs_partial,UREGS_entry_vector(%rsp)
+        jnc   987f
+        movq  %r12,UREGS_r12(%rsp)
+        movq  %r13,UREGS_r13(%rsp)
+        movq  %r14,UREGS_r14(%rsp)
+        movq  %r15,UREGS_r15(%rsp)
+987:
+.endm
+
+/*
+ * Reload registers not preserved by C code from frame.
+ *
+ * @compat: R8-R11 don't need reloading
+ *
+ * For the way it is used in RESTORE_ALL, this macro must preserve EFLAGS.ZF.
+ */
+.macro LOAD_C_CLOBBERED compat=0
+.if !\compat
         movq  UREGS_r11(%rsp),%r11
         movq  UREGS_r10(%rsp),%r10
         movq  UREGS_r9(%rsp),%r9
         movq  UREGS_r8(%rsp),%r8
+.endif
         movq  UREGS_rax(%rsp),%rax
         movq  UREGS_rcx(%rsp),%rcx
         movq  UREGS_rdx(%rsp),%rdx
@@ -59,16 +139,45 @@ 1:      addq  $8,%rsp;
         movq  UREGS_rdi(%rsp),%rdi
 .endm
 
-.macro RESTORE_ALL adj=0
+/*
+ * Restore all previously saved registers.
+ *
+ * @adj: extra stack pointer adjustment to be folded into the adjustment done
+ *       anyway at the end of the macro
+ * @compat: R8-R15 don't need reloading
+ */
+.macro RESTORE_ALL adj=0 compat=0
+.if !\compat
+        testl $TRAP_regs_dirty,UREGS_entry_vector(%rsp)
+.endif
+        LOAD_C_CLOBBERED \compat
+.if !\compat
+        jz    987f
         movq  UREGS_r15(%rsp),%r15
         movq  UREGS_r14(%rsp),%r14
         movq  UREGS_r13(%rsp),%r13
         movq  UREGS_r12(%rsp),%r12
-        movq  UREGS_rbp(%rsp),%rbp
+#ifndef NDEBUG
+        .subsection 1
+987:    testl $TRAP_regs_partial,UREGS_entry_vector(%rsp)
+        jnz   987f
+        cmpq  UREGS_r15(%rsp),%r15
+        jne   789f
+        cmpq  UREGS_r14(%rsp),%r14
+        jne   789f
+        cmpq  UREGS_r13(%rsp),%r13
+        jne   789f
+        cmpq  UREGS_r12(%rsp),%r12
+        je    987f
+789:    ud2
+        .subsection 0
+#endif
+.endif
+987:    movq  UREGS_rbp(%rsp),%rbp
         movq  UREGS_rbx(%rsp),%rbx
-        LOAD_C_CLOBBERED
         subq  $-(UREGS_error_code-UREGS_r15+\adj), %rsp
 .endm
+
 #endif
 
 #ifdef PERF_COUNTERS

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

From xen-changelog-bounces@lists.xen.org Wed Oct 31 02:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 31 Oct 2012 02:55:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TTOSb-0008Qi-Jk; Wed, 31 Oct 2012 02:55:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TTOSa-0008QP-Gu
	for xen-changelog@lists.xensource.com; Wed, 31 Oct 2012 02:55:16 +0000
Received: from [85.158.143.99:46730] by server-3.bemta-4.messagelabs.com id
	2C/F8-06841-31390905; Wed, 31 Oct 2012 02:55:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-216.messagelabs.com!1351652112!16807037!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 513 invoked from network); 31 Oct 2012 02:55:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Oct 2012 02:55:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TTOSW-0001re-6H
	for xen-changelog@lists.xensource.com; Wed, 31 Oct 2012 02:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TTOSV-0000zu-QY
	for xen-changelog@lists.xensource.com; Wed, 31 Oct 2012 02:55:11 +0000
Message-Id: <E1TTOSV-0000zu-QY@xenbits.xen.org>
Date: Wed, 31 Oct 2012 02:55:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: save/restore only partial
	register state where possible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1351611967 -3600
# Node ID ab2dc9b9f68dc4561619a50b05c6409834eda65e
# Parent  3daa252ed1321668a40749f1d47b1e9cf8c5a479
x86: save/restore only partial register state where possible

... and make restore conditional not only upon having saved the state,
but also upon whether saved state was actually modified (and register
values are known to have been preserved).

Note that RBP is unconditionally considered a volatile register (i.e.
irrespective of CONFIG_FRAME_POINTER), since the RBP handling would
become overly complicated due to the need to save/restore it on the
compat mode hypercall path [6th argument].

Note further that for compat mode code paths, saving/restoring R8...R15
is entirely unnecessary - we don't allow those guests to enter 64-bit
mode, and hence they have no way of seeing these registers' contents
(and there consequently also is no information leak, except if the
context saving domctl would be considered such).

Finally, note that this may not properly deal with gdbstub's needs, yet
(but if so, I can't really suggest adjustments, as I don't know that
code).

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


diff -r 3daa252ed132 -r ab2dc9b9f68d tools/tests/x86_emulator/x86_emulate.c
--- a/tools/tests/x86_emulator/x86_emulate.c	Tue Oct 30 16:44:43 2012 +0100
+++ b/tools/tests/x86_emulator/x86_emulate.c	Tue Oct 30 16:46:07 2012 +0100
@@ -10,6 +10,7 @@ typedef bool bool_t;
 #define BUG() abort()
 
 #define cpu_has_amd_erratum(nr) 0
+#define mark_regs_dirty(r) ((void)(r))
 
 #include "x86_emulate/x86_emulate.h"
 #include "x86_emulate/x86_emulate.c"
diff -r 3daa252ed132 -r ab2dc9b9f68d xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Tue Oct 30 16:44:43 2012 +0100
+++ b/xen/arch/x86/domain.c	Tue Oct 30 16:46:07 2012 +0100
@@ -143,6 +143,7 @@ static void continue_idle_domain(struct 
 static void continue_nonidle_domain(struct vcpu *v)
 {
     check_wakeup_from_wait();
+    mark_regs_dirty(guest_cpu_user_regs());
     reset_stack_and_jump(ret_from_intr);
 }
 
@@ -1312,7 +1313,7 @@ static void load_segments(struct vcpu *n
             if ( test_bit(_VGCF_failsafe_disables_events, &n->arch.vgc_flags) )
                 vcpu_info(n, evtchn_upcall_mask) = 1;
 
-            regs->entry_vector  = TRAP_syscall;
+            regs->entry_vector |= TRAP_syscall;
             regs->_eflags      &= 0xFFFCBEFFUL;
             regs->ss            = FLAT_COMPAT_KERNEL_SS;
             regs->_esp          = (unsigned long)(esp-7);
@@ -1354,7 +1355,7 @@ static void load_segments(struct vcpu *n
         if ( test_bit(_VGCF_failsafe_disables_events, &n->arch.vgc_flags) )
             vcpu_info(n, evtchn_upcall_mask) = 1;
 
-        regs->entry_vector  = TRAP_syscall;
+        regs->entry_vector |= TRAP_syscall;
         regs->rflags       &= ~(X86_EFLAGS_AC|X86_EFLAGS_VM|X86_EFLAGS_RF|
                                 X86_EFLAGS_NT|X86_EFLAGS_TF);
         regs->ss            = FLAT_KERNEL_SS;
diff -r 3daa252ed132 -r ab2dc9b9f68d xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c	Tue Oct 30 16:44:43 2012 +0100
+++ b/xen/arch/x86/irq.c	Tue Oct 30 16:46:07 2012 +0100
@@ -704,7 +704,7 @@ void irq_complete_move(struct irq_desc *
     if (likely(!desc->arch.move_in_progress))
         return;
 
-    vector = get_irq_regs()->entry_vector;
+    vector = (u8)get_irq_regs()->entry_vector;
     me = smp_processor_id();
 
     if ( vector == desc->arch.vector &&
@@ -798,7 +798,7 @@ void do_IRQ(struct cpu_user_regs *regs)
     struct irqaction *action;
     uint32_t          tsc_in;
     struct irq_desc  *desc;
-    unsigned int      vector = regs->entry_vector;
+    unsigned int      vector = (u8)regs->entry_vector;
     int irq = __get_cpu_var(vector_irq[vector]);
     struct cpu_user_regs *old_regs = set_irq_regs(regs);
     
@@ -892,7 +892,7 @@ void do_IRQ(struct cpu_user_regs *regs)
 
  out:
     if ( desc->handler->end )
-        desc->handler->end(desc, regs->entry_vector);
+        desc->handler->end(desc, vector);
  out_no_end:
     spin_unlock(&desc->lock);
  out_no_unlock:
@@ -1113,7 +1113,7 @@ static void __do_IRQ_guest(int irq)
     struct domain      *d;
     int                 i, sp;
     struct pending_eoi *peoi = this_cpu(pending_eoi);
-    int vector = get_irq_regs()->entry_vector;
+    unsigned int        vector = (u8)get_irq_regs()->entry_vector;
 
     if ( unlikely(action->nr_guests == 0) )
     {
diff -r 3daa252ed132 -r ab2dc9b9f68d xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c	Tue Oct 30 16:44:43 2012 +0100
+++ b/xen/arch/x86/traps.c	Tue Oct 30 16:46:07 2012 +0100
@@ -2082,6 +2082,7 @@ static int emulate_privileged_op(struct 
             goto fail;
         if ( admin_io_okay(port, op_bytes, v, regs) )
         {
+            mark_regs_dirty(regs);
             io_emul(regs);            
         }
         else
@@ -2111,6 +2112,7 @@ static int emulate_privileged_op(struct 
             goto fail;
         if ( admin_io_okay(port, op_bytes, v, regs) )
         {
+            mark_regs_dirty(regs);
             io_emul(regs);            
             if ( (op_bytes == 1) && pv_post_outb_hook )
                 pv_post_outb_hook(port, regs->eax);
diff -r 3daa252ed132 -r ab2dc9b9f68d xen/arch/x86/x86_64/compat/entry.S
--- a/xen/arch/x86/x86_64/compat/entry.S	Tue Oct 30 16:44:43 2012 +0100
+++ b/xen/arch/x86/x86_64/compat/entry.S	Tue Oct 30 16:46:07 2012 +0100
@@ -14,8 +14,7 @@
 
 ENTRY(compat_hypercall)
         pushq $0
-        movl  $TRAP_syscall,4(%rsp)
-        SAVE_ALL
+        SAVE_VOLATILE type=TRAP_syscall compat=1
 
         cmpb  $0,untrusted_msi(%rip)
 UNLIKELY_START(ne, msi_check)
@@ -126,6 +125,7 @@ compat_test_guest_events:
 /* %rbx: struct vcpu */
 compat_process_softirqs:
         sti
+        andl  $~TRAP_regs_partial,UREGS_entry_vector(%rsp)
         call  do_softirq
         jmp   compat_test_all_events
 
@@ -172,7 +172,7 @@ compat_bad_hypercall:
 /* %rbx: struct vcpu, interrupts disabled */
 compat_restore_all_guest:
         ASSERT_INTERRUPTS_DISABLED
-        RESTORE_ALL adj=8
+        RESTORE_ALL adj=8 compat=1
 .Lft0:  iretq
 
 .section .fixup,"ax"
@@ -243,7 +243,7 @@ UNLIKELY_END(compat_syscall_gpf)
 
 ENTRY(compat_sysenter)
         movq  VCPU_trap_ctxt(%rbx),%rcx
-        cmpl  $TRAP_gp_fault,UREGS_entry_vector(%rsp)
+        cmpb  $TRAP_gp_fault,UREGS_entry_vector(%rsp)
         movzwl VCPU_sysenter_sel(%rbx),%eax
         movzwl TRAP_gp_fault * TRAPINFO_sizeof + TRAPINFO_cs(%rcx),%ecx
         cmovel %ecx,%eax
diff -r 3daa252ed132 -r ab2dc9b9f68d xen/arch/x86/x86_64/entry.S
--- a/xen/arch/x86/x86_64/entry.S	Tue Oct 30 16:44:43 2012 +0100
+++ b/xen/arch/x86/x86_64/entry.S	Tue Oct 30 16:46:07 2012 +0100
@@ -123,9 +123,8 @@ ENTRY(syscall_enter)
         movl  $FLAT_KERNEL_SS,24(%rsp)
         pushq %rcx
         pushq $0
-        movl  $TRAP_syscall,4(%rsp)
-        movq  24(%rsp),%r11 /* Re-load user RFLAGS into %r11 before SAVE_ALL */
-        SAVE_ALL
+        movq  24(%rsp),%r11 /* Re-load user RFLAGS into %r11 before saving */
+        SAVE_VOLATILE TRAP_syscall
         GET_CURRENT(%rbx)
         movq  VCPU_domain(%rbx),%rcx
         testb $1,DOMAIN_is_32bit_pv(%rcx)
@@ -222,6 +221,7 @@ test_guest_events:
 /* %rbx: struct vcpu */
 process_softirqs:
         sti       
+        SAVE_PRESERVED
         call do_softirq
         jmp  test_all_events
 
@@ -275,8 +275,7 @@ sysenter_eflags_saved:
         pushq $3 /* ring 3 null cs */
         pushq $0 /* null rip */
         pushq $0
-        movl  $TRAP_syscall,4(%rsp)
-        SAVE_ALL
+        SAVE_VOLATILE TRAP_syscall
         GET_CURRENT(%rbx)
         cmpb  $0,VCPU_sysenter_disables_events(%rbx)
         movq  VCPU_sysenter_addr(%rbx),%rax
@@ -286,6 +285,7 @@ sysenter_eflags_saved:
         leal  (,%rcx,TBF_INTERRUPT),%ecx
 UNLIKELY_START(z, sysenter_gpf)
         movq  VCPU_trap_ctxt(%rbx),%rsi
+        SAVE_PRESERVED
         movl  $TRAP_gp_fault,UREGS_entry_vector(%rsp)
         movl  %eax,TRAPBOUNCE_error_code(%rdx)
         movq  TRAP_gp_fault * TRAPINFO_sizeof + TRAPINFO_eip(%rsi),%rax
@@ -302,7 +302,7 @@ UNLIKELY_END(sysenter_gpf)
 
 ENTRY(int80_direct_trap)
         pushq $0
-        SAVE_ALL
+        SAVE_VOLATILE 0x80
 
         cmpb  $0,untrusted_msi(%rip)
 UNLIKELY_START(ne, msi_check)
@@ -331,6 +331,7 @@ int80_slow_path:
          * IDT entry with DPL==0.
          */
         movl  $((0x80 << 3) | 0x2),UREGS_error_code(%rsp)
+        SAVE_PRESERVED
         movl  $TRAP_gp_fault,UREGS_entry_vector(%rsp)
         /* A GPF wouldn't have incremented the instruction pointer. */
         subq  $2,UREGS_rip(%rsp)
@@ -412,7 +413,7 @@ UNLIKELY_END(bounce_failsafe)
         /* Rewrite our stack frame and return to guest-OS mode. */
         /* IA32 Ref. Vol. 3: TF, VM, RF and NT flags are cleared on trap. */
         /* Also clear AC: alignment checks shouldn't trigger in kernel mode. */
-        movl  $TRAP_syscall,UREGS_entry_vector+8(%rsp)
+        orl   $TRAP_syscall,UREGS_entry_vector+8(%rsp)
         andl  $~(X86_EFLAGS_AC|X86_EFLAGS_VM|X86_EFLAGS_RF|\
                  X86_EFLAGS_NT|X86_EFLAGS_TF),UREGS_eflags+8(%rsp)
         movq  $FLAT_KERNEL_SS,UREGS_ss+8(%rsp)
@@ -477,7 +478,7 @@ handle_exception_saved:
         jz    exception_with_ints_disabled
         sti
 1:      movq  %rsp,%rdi
-        movl  UREGS_entry_vector(%rsp),%eax
+        movzbl UREGS_entry_vector(%rsp),%eax
         leaq  exception_table(%rip),%rdx
         GET_CURRENT(%rbx)
         PERFC_INCR(exceptions, %rax, %rbx)
@@ -518,7 +519,7 @@ 1:      movq  UREGS_error_code(%rsp),%ra
 
 /* No special register assumptions. */
 FATAL_exception_with_ints_disabled:
-        movl  UREGS_entry_vector(%rsp),%edi
+        movzbl UREGS_entry_vector(%rsp),%edi
         movq  %rsp,%rsi
         call  fatal_trap
         ud2
@@ -624,7 +625,7 @@ handle_ist_exception:
         movq  %rdi,%rsp
         rep   movsq
 1:      movq  %rsp,%rdi
-        movl  UREGS_entry_vector(%rsp),%eax
+        movzbl UREGS_entry_vector(%rsp),%eax
         leaq  exception_table(%rip),%rdx
         callq *(%rdx,%rax,8)
         jmp   ret_from_intr
diff -r 3daa252ed132 -r ab2dc9b9f68d xen/arch/x86/x86_64/traps.c
--- a/xen/arch/x86/x86_64/traps.c	Tue Oct 30 16:44:43 2012 +0100
+++ b/xen/arch/x86/x86_64/traps.c	Tue Oct 30 16:46:07 2012 +0100
@@ -67,10 +67,15 @@ static void _show_registers(
            regs->rbp, regs->rsp, regs->r8);
     printk("r9:  %016lx   r10: %016lx   r11: %016lx\n",
            regs->r9,  regs->r10, regs->r11);
-    printk("r12: %016lx   r13: %016lx   r14: %016lx\n",
-           regs->r12, regs->r13, regs->r14);
-    printk("r15: %016lx   cr0: %016lx   cr4: %016lx\n",
-           regs->r15, crs[0], crs[4]);
+    if ( !(regs->entry_vector & TRAP_regs_partial) )
+    {
+        printk("r12: %016lx   r13: %016lx   r14: %016lx\n",
+               regs->r12, regs->r13, regs->r14);
+        printk("r15: %016lx   cr0: %016lx   cr4: %016lx\n",
+               regs->r15, crs[0], crs[4]);
+    }
+    else
+        printk("cr0: %016lx   cr4: %016lx\n", crs[0], crs[4]);
     printk("cr3: %016lx   cr2: %016lx\n", crs[3], crs[2]);
     printk("ds: %04x   es: %04x   fs: %04x   gs: %04x   "
            "ss: %04x   cs: %04x\n",
@@ -301,7 +306,7 @@ unsigned long do_iret(void)
 
     if ( !(iret_saved.flags & VGCF_in_syscall) )
     {
-        regs->entry_vector = 0;
+        regs->entry_vector &= ~TRAP_syscall;
         regs->r11 = iret_saved.r11;
         regs->rcx = iret_saved.rcx;
     }
diff -r 3daa252ed132 -r ab2dc9b9f68d xen/arch/x86/x86_emulate.c
--- a/xen/arch/x86/x86_emulate.c	Tue Oct 30 16:44:43 2012 +0100
+++ b/xen/arch/x86/x86_emulate.c	Tue Oct 30 16:46:07 2012 +0100
@@ -10,6 +10,7 @@
  */
 
 #include <asm/x86_emulate.h>
+#include <asm/asm_defns.h> /* mark_regs_dirty() */
 #include <asm/processor.h> /* current_cpu_info */
 #include <asm/amd.h> /* cpu_has_amd_erratum() */
 
diff -r 3daa252ed132 -r ab2dc9b9f68d xen/arch/x86/x86_emulate/x86_emulate.c
--- a/xen/arch/x86/x86_emulate/x86_emulate.c	Tue Oct 30 16:44:43 2012 +0100
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c	Tue Oct 30 16:46:07 2012 +0100
@@ -1292,10 +1292,10 @@ decode_register(
     case  9: p = &regs->r9;  break;
     case 10: p = &regs->r10; break;
     case 11: p = &regs->r11; break;
-    case 12: p = &regs->r12; break;
-    case 13: p = &regs->r13; break;
-    case 14: p = &regs->r14; break;
-    case 15: p = &regs->r15; break;
+    case 12: mark_regs_dirty(regs); p = &regs->r12; break;
+    case 13: mark_regs_dirty(regs); p = &regs->r13; break;
+    case 14: mark_regs_dirty(regs); p = &regs->r14; break;
+    case 15: mark_regs_dirty(regs); p = &regs->r15; break;
 #endif
     default: BUG(); p = NULL; break;
     }
diff -r 3daa252ed132 -r ab2dc9b9f68d xen/common/wait.c
--- a/xen/common/wait.c	Tue Oct 30 16:44:43 2012 +0100
+++ b/xen/common/wait.c	Tue Oct 30 16:46:07 2012 +0100
@@ -124,10 +124,12 @@ void wake_up_all(struct waitqueue_head *
 
 static void __prepare_to_wait(struct waitqueue_vcpu *wqv)
 {
-    char *cpu_info = (char *)get_cpu_info();
+    struct cpu_info *cpu_info = get_cpu_info();
     struct vcpu *curr = current;
     unsigned long dummy;
+    u32 entry_vector = cpu_info->guest_cpu_user_regs.entry_vector;
 
+    cpu_info->guest_cpu_user_regs.entry_vector &= ~TRAP_regs_partial;
     ASSERT(wqv->esp == 0);
 
     /* Save current VCPU affinity; force wakeup on *this* CPU only. */
@@ -157,6 +159,8 @@ static void __prepare_to_wait(struct wai
         gdprintk(XENLOG_ERR, "Stack too large in %s\n", __FUNCTION__);
         domain_crash_synchronous();
     }
+
+    cpu_info->guest_cpu_user_regs.entry_vector = entry_vector;
 }
 
 static void __finish_wait(struct waitqueue_vcpu *wqv)
diff -r 3daa252ed132 -r ab2dc9b9f68d xen/include/asm-x86/x86_64/asm_defns.h
--- a/xen/include/asm-x86/x86_64/asm_defns.h	Tue Oct 30 16:44:43 2012 +0100
+++ b/xen/include/asm-x86/x86_64/asm_defns.h	Tue Oct 30 16:46:07 2012 +0100
@@ -26,6 +26,31 @@ 1:      addq  $8,%rsp;
 #define ASSERT_INTERRUPTS_ENABLED  ASSERT_INTERRUPT_STATUS(nz)
 #define ASSERT_INTERRUPTS_DISABLED ASSERT_INTERRUPT_STATUS(z)
 
+/*
+ * This flag is set in an exception frame when registers R12-R15 did not get
+ * saved.
+ */
+#define _TRAP_regs_partial 16
+#define TRAP_regs_partial  (1 << _TRAP_regs_partial)
+/*
+ * This flag gets set in an exception frame when registers R12-R15 possibly
+ * get modified from their originally saved values and hence need to be
+ * restored even if the normal call flow would restore register values.
+ *
+ * The flag being set implies _TRAP_regs_partial to be unset. Restoring
+ * R12-R15 thus is
+ * - required when this flag is set,
+ * - safe when _TRAP_regs_partial is unset.
+ */
+#define _TRAP_regs_dirty   17
+#define TRAP_regs_dirty    (1 << _TRAP_regs_dirty)
+
+#define mark_regs_dirty(r) ({ \
+        struct cpu_user_regs *r__ = (r); \
+        ASSERT(!((r__)->entry_vector & TRAP_regs_partial)); \
+        r__->entry_vector |= TRAP_regs_dirty; \
+})
+
 #define SAVE_ALL                                \
         addq  $-(UREGS_error_code-UREGS_r15), %rsp; \
         cld;                                    \
@@ -47,11 +72,66 @@ 1:      addq  $8,%rsp;
         movq  %r15,UREGS_r15(%rsp);             \
 
 #ifdef __ASSEMBLY__
-.macro LOAD_C_CLOBBERED
+
+/*
+ * Save all registers not preserved by C code or used in entry/exit code. Mark
+ * the frame as partial.
+ *
+ * @type: exception type
+ * @compat: R8-R15 don't need saving, and the frame nevertheless is complete
+ */
+.macro SAVE_VOLATILE type compat=0
+.if \compat
+        movl  $\type,UREGS_entry_vector-UREGS_error_code(%rsp)
+.else
+        movl  $\type|TRAP_regs_partial,\
+              UREGS_entry_vector-UREGS_error_code(%rsp)
+.endif
+        addq  $-(UREGS_error_code-UREGS_r15),%rsp
+        cld
+        movq  %rdi,UREGS_rdi(%rsp)
+        movq  %rsi,UREGS_rsi(%rsp)
+        movq  %rdx,UREGS_rdx(%rsp)
+        movq  %rcx,UREGS_rcx(%rsp)
+        movq  %rax,UREGS_rax(%rsp)
+.if !\compat
+        movq  %r8,UREGS_r8(%rsp)
+        movq  %r9,UREGS_r9(%rsp)
+        movq  %r10,UREGS_r10(%rsp)
+        movq  %r11,UREGS_r11(%rsp)
+.endif
+        movq  %rbx,UREGS_rbx(%rsp)
+        movq  %rbp,UREGS_rbp(%rsp)
+        SETUP_EXCEPTION_FRAME_POINTER(UREGS_rbp)
+.endm
+
+/*
+ * Complete a frame potentially only partially saved.
+ */
+.macro SAVE_PRESERVED
+        btrl  $_TRAP_regs_partial,UREGS_entry_vector(%rsp)
+        jnc   987f
+        movq  %r12,UREGS_r12(%rsp)
+        movq  %r13,UREGS_r13(%rsp)
+        movq  %r14,UREGS_r14(%rsp)
+        movq  %r15,UREGS_r15(%rsp)
+987:
+.endm
+
+/*
+ * Reload registers not preserved by C code from frame.
+ *
+ * @compat: R8-R11 don't need reloading
+ *
+ * For the way it is used in RESTORE_ALL, this macro must preserve EFLAGS.ZF.
+ */
+.macro LOAD_C_CLOBBERED compat=0
+.if !\compat
         movq  UREGS_r11(%rsp),%r11
         movq  UREGS_r10(%rsp),%r10
         movq  UREGS_r9(%rsp),%r9
         movq  UREGS_r8(%rsp),%r8
+.endif
         movq  UREGS_rax(%rsp),%rax
         movq  UREGS_rcx(%rsp),%rcx
         movq  UREGS_rdx(%rsp),%rdx
@@ -59,16 +139,45 @@ 1:      addq  $8,%rsp;
         movq  UREGS_rdi(%rsp),%rdi
 .endm
 
-.macro RESTORE_ALL adj=0
+/*
+ * Restore all previously saved registers.
+ *
+ * @adj: extra stack pointer adjustment to be folded into the adjustment done
+ *       anyway at the end of the macro
+ * @compat: R8-R15 don't need reloading
+ */
+.macro RESTORE_ALL adj=0 compat=0
+.if !\compat
+        testl $TRAP_regs_dirty,UREGS_entry_vector(%rsp)
+.endif
+        LOAD_C_CLOBBERED \compat
+.if !\compat
+        jz    987f
         movq  UREGS_r15(%rsp),%r15
         movq  UREGS_r14(%rsp),%r14
         movq  UREGS_r13(%rsp),%r13
         movq  UREGS_r12(%rsp),%r12
-        movq  UREGS_rbp(%rsp),%rbp
+#ifndef NDEBUG
+        .subsection 1
+987:    testl $TRAP_regs_partial,UREGS_entry_vector(%rsp)
+        jnz   987f
+        cmpq  UREGS_r15(%rsp),%r15
+        jne   789f
+        cmpq  UREGS_r14(%rsp),%r14
+        jne   789f
+        cmpq  UREGS_r13(%rsp),%r13
+        jne   789f
+        cmpq  UREGS_r12(%rsp),%r12
+        je    987f
+789:    ud2
+        .subsection 0
+#endif
+.endif
+987:    movq  UREGS_rbp(%rsp),%rbp
         movq  UREGS_rbx(%rsp),%rbx
-        LOAD_C_CLOBBERED
         subq  $-(UREGS_error_code-UREGS_r15+\adj), %rsp
 .endm
+
 #endif
 
 #ifdef PERF_COUNTERS

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

From xen-changelog-bounces@lists.xen.org Wed Oct 31 02:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 31 Oct 2012 02:55:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TTOSd-0008R7-QQ; Wed, 31 Oct 2012 02:55:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TTOSc-0008Qh-4B
	for xen-changelog@lists.xensource.com; Wed, 31 Oct 2012 02:55:18 +0000
Received: from [85.158.138.51:65349] by server-5.bemta-3.messagelabs.com id
	0B/8A-12440-51390905; Wed, 31 Oct 2012 02:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-174.messagelabs.com!1351652114!21717907!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23468 invoked from network); 31 Oct 2012 02:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Oct 2012 02:55:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TTOSY-0001rk-CX
	for xen-changelog@lists.xensource.com; Wed, 31 Oct 2012 02:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TTOSX-00010A-2F
	for xen-changelog@lists.xensource.com; Wed, 31 Oct 2012 02:55:13 +0000
Message-Id: <E1TTOSX-00010A-2F@xenbits.xen.org>
Date: Wed, 31 Oct 2012 02:55:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] autoconf: check for wget and ftp
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Roger Pau Monne <roger.pau@citrix.com>
# Date 1351620662 0
# Node ID f6d5b3bf74a83fe84eb2909657b7f1db7f0f8253
# Parent  ab2dc9b9f68dc4561619a50b05c6409834eda65e
autoconf: check for wget and ftp

Some OSes don't come with wget by default, so ftp should be choosen
on those. Add an autoconf check to check for wget and ftp, and
replace the usage of hardcoded wget in tools.

[ Stubdom builds still use wget unconditionally. -iwj ]

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


diff -r ab2dc9b9f68d -r f6d5b3bf74a8 config/StdGNU.mk
--- a/config/StdGNU.mk	Tue Oct 30 16:46:07 2012 +0100
+++ b/config/StdGNU.mk	Tue Oct 30 18:11:02 2012 +0000
@@ -22,8 +22,6 @@ MSGMERGE   = msgmerge
 # Allow git to be wrappered in the environment
 GIT        ?= git
 
-WGET       ?= wget -c
-
 INSTALL      = install
 INSTALL_DIR  = $(INSTALL) -d -m0755 -p
 INSTALL_DATA = $(INSTALL) -m0644 -p
diff -r ab2dc9b9f68d -r f6d5b3bf74a8 config/Tools.mk.in
--- a/config/Tools.mk.in	Tue Oct 30 16:46:07 2012 +0100
+++ b/config/Tools.mk.in	Tue Oct 30 18:11:02 2012 +0000
@@ -22,6 +22,7 @@ AS86                := @AS86@
 LD86                := @LD86@
 BCC                 := @BCC@
 IASL                := @IASL@
+FETCHER             := @FETCHER@
 
 # Extra folder for libs/includes
 PREPEND_INCLUDES    := @PREPEND_INCLUDES@
diff -r ab2dc9b9f68d -r f6d5b3bf74a8 tools/configure
--- a/tools/configure	Tue Oct 30 16:46:07 2012 +0100
+++ b/tools/configure	Tue Oct 30 18:11:02 2012 +0000
@@ -606,6 +606,9 @@ libgcrypt
 EXTFS_LIBS
 system_aio
 zlib
+FETCHER
+FTP
+WGET
 glib_LIBS
 glib_CFLAGS
 PKG_CONFIG_LIBDIR
@@ -2392,6 +2395,8 @@ case $host_os in *\ *) host_os=`echo "$h
 
 
 
+
+
 # Enable/disable options
 
 # Check whether --enable-githttp was given.
@@ -6095,6 +6100,108 @@ else
 
 fi
 
+# Extract the first word of "wget", so it can be a program name with args.
+set dummy wget; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_WGET+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $WGET in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_WGET="$WGET" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_WGET="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_WGET" && ac_cv_path_WGET="no"
+  ;;
+esac
+fi
+WGET=$ac_cv_path_WGET
+if test -n "$WGET"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WGET" >&5
+$as_echo "$WGET" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+if test x"$WGET" != x"no"; then :
+
+    FETCHER="$WGET -c -O"
+
+else
+
+    # Extract the first word of "ftp", so it can be a program name with args.
+set dummy ftp; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_FTP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $FTP in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_FTP="$FTP" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_FTP="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_FTP" && ac_cv_path_FTP="no"
+  ;;
+esac
+fi
+FTP=$ac_cv_path_FTP
+if test -n "$FTP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FTP" >&5
+$as_echo "$FTP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    if test x"$FTP" != x"no"; then :
+
+        FETCHER="$FTP -o"
+
+else
+
+        as_fn_error $? "cannot find wget or ftp" "$LINENO" 5
+
+fi
+
+fi
+
+
+
 # Checks for libraries.
 ac_fn_c_check_header_mongrel "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "$ac_includes_default"
 if test "x$ac_cv_header_bzlib_h" = x""yes; then :
diff -r ab2dc9b9f68d -r f6d5b3bf74a8 tools/configure.ac
--- a/tools/configure.ac	Tue Oct 30 16:46:07 2012 +0100
+++ b/tools/configure.ac	Tue Oct 30 18:11:02 2012 +0000
@@ -35,6 +35,7 @@ m4_include([m4/curses.m4])
 m4_include([m4/pthread.m4])
 m4_include([m4/ptyfuncs.m4])
 m4_include([m4/extfs.m4])
+m4_include([m4/fetcher.m4])
 
 # Enable/disable options
 AX_ARG_DEFAULT_DISABLE([githttp], [Download GIT repositories via HTTP])
@@ -117,6 +118,7 @@ esac
  AX_CHECK_UUID
  AX_CHECK_CURSES
 PKG_CHECK_MODULES(glib, [glib-2.0 >= 2.12])
+AX_CHECK_FETCHER
 
 # Checks for libraries.
 AC_CHECK_HEADER([bzlib.h], [
diff -r ab2dc9b9f68d -r f6d5b3bf74a8 tools/firmware/etherboot/Makefile
--- a/tools/firmware/etherboot/Makefile	Tue Oct 30 16:46:07 2012 +0100
+++ b/tools/firmware/etherboot/Makefile	Tue Oct 30 18:11:02 2012 +0000
@@ -28,7 +28,7 @@ all: $(ROMS)
 	$(MAKE) -C $D/src bin/$(*F).rom
 
 $T:
-	if ! wget -O _$T $(IPXE_TARBALL_URL); then \
+	if ! $(FETCHER) _$T $(IPXE_TARBALL_URL); then \
 		$(GIT) clone $(IPXE_GIT_URL) $D.git; \
 		(cd $D.git && $(GIT) archive --format=tar --prefix=$D/ \
 		$(IPXE_GIT_TAG) | gzip >../_$T); \

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

From xen-changelog-bounces@lists.xen.org Wed Oct 31 02:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 31 Oct 2012 02:55:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TTOSd-0008R7-QQ; Wed, 31 Oct 2012 02:55:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TTOSc-0008Qh-4B
	for xen-changelog@lists.xensource.com; Wed, 31 Oct 2012 02:55:18 +0000
Received: from [85.158.138.51:65349] by server-5.bemta-3.messagelabs.com id
	0B/8A-12440-51390905; Wed, 31 Oct 2012 02:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-174.messagelabs.com!1351652114!21717907!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23468 invoked from network); 31 Oct 2012 02:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Oct 2012 02:55:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TTOSY-0001rk-CX
	for xen-changelog@lists.xensource.com; Wed, 31 Oct 2012 02:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TTOSX-00010A-2F
	for xen-changelog@lists.xensource.com; Wed, 31 Oct 2012 02:55:13 +0000
Message-Id: <E1TTOSX-00010A-2F@xenbits.xen.org>
Date: Wed, 31 Oct 2012 02:55:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] autoconf: check for wget and ftp
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Roger Pau Monne <roger.pau@citrix.com>
# Date 1351620662 0
# Node ID f6d5b3bf74a83fe84eb2909657b7f1db7f0f8253
# Parent  ab2dc9b9f68dc4561619a50b05c6409834eda65e
autoconf: check for wget and ftp

Some OSes don't come with wget by default, so ftp should be choosen
on those. Add an autoconf check to check for wget and ftp, and
replace the usage of hardcoded wget in tools.

[ Stubdom builds still use wget unconditionally. -iwj ]

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


diff -r ab2dc9b9f68d -r f6d5b3bf74a8 config/StdGNU.mk
--- a/config/StdGNU.mk	Tue Oct 30 16:46:07 2012 +0100
+++ b/config/StdGNU.mk	Tue Oct 30 18:11:02 2012 +0000
@@ -22,8 +22,6 @@ MSGMERGE   = msgmerge
 # Allow git to be wrappered in the environment
 GIT        ?= git
 
-WGET       ?= wget -c
-
 INSTALL      = install
 INSTALL_DIR  = $(INSTALL) -d -m0755 -p
 INSTALL_DATA = $(INSTALL) -m0644 -p
diff -r ab2dc9b9f68d -r f6d5b3bf74a8 config/Tools.mk.in
--- a/config/Tools.mk.in	Tue Oct 30 16:46:07 2012 +0100
+++ b/config/Tools.mk.in	Tue Oct 30 18:11:02 2012 +0000
@@ -22,6 +22,7 @@ AS86                := @AS86@
 LD86                := @LD86@
 BCC                 := @BCC@
 IASL                := @IASL@
+FETCHER             := @FETCHER@
 
 # Extra folder for libs/includes
 PREPEND_INCLUDES    := @PREPEND_INCLUDES@
diff -r ab2dc9b9f68d -r f6d5b3bf74a8 tools/configure
--- a/tools/configure	Tue Oct 30 16:46:07 2012 +0100
+++ b/tools/configure	Tue Oct 30 18:11:02 2012 +0000
@@ -606,6 +606,9 @@ libgcrypt
 EXTFS_LIBS
 system_aio
 zlib
+FETCHER
+FTP
+WGET
 glib_LIBS
 glib_CFLAGS
 PKG_CONFIG_LIBDIR
@@ -2392,6 +2395,8 @@ case $host_os in *\ *) host_os=`echo "$h
 
 
 
+
+
 # Enable/disable options
 
 # Check whether --enable-githttp was given.
@@ -6095,6 +6100,108 @@ else
 
 fi
 
+# Extract the first word of "wget", so it can be a program name with args.
+set dummy wget; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_WGET+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $WGET in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_WGET="$WGET" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_WGET="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_WGET" && ac_cv_path_WGET="no"
+  ;;
+esac
+fi
+WGET=$ac_cv_path_WGET
+if test -n "$WGET"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WGET" >&5
+$as_echo "$WGET" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+if test x"$WGET" != x"no"; then :
+
+    FETCHER="$WGET -c -O"
+
+else
+
+    # Extract the first word of "ftp", so it can be a program name with args.
+set dummy ftp; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_FTP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $FTP in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_FTP="$FTP" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_FTP="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_FTP" && ac_cv_path_FTP="no"
+  ;;
+esac
+fi
+FTP=$ac_cv_path_FTP
+if test -n "$FTP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FTP" >&5
+$as_echo "$FTP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    if test x"$FTP" != x"no"; then :
+
+        FETCHER="$FTP -o"
+
+else
+
+        as_fn_error $? "cannot find wget or ftp" "$LINENO" 5
+
+fi
+
+fi
+
+
+
 # Checks for libraries.
 ac_fn_c_check_header_mongrel "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "$ac_includes_default"
 if test "x$ac_cv_header_bzlib_h" = x""yes; then :
diff -r ab2dc9b9f68d -r f6d5b3bf74a8 tools/configure.ac
--- a/tools/configure.ac	Tue Oct 30 16:46:07 2012 +0100
+++ b/tools/configure.ac	Tue Oct 30 18:11:02 2012 +0000
@@ -35,6 +35,7 @@ m4_include([m4/curses.m4])
 m4_include([m4/pthread.m4])
 m4_include([m4/ptyfuncs.m4])
 m4_include([m4/extfs.m4])
+m4_include([m4/fetcher.m4])
 
 # Enable/disable options
 AX_ARG_DEFAULT_DISABLE([githttp], [Download GIT repositories via HTTP])
@@ -117,6 +118,7 @@ esac
  AX_CHECK_UUID
  AX_CHECK_CURSES
 PKG_CHECK_MODULES(glib, [glib-2.0 >= 2.12])
+AX_CHECK_FETCHER
 
 # Checks for libraries.
 AC_CHECK_HEADER([bzlib.h], [
diff -r ab2dc9b9f68d -r f6d5b3bf74a8 tools/firmware/etherboot/Makefile
--- a/tools/firmware/etherboot/Makefile	Tue Oct 30 16:46:07 2012 +0100
+++ b/tools/firmware/etherboot/Makefile	Tue Oct 30 18:11:02 2012 +0000
@@ -28,7 +28,7 @@ all: $(ROMS)
 	$(MAKE) -C $D/src bin/$(*F).rom
 
 $T:
-	if ! wget -O _$T $(IPXE_TARBALL_URL); then \
+	if ! $(FETCHER) _$T $(IPXE_TARBALL_URL); then \
 		$(GIT) clone $(IPXE_GIT_URL) $D.git; \
 		(cd $D.git && $(GIT) archive --format=tar --prefix=$D/ \
 		$(IPXE_GIT_TAG) | gzip >../_$T); \

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

